Changeset 51

Show
Ignore:
Timestamp:
03/25/08 13:37:45 (16 years ago)
Author:
smidl
Message:

oprava EKF + debug vypisove fce

Location:
bdm
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • bdm/estim/libKF.cpp

    r37 r51  
    130130        vec y = dt.get ( 0,dimy-1 ); 
    131131 
    132         //TODO get rid of Q in qr()! 
    133 //      mat Q; 
     132        pfxu->dfdx_cond ( *_mu,u,A,false ); //update A by a derivative of fx 
     133        phxu->dfdx_cond ( *_mu,u,C,false ); //update A by a derivative of fx 
    134134 
    135135        //R and Q are already set in set_parameters() 
     
    147147        fy._cached ( true ); 
    148148        *_yp = phxu->eval ( *_mu,u ); 
     149         
    149150        *_mu = pfxu->eval ( *_mu ,u ) + ( _K ) * ( _iRy->_Ch() ).T() * ( y-*_yp ); 
    150  
     151/*      _K = (_P->to_mat())*C.transpose() * ( _iRy->to_mat() ); 
     152        *_mu = pfxu->eval ( *_mu ,u ) + ( _K )* ( y-*_yp );*/ 
     153         
    151154        /*      cout << "P:" <<_P->to_mat() <<endl; 
    152155                cout << "Ry:" <<_Ry->to_mat() <<endl; 
  • bdm/estim/libKF.h

    r37 r51  
    124124        //!access function 
    125125        epdf& _epdf() {return est;} 
     126        //!access function 
     127        mat& __K() {return _K;} 
     128        //!access function 
     129        vec _dP() {return _P->getD();} 
    126130}; 
    127131 
     
    167171*/ 
    168172template<class sq_T> 
    169 class EKF : public Kalman<ldmat> { 
     173class EKF : public Kalman<fsqmat> { 
    170174        //! Internal Model f(x,u) 
    171175        diffbifn* pfxu; 
  • bdm/math/libDC.h

    r37 r51  
    145145                void setD (const vec &nD){M=diag(nD);} 
    146146                //! Access functions 
     147                vec getD (){return diag(M);} 
     148                //! Access functions 
    147149                void setD (const vec &nD, int i){for(int j=i;j<nD.length();j++){M(j,j)=nD(j-i);}} //Fixme can be more general 
    148150 
  • bdm/stat/libBM.h

    r33 r51  
    7575        //! generate a list of indeces, i.e. which 
    7676        ivec indexlist(); 
     77 
     78        //!access function 
     79        Array<std::string>& _names(){return names;}; 
    7780}; 
    7881 
  • bdm/stat/libEF.h

    r33 r51  
    110110        //! set cache as inconsistent 
    111111        void _cached ( bool what ) {cached=what;} 
     112        //! access mthod 
     113        mat getR () {return R.to_mat();} 
    112114}; 
    113115