Changeset 495

Show
Ignore:
Timestamp:
08/11/09 08:48:56 (15 years ago)
Author:
vbarta
Message:

moved square matrices to namespace bdm

Location:
library
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/math/chmat.cpp

    r477 r495  
    44//using std::endl; 
    55 
     6namespace bdm 
     7{ 
    68 
    79void chmat::opupdt ( const vec &v, double w ) { 
     
    4244                it_warning ( "QR unstable in chmat mult_sym" ); 
    4345        } 
    44 }; 
     46} 
     47 
    4548double chmat::logdet() const { 
    4649        double ldet = 0.0; 
     
    5154        } 
    5255        return 2*ldet; //compensate for Ch being sqrt() 
    53 }; 
     56} 
     57 
    5458//TODO can be done more efficiently using BLAS, see triangular matrices 
    5559vec chmat::sqrt_mult ( const vec &v ) const { 
     
    5761        pom = Ch * v; 
    5862        return pom; 
    59 }; 
     63} 
     64 
    6065double chmat::qform ( const vec &v ) const { 
    6166        vec pom; 
    6267        pom = Ch * v; 
    6368        return pom*pom; 
    64 }; 
     69} 
     70 
    6571double chmat::invqform ( const vec &v ) const { 
    6672        vec pom ( v.length() ); 
    6773        forward_substitution ( Ch.T(), v, pom ); 
    6874        return pom*pom; 
    69 }; 
     75} 
     76 
    7077void chmat::clear() { 
    7178        Ch.clear(); 
    72 }; 
     79} 
     80 
     81} 
  • library/bdm/math/chmat.h

    r477 r495  
    1616 
    1717#include "square_mat.h" 
     18 
     19namespace bdm 
     20{ 
    1821 
    1922/*! \brief Symmetric matrix stored in square root decomposition using upper cholesky 
     
    133136} 
    134137 
     138} 
     139 
    135140#endif // CHMAT_H 
  • library/bdm/math/square_mat.cpp

    r477 r495  
    11 
    22#include "square_mat.h" 
     3 
     4namespace bdm 
     5{ 
    36 
    47using namespace itpp; 
     
    401404        } 
    402405} 
     406 
     407} 
  • library/bdm/math/square_mat.h

    r477 r495  
    1616 
    1717#include "../itpp_ext.h" 
     18 
     19namespace bdm 
     20{ 
    1821 
    1922using namespace itpp; 
     
    329332} 
    330333 
     334} 
     335 
    331336#endif // DC_H 
  • library/tests/square_mat_point.h

    r477 r495  
    1616#include "itpp_ext.h" 
    1717#include "bdmroot.h" 
     18#include "base/user_info.h" 
    1819 
    1920/*! Testing matrix operations needs one square symmetrical matrix, one 
     
    5960        void to_setting ( Setting &set ) const; 
    6061}; 
     62UIREGISTER ( square_mat_point ); 
    6163 
    6264#endif 
  • library/tests/square_mat_stress.cpp

    r480 r495  
    1414using std::endl; 
    1515 
     16using bdm::fsqmat; 
     17using bdm::chmat; 
     18using bdm::ldmat; 
    1619using bdm::UIFile; 
    1720using bdm::UI; 
     
    2023double epsilon = 0.00001; 
    2124bool fast = false; 
    22  
    23 namespace bdm { 
    24 UIREGISTER ( square_mat_point ); 
    25 } 
    2625 
    2726namespace UnitTest { 
  • library/tests/square_mat_test.cpp

    r477 r495  
    11#include "../bdm/math/square_mat.h" 
    22#include "../bdm/math/chmat.h" 
     3#include "itpp_ext.h" 
    34#include "mat_checks.h" 
    45#include "UnitTest++.h" 
     
    67 
    78const double epsilon = 0.00001; 
     9 
     10using namespace itpp; 
     11 
     12using bdm::fsqmat; 
     13using bdm::chmat; 
     14using bdm::ldmat; 
    815 
    916template<typename TMatrix>