Changeset 76 for bdm/math/chmat.h
- Timestamp:
- 04/18/08 14:01:20 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
bdm/math/chmat.h
r39 r76 21 21 /*! \brief Symmetric matrix stored in square root decomposition using upper cholesky 22 22 23 This matrix represent $A=Ch Ch'$ where only the upper triangleis stored;23 This matrix represent \f$A=Ch' Ch\f$ where only the upper triangle \f$Ch\f$ is stored; 24 24 25 25 */ … … 39 39 vec sqrt_mult ( const vec &v ) const; 40 40 double qform ( const vec &v ) const; 41 double invqform ( const vec &v ) const; 41 42 void clear(); 42 43 void add ( const chmat &A2, double w=1.0 ) {}; 43 44 //!Inversion in the same form, i.e. cholesky 44 void inv ( chmat &Inv ) const { ( Inv.Ch ) = itpp::inv ( Ch ) ;}; //ltuinv is wrong?45 void inv ( chmat &Inv ) const { ( Inv.Ch ) = itpp::inv ( Ch ).T();}; //Fixme: can be more efficient 45 46 ; 46 47 // void inv ( mat &Inv ); … … 52 53 //! Default constructor 53 54 chmat ( const vec &v) : sqmat ( v.length() ),Ch ( diag(sqrt(v)) ) {}; 55 //! Copy constructor 56 chmat ( const chmat &Ch0) : sqmat ( Ch0.dim),Ch ( Ch0.dim,Ch0.dim ) {Ch=Ch0.Ch;}; 54 57 //! Default constructor (m3k:cholform) 55 58 chmat ( const mat &M ) : sqmat ( M.rows() ),Ch ( M.rows(),M.cols() ) {