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