Changeset 8 for libKF.h

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
  • libKF.h

    r7 r8  
    2222 
    2323/*! 
    24 * \brief Basic Kalman filter with full matrices (education purpose only)! 
     24* \brief Basic Kalman filter with full matrices (education purpose only)! Will be deleted soon! 
    2525*/ 
    2626class KalmanFull : public BM {  
     
    5858         
    5959        //cache 
    60         mat _K, _yp; 
     60        mat _K; 
     61        vec _yp; 
    6162        sq_T _Ry,_iRy; 
    6263public: 
     
    103104        ll = 0; 
    104105//Fixme should we assign cache?? 
     106        _iRy = eye(dimy); // needed in inv(_iRy) 
    105107} 
    106108 
     
    114116        mu = A*mu + B*u; 
    115117        //P  = A*P*A.transpose() + Q; in sq_T 
    116         P.mult_qform( A ); 
     118        P.mult_sym( A ); 
    117119        P+=Q; 
    118120 
    119121        //Data update 
    120122        //_Ry = C*P*C.transpose() + R; in sq_T 
    121         _Ry.mult_qform( C ); 
     123        _Ry.mult_sym( C, P); 
    122124        _Ry+=R; 
    123125 
     
    131133         
    132134        if (evalll==true) { 
    133         ll+= -0.5*_Ry.logdet() -0.5*_iRy.qform(_yp); 
     135        ll+= -0.5*(_Ry.cols()*0.79817986835811504957 \ 
     136        +_Ry.logdet() +_iRy.qform(_yp)); 
    134137        } 
    135138};