Changeset 8 for libDC.cpp

Show
Ignore:
Timestamp:
01/23/08 11:32:31 (16 years ago)
Author:
smidl
Message:

Kalmany funkci, PF nefunkci

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • libDC.cpp

    r7 r8  
    115115} 
    116116 
    117 void ldmat::mult_qform( const mat &C, bool trans ) { 
     117void ldmat::mult_sym( const mat &C, bool trans ) { 
    118118 
    119119//TODO better 
    120120 
    121         it_assert_debug( C.cols()==L.cols(), "ldmat::mult_qform wrong input argument" ); 
     121        it_assert_debug( C.cols()==L.cols(), "ldmat::mult_sym wrong input argument" ); 
    122122        mat Ct=C; 
    123123 
     
    128128                Ct = C.transpose(); 
    129129                Ct *= this->to_mat(); 
     130                Ct *= C; 
     131        } 
     132 
     133        ldmat Lnew=ldmat( Ct ); 
     134        L = Lnew.L; 
     135        D = Lnew.D; 
     136} 
     137 
     138void ldmat::mult_sym( const mat &C, ldmat &U, bool trans ) { 
     139 
     140//TODO better 
     141 
     142//TODO input test 
     143 
     144        mat Ct=C; 
     145 
     146        if ( trans==false ) { // return C*this*C' 
     147                Ct *= U.to_mat(); 
     148                Ct *= C.transpose(); 
     149        } else {        // return C'*this*C 
     150                Ct = C.transpose(); 
     151                Ct *= U.to_mat(); 
    130152                Ct *= C; 
    131153        } 
     
    232254                kD = 1.0; 
    233255                *kr = 0.0; 
    234                 if ( *Df < -threshold ) it_warning( "Problem in dydr: subraction of dyad results in negative definitness. Likely mistake in calling function." ); 
     256                if ( *Df < -threshold ) { 
     257                it_warning( "Problem in dydr: subraction of dyad results in negative definitness. Likely mistake in calling function." );} 
    235258                *Df = 0.0; 
    236259        }