Changeset 738 for library/bdm/math
- Timestamp:
- 11/25/09 12:46:08 (15 years ago)
- Location:
- library/bdm/math
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/math/chmat.cpp
r737 r738 5 5 6 6 namespace bdm { 7 8 void chmat::add ( const chmat &A2, double w ) { 9 bdm_assert_debug ( dim == A2.dim, "Matrices of unequal dimension" ); 10 mat pre = concat_vertical ( Ch, sqrt ( w ) * A2.Ch ); 11 mat post = zeros ( pre.rows(), pre.cols() ); 12 if ( !qr ( pre, post ) ) { 13 bdm_warning ( "Unstable QR in chmat add" ); 14 } 15 Ch = post ( 0, dim - 1, 0, dim - 1 ); 16 }; 7 17 8 18 void chmat::opupdt ( const vec &v, double w ) { -
library/bdm/math/chmat.h
r737 r738 44 44 void clear(); 45 45 //! add another chmat \c A2 with weight \c w. 46 void add ( const chmat &A2, double w = 1.0 ) { 47 bdm_assert_debug ( dim == A2.dim, "Matrices of unequal dimension" ); 48 mat pre = concat_vertical ( Ch, sqrt ( w ) * A2.Ch ); 49 mat post = zeros ( pre.rows(), pre.cols() ); 50 if ( !qr ( pre, post ) ) { 51 bdm_warning ( "Unstable QR in chmat add" ); 52 } 53 Ch = post ( 0, dim - 1, 0, dim - 1 ); 54 }; 46 void add ( const chmat &A2, double w = 1.0 ); 55 47 //!Inversion in the same form, i.e. cholesky 56 48 void inv ( chmat &Inv ) const {