Changeset 738 for library/bdm/math

Show
Ignore:
Timestamp:
11/25/09 12:46:08 (15 years ago)
Author:
mido
Message:

a few moves of code from h to cpp, however, only part of the whole library is done

Location:
library/bdm/math
Files:
2 modified

Legend:

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

    r737 r738  
    55 
    66namespace bdm { 
     7 
     8void 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}; 
    717 
    818void chmat::opupdt ( const vec &v, double w ) { 
  • library/bdm/math/chmat.h

    r737 r738  
    4444        void clear(); 
    4545        //! 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 ); 
    5547        //!Inversion in the same form, i.e. cholesky 
    5648        void inv ( chmat &Inv ) const   {