Changeset 495
- Timestamp:
- 08/11/09 08:48:56 (15 years ago)
- Location:
- library
- Files:
-
- 7 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/math/chmat.cpp
r477 r495 4 4 //using std::endl; 5 5 6 namespace bdm 7 { 6 8 7 9 void chmat::opupdt ( const vec &v, double w ) { … … 42 44 it_warning ( "QR unstable in chmat mult_sym" ); 43 45 } 44 }; 46 } 47 45 48 double chmat::logdet() const { 46 49 double ldet = 0.0; … … 51 54 } 52 55 return 2*ldet; //compensate for Ch being sqrt() 53 }; 56 } 57 54 58 //TODO can be done more efficiently using BLAS, see triangular matrices 55 59 vec chmat::sqrt_mult ( const vec &v ) const { … … 57 61 pom = Ch * v; 58 62 return pom; 59 }; 63 } 64 60 65 double chmat::qform ( const vec &v ) const { 61 66 vec pom; 62 67 pom = Ch * v; 63 68 return pom*pom; 64 }; 69 } 70 65 71 double chmat::invqform ( const vec &v ) const { 66 72 vec pom ( v.length() ); 67 73 forward_substitution ( Ch.T(), v, pom ); 68 74 return pom*pom; 69 }; 75 } 76 70 77 void chmat::clear() { 71 78 Ch.clear(); 72 }; 79 } 80 81 } -
library/bdm/math/chmat.h
r477 r495 16 16 17 17 #include "square_mat.h" 18 19 namespace bdm 20 { 18 21 19 22 /*! \brief Symmetric matrix stored in square root decomposition using upper cholesky … … 133 136 } 134 137 138 } 139 135 140 #endif // CHMAT_H -
library/bdm/math/square_mat.cpp
r477 r495 1 1 2 2 #include "square_mat.h" 3 4 namespace bdm 5 { 3 6 4 7 using namespace itpp; … … 401 404 } 402 405 } 406 407 } -
library/bdm/math/square_mat.h
r477 r495 16 16 17 17 #include "../itpp_ext.h" 18 19 namespace bdm 20 { 18 21 19 22 using namespace itpp; … … 329 332 } 330 333 334 } 335 331 336 #endif // DC_H -
library/tests/square_mat_point.h
r477 r495 16 16 #include "itpp_ext.h" 17 17 #include "bdmroot.h" 18 #include "base/user_info.h" 18 19 19 20 /*! Testing matrix operations needs one square symmetrical matrix, one … … 59 60 void to_setting ( Setting &set ) const; 60 61 }; 62 UIREGISTER ( square_mat_point ); 61 63 62 64 #endif -
library/tests/square_mat_stress.cpp
r480 r495 14 14 using std::endl; 15 15 16 using bdm::fsqmat; 17 using bdm::chmat; 18 using bdm::ldmat; 16 19 using bdm::UIFile; 17 20 using bdm::UI; … … 20 23 double epsilon = 0.00001; 21 24 bool fast = false; 22 23 namespace bdm {24 UIREGISTER ( square_mat_point );25 }26 25 27 26 namespace UnitTest { -
library/tests/square_mat_test.cpp
r477 r495 1 1 #include "../bdm/math/square_mat.h" 2 2 #include "../bdm/math/chmat.h" 3 #include "itpp_ext.h" 3 4 #include "mat_checks.h" 4 5 #include "UnitTest++.h" … … 6 7 7 8 const double epsilon = 0.00001; 9 10 using namespace itpp; 11 12 using bdm::fsqmat; 13 using bdm::chmat; 14 using bdm::ldmat; 8 15 9 16 template<typename TMatrix>