Changeset 495 for library/bdm/math
- Timestamp:
- 08/11/09 08:48:56 (15 years ago)
- Location:
- library/bdm/math
- Files:
-
- 4 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