Changeset 565 for library/bdm/math/chmat.h
- Timestamp:
- 08/19/09 16:54:24 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/math/chmat.h
r495 r565 14 14 #define CHMAT_H 15 15 16 16 #include "../bdmerror.h" 17 17 #include "square_mat.h" 18 18 … … 44 44 //! add another chmat \c A2 with weight \c w. 45 45 void add ( const chmat &A2, double w = 1.0 ) { 46 it_assert_debug ( dim == A2.dim, "Matrices of unequal dimension" );46 bdm_assert_debug ( dim == A2.dim, "Matrices of unequal dimension" ); 47 47 mat pre = concat_vertical ( Ch, sqrt ( w ) * A2.Ch ); 48 48 mat post = zeros ( pre.rows(), pre.cols() ); 49 49 if ( !qr ( pre, post ) ) { 50 it_warning ( "Unstable QR in chmat add" );50 bdm_warning ( "Unstable QR in chmat add" ); 51 51 } 52 52 Ch = post ( 0, dim - 1, 0, dim - 1 ); … … 70 70 chmat ( const chmat &Ch0 ) : sqmat ( Ch0.dim ), Ch ( Ch0.dim, Ch0.dim ) { 71 71 Ch = Ch0.Ch; 72 }; 72 } 73 73 74 //! Default constructor (m3k:cholform) 74 75 chmat ( const mat &M ) : sqmat ( M.rows() ), Ch ( M.rows(), M.cols() ) { 75 76 mat Q; 76 it_assert_debug ( M.rows() == M.cols(), "chmat:: input matrix must be square!" );77 bdm_assert_debug ( M.rows() == M.cols(), "chmat:: input matrix must be square!" ); 77 78 Ch = chol ( M ); 78 }; 79 //! Constructor 80 chmat ( const chmat &M, const ivec &perm ) : sqmat ( M.rows() ) { 81 it_error ( "not implemneted" ); 82 }; 79 } 80 81 /*! 82 Some templates require this constructor to compile, but 83 it shouldn't actually be called. 84 */ 85 chmat ( const chmat &M, const ivec &perm ) { 86 bdm_error ( "not implemented" ); 87 } 88 83 89 //! Access function 84 90 mat & _Ch() { … … 95 101 //! Access functions 96 102 void setCh ( const vec &chQ ) { 97 it_assert_debug ( chQ.length() == dim*dim, "" );103 bdm_assert_debug ( chQ.length() == dim * dim, "wrong length" ); 98 104 copy_vector ( dim*dim, chQ._data(), Ch._data() ); 99 105 } 106 100 107 //! Access functions 101 108 void setD ( const vec &nD, int i ) {