root/library/bdm/estim/ekf_template.h @ 1064

Revision 1064, 1.7 kB (checked in by mido, 14 years ago)

astyle applied all over the library

  • Property svn:eol-style set to native
RevLine 
[120]1/*!
2  \file
3  \brief Bayesian Filtering for linear Gaussian models (Kalman Filter) and extensions
4  \author Vaclav Smidl.
5
6  -----------------------------------
7  BDM++ - C++ library for Bayesian Decision Making under Uncertainty
8
9  Using IT++ for numerical operations
10  -----------------------------------
11*/
12
[384]13#ifndef EKF_TEMPLATE_H
14#define EKF_TEMPLATE_H
[120]15
[384]16#include "kalman.h"
[120]17
[477]18namespace bdm {
[120]19
20//!Extended Kalman filter with unknown \c Q and \c R
[283]21class EKFful_unQR : public EKFfull  {
[120]22public:
[1064]23    void condition ( const vec &QR0 ) {
24        Q = diag ( QR0 ( 0, dimension() - 1 ) );
25        R = diag ( QR0 ( dimension(), dimension() + dimy - 1 ) );
26    };
[120]27};
28
[294]29//!Extended Kalman filter in Choleski form with unknown diagonal \c Q
30class EKFCh_dQ : public EKFCh {
[229]31public:
[1064]32    root* _copy_() const {
33        return new EKFCh_dQ(*this);
34    }
[766]35
[1064]36    //! new bayes, expects cond = [ut, Qt]
37    void bayes( const vec &yt , const vec &cond) {
38        vec ut=cond.left(dimc-dimension());
39        vec dQt=cond.right(dimension());
40        Q.setD ( dQt, 0 );
41        //from EKF
42        preA.set_submatrix ( dimy + dimension(), dimy, Q._Ch() );
43
44        EKFCh::bayes(yt,ut);
45    };
46    void validate() {
47        EKFCh::validate();
48        dimc += dimension();
49    }
[229]50};
[120]51
[294]52//!Extended Kalman filter in Choleski form with unknown \c Q
53class EKFCh_chQ : public EKFCh {
[477]54public:
[1064]55    void condition ( const vec &chQ0 ) {
56        Q.setCh ( chQ0 );
57        //from EKF
58        preA.set_submatrix ( dimy + dimension(), dimension(), Q._Ch() );
59    };
[294]60};
61
[797]62////!Extended Kalman filter with unknown parameters in \c IM
63// class EKFCh_cond : public EKFCh  {
64// public:
65//      void condition ( const vec &val ) {
66//              pfxu->condition ( val );
67//      };
68// };
[231]69
[254]70}
[141]71#endif //EKF_TEMP_H
Note: See TracBrowser for help on using the browser.