Changeset 76 for bdm/math/chmat.h

Show
Ignore:
Timestamp:
04/18/08 14:01:20 (16 years ago)
Author:
smidl
Message:

oprava chol + invqform

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • bdm/math/chmat.h

    r39 r76  
    2121/*! \brief Symmetric matrix stored in square root decomposition using upper cholesky 
    2222 
    23 This matrix represent $A=Ch Ch'$ where only the upper triangle is stored; 
     23This matrix represent \f$A=Ch' Ch\f$ where only the upper triangle \f$Ch\f$ is stored; 
    2424 
    2525*/ 
     
    3939        vec sqrt_mult ( const vec &v ) const; 
    4040        double qform ( const vec &v ) const; 
     41        double invqform ( const vec &v ) const; 
    4142        void clear(); 
    4243        void add ( const chmat &A2, double w=1.0 ) {}; 
    4344        //!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 
    4546        ; 
    4647//      void inv ( mat &Inv ); 
     
    5253        //! Default constructor 
    5354        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;}; 
    5457        //! Default constructor (m3k:cholform) 
    5558        chmat ( const mat &M ) : sqmat ( M.rows() ),Ch ( M.rows(),M.cols() ) {