Changeset 279 for bdm

Show
Ignore:
Timestamp:
02/24/09 14:12:19 (15 years ago)
Author:
smidl
Message:

Transition of pmsm and libKF

Location:
bdm
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • bdm/estim/ekf_templ.h

    r254 r279  
    2222public: 
    2323        //! Default constructor 
    24         EKFful_unQR ( RV rx, RV ry,RV ru,RV rQR ) :EKFfull ( rx,ry,ru ),BMcond ( rQR ) {}; 
     24        EKFful_unQR ( ) :EKFfull ( ),BMcond ( ) {}; 
    2525        void condition ( const vec &QR0 ) { 
    2626                Q=diag(QR0(0,dimx-1)); 
     
    3333public: 
    3434        //! Default constructor 
    35         EKFCh_unQ ( RV rx, RV ry,RV ru,RV rQ ) :EKFCh ( rx,ry,ru ),BMcond ( rQ ) {}; 
     35        EKFCh_unQ (  ) :EKFCh ( ),BMcond ( ) {}; 
    3636        void condition ( const vec &Q0 ) { 
    3737                Q.setD ( Q0,0 ); 
     
    4545        public: 
    4646        //! Default constructor 
    47                 EKFCh_cond ( RV rx, RV ry,RV ru,RV rC ) :EKFCh ( rx,ry,ru ),BMcond ( rC ) {}; 
     47                EKFCh_cond ( ) :EKFCh ( ),BMcond ( ) {}; 
    4848                void condition ( const vec &val ) { 
    4949                        pfxu->condition ( val ); 
  • bdm/estim/libKF.cpp

    r278 r279  
    164164 
    165165 
    166 EKFCh::EKFCh ( ) : KalmanCh (  ) {} 
    167166 
    168167void EKFCh::set_parameters ( diffbifn* pfxu0,  diffbifn* phxu0,const chmat Q0,const chmat R0 ) { 
     
    170169        phxu = phxu0; 
    171170 
     171        dimx = pfxu0->_dimy(); 
     172        dimy = phxu0->_dimy(); 
     173        dimu = pfxu0->_dimu(); 
     174        // set size of mu - just for constant terms of A and C  
     175        _mu=zeros(dimx); 
     176        A=zeros(dimx,dimx); 
     177        C=zeros(dimy,dimx); 
     178        preA=zeros(dimy+dimx+dimx, dimy+dimx); 
     179         
    172180        //initialize matrices A C, later, these will be only updated! 
    173181        pfxu->dfdx_cond ( _mu,zeros ( dimu ),A,true ); 
  • bdm/estim/libKF.h

    r271 r279  
    229229        diffbifn* phxu; 
    230230public: 
    231         //! Default constructor 
    232         EKFCh (); 
    233231        //! Set nonlinear functions for mean values and covariance matrices. 
    234232        void set_parameters ( diffbifn* pfxu, diffbifn* phxu, const chmat Q0, const chmat R0 ); 
  • bdm/estim/libPF.h

    r271 r279  
    4747                        { par = par0; obs=obs0; est.set_parameters ( ones(n0),epdf0 ); }; 
    4848        void set_parameters ( mpdf *par0, mpdf *obs0, int n0 )  
    49                         { par = par0; obs=obs0; n=n0; }; 
     49                        { par = par0; obs=obs0; n=n0; est.set_n(n);}; 
    5050        void set_statistics (const vec w0, epdf *epdf0){est.set_parameters ( w0,epdf0 );}; 
    5151        //!@} 
     
    8080                                Coms ( _w.length() ) { 
    8181                }; 
    82  
    8382                void set_elements ( int &i, double wi, const epdf* ep ) 
    8483                {_w ( i ) =wi; Coms ( i ) =ep;}; 
    8584 
     85                void set_n(int n){E.set_n(n); Coms.set_length(n);} 
    8686                vec mean() const { 
    8787                        // ugly 
     
    113113        MPF ( mpdf *par0, mpdf *obs0, int n, const BM_T &BMcond0 ) : PF (), jest ( est ) { 
    114114                PF::set_parameters(par0,obs0,n); 
     115                jest.set_n(n); 
    115116                // 
    116117                //TODO test if rv and BMcond.rv are compatible. 
  • bdm/math/chmat.cpp

    r262 r279  
    2020}; 
    2121void chmat::mult_sym ( const mat &C , chmat &U ) const { 
    22         it_error ( "not implemented" ); 
     22        mat Z=C*Ch; 
     23        U.Ch= chol(Z*Z.T()); 
    2324}; 
    2425void chmat::mult_sym_t ( const mat &C ) { 
  • bdm/stat/libBM.h

    r271 r279  
    659659class BMcond :public bdmroot { 
    660660protected: 
     661        //!dimension of the conditioning variable 
     662        int dimc; 
    661663        //! Identificator of the conditioning variable 
    662664        RV rvc;