Changeset 715
- Timestamp:
- Dec 22, 2006, 9:42:39 AM (17 years ago)
- Location:
- trunk/yat/utility
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/utility/Option.cc
r687 r715 41 41 42 42 43 Option::argument_type Option::arg_type(void) const 44 { 45 return arg_type_; 46 } 47 48 49 std::string Option::long_name(void) const 50 { 51 return long_name_; 52 } 53 54 55 std::string Option::name(void) const 56 { 57 return !long_name_.empty() ? long_name_ : std::string(&short_name_) ; 58 } 59 60 61 bool& Option::present(void) 62 { 63 return present_; 64 } 65 66 43 67 void Option::print(void) const 44 68 { … … 61 85 } 62 86 87 88 char Option::short_name(void) const 89 { 90 return short_name_; 91 } 92 93 94 std::string Option::value(void) 95 { 96 return value_; 97 } 98 63 99 }}} // of namespace utility, yat, and theplu -
trunk/yat/utility/Option.h
r687 r715 56 56 Option(char short_name, std::string long_name, 57 57 argument_type arg, std::string desc); 58 59 58 60 59 /// 61 60 /// @return argument type for option 62 61 /// 63 inline const argument_type& arg_type(void) const { return arg_type_; }62 argument_type arg_type(void) const; 64 63 64 /// 65 /// @return long name 66 /// 67 std::string long_name(void) const; 68 65 69 /// 66 70 /// @return long name unless long name is empty in which case the 67 71 /// short one character name is returned. 68 72 /// 69 inline std::string name(void) const 70 { return !long_name_.empty() ? long_name_ : std::string(&short_name_) ; } 73 std::string name(void) const; 71 74 72 75 /// 73 /// @ return short name76 /// @brief Get or set the present status. 74 77 /// 75 inline char short_name(void) const { return short_name_; } 76 78 /// @return true if option has been detected in parsing 77 79 /// 78 /// @return long name 79 /// 80 inline const std::string& long_name(void) const { return long_name_; } 80 bool& present(void); 81 81 82 82 /// … … 88 88 89 89 /// 90 /// @return true if option has been detected in parsing90 /// @return short name 91 91 /// 92 inline bool& present(void) { return present_; }92 char short_name(void) const; 93 93 94 94 /// 95 95 /// @return argument value 96 96 /// 97 inline std::string& value(void) { return value_; }97 std::string value(void); 98 98 99 99 -
trunk/yat/utility/PCA.cc
r703 r715 37 37 : A_(A), process_(false), explained_calc_(false) 38 38 { 39 } 40 41 42 utility::vector PCA::get_eigenvector(size_t i) const 43 { 44 return utility::vector(eigenvectors_,i); 45 } 46 47 48 double PCA::get_eigenvalue(size_t i) const 49 { 50 return eigenvalues_[i]; 39 51 } 40 52 -
trunk/yat/utility/PCA.h
r703 r715 74 74 @return Eigenvector \a i. 75 75 */ 76 inline utility::vector get_eigenvector(size_t i) const 77 { return utility::vector(eigenvectors_,i); } 76 utility::vector get_eigenvector(size_t i) const; 78 77 79 78 /** … … 81 80 \f$ C = \frac{1}{N^2}A^TA \f$ 82 81 */ 83 inline double get_eigenvalue(size_t i) const { return eigenvalues_[i]; } 82 double get_eigenvalue(size_t i) const; 84 83 85 84 /** … … 125 124 intensity 126 125 */ 127 void calculate_explained_intensity( );126 void calculate_explained_intensity(void); 128 127 }; // class PCA 129 128 -
trunk/yat/utility/SVD.cc
r703 r715 50 50 return jacobi(); 51 51 } 52 // the program should never end up here, return values should be52 // Jari, the program should never end up here, return values should be 53 53 // something different from normal GSL return values, or maybe 54 54 // throw an exception. 55 55 return 0; 56 56 } 57 58 57 59 58 … … 65 64 } 66 65 66 67 int SVD::jacobi(void) 68 { 69 return gsl_linalg_SV_decomp_jacobi(U_.gsl_matrix_p(), V_.gsl_matrix_p(), 70 s_.gsl_vector_p()); 71 } 67 72 68 73 … … 77 82 78 83 84 const utility::vector& SVD::s(void) const 85 { 86 return s_; 87 } 88 89 90 int SVD::solve(const utility::vector& b, utility::vector x) 91 { 92 return gsl_linalg_SV_solve(U_.gsl_matrix_p(), V_.gsl_matrix_p(), 93 s_.gsl_vector_p(), b.gsl_vector_p(), 94 x.gsl_vector_p()); 95 } 96 97 98 const utility::matrix& SVD::U(void) const 99 { 100 return U_; 101 } 102 103 104 const utility::matrix& SVD::V(void) const 105 { 106 return V_; 107 } 108 79 109 }}} // of namespace utility, yat, and theplu -
trunk/yat/utility/SVD.h
r703 r715 97 97 /// is undefined. 98 98 /// 99 inline const utility::vector& s(void) const { return s_; }99 const utility::vector& s(void) const; 100 100 101 101 /// … … 108 108 /// @return Whatever GSL returns. 109 109 /// 110 inline int solve(utility::vector b, utility::vector x) 111 { return gsl_linalg_SV_solve(U_.gsl_matrix_p(), V_.gsl_matrix_p(), 112 s_.gsl_vector_p(), b.gsl_vector_p(), 113 x.gsl_vector_p()); } 110 int solve(const utility::vector& b, utility::vector x); 114 111 115 112 /// … … 121 118 /// is undefined. 122 119 /// 123 inline const utility::matrix& U(void) const { return U_; }120 const utility::matrix& U(void) const; 124 121 125 122 /// … … 131 128 /// is undefined. 132 129 /// 133 inline const utility::matrix& V(void) const { return V_; }130 const utility::matrix& V(void) const; 134 131 135 132 private: 136 inline int jacobi(void) 137 { return gsl_linalg_SV_decomp_jacobi(U_.gsl_matrix_p(), V_.gsl_matrix_p(), 138 s_.gsl_vector_p()); } 133 int jacobi(void); 139 134 int golub_reinsch(void); 140 135 int modified_golub_reinsch(void); -
trunk/yat/utility/stl_utility.cc
r680 r715 61 61 62 62 63 64 63 bool read_to_int(std::istream& is, std::vector<int>& vec) 65 64 { … … 87 86 88 87 89 90 88 bool read_to_string(std::istream& is, std::vector<std::string>& vec) 91 89 { … … 103 101 } 104 102 103 104 void to_lower(std::string& s) 105 { 106 transform(s.begin(),s.end(), s.begin(), tolower); 107 } 108 109 110 void to_upper(std::string& s) 111 { 112 transform(s.begin(),s.end(), s.begin(), toupper); 113 } 114 105 115 }}} // end of namespace utility, yat and thep -
trunk/yat/utility/stl_utility.h
r703 r715 122 122 /// @brief Function converting a string to lower case 123 123 /// 124 inline void to_lower(std::string& s) { 125 transform(s.begin(),s.end(), s.begin(), tolower); 126 } 124 void to_lower(std::string& s); 127 125 128 126 /// 129 127 /// @brief Function converting a string to upper case 130 128 /// 131 inline void to_upper(std::string& s) { 132 transform(s.begin(),s.end(), s.begin(), toupper); 133 } 134 129 void to_upper(std::string& s); 135 130 136 131 }}} // of namespace utility, yat, and theplu
Note: See TracChangeset
for help on using the changeset viewer.