📄 twofiltersmoother.hpp
字号:
#ifndef INDII_ML_FILTER_TWOFILTERSMOOTHER_HPP#define INDII_ML_FILTER_TWOFILTERSMOOTHER_HPP#include "../aux/vector.hpp"#include "../aux/Pdf.hpp"#include "Smoother.hpp"namespace indii { namespace ml { namespace filter {/** * Abstract smoother for estimating the state of a system by fusing * forward and backward filtering passes. * * @author Lawrence Murray <lawrence@indii.org> * @version $Rev: 344 $ * @date $Date: 2007-11-02 20:21:05 +0000 (Fri, 02 Nov 2007) $ * * @param T The type of time. * @param P The type of probability distribution used to represent the * system state. * * @see indii::ml::filter for general usage guidelines. */template <class T = unsigned int, class P = indii::ml::aux::GaussianPdf>class TwoFilterSmoother : public Smoother<T,P> {public: /** * Constructor. * * @param p_x0 \f$P\big(\mathbf{x}(0)\big)\f$; prior over the * initial state \f$\mathbf{x}(0)\f$. */ TwoFilterSmoother(const P& p_x0); /** * Destructor. */ virtual ~TwoFilterSmoother(); /** * Get distribution over the state at the current time given present * and future measurements. * * @return \f$P\big(\mathbf{x}(t_n)\, | * \,\mathbf{y}(t_n),\ldots,\mathbf{y}(t_T)\big)\f$; distribution * over the current state given present and future measurements. */ const P& getBackwardFilteredState() const; /** * Set distribution over the state at the current time given present * and future measurements. * * @param p_xtn_ytn \f$P\big(\mathbf{x}(t_n)\, | * \,\mathbf{y}(t_n),\ldots,\mathbf{y}(t_T)\big)\f$; distribution * over the current state given present and future measurements. */ void getBackwardFilteredState(const P& p_xtn_ytn); /** * Rewind system to time of previous measurement and * smooth. Performs the backward filtering step and fuses this with * the given prediction from the forward filtering step to produce * the smoothed prediction. * * @param tnm1 \f$t_{n-1}\f$; the time to which to rewind the * system. This must be less than the current time \f$t_n\f$. * @param ytnm1 \f$\mathbf{y}(t_{n-1})\f$; measurement at time * \f$t_{n-1}\f$. * @param p_xtnm1_ytnm1 * \f$P\big(\mathbf{x}(t_{n-1})\, | * \,\mathbf{y}(t_1),\ldots,\mathbf{y}(t_{n-1})\big)\f$; * distribution over the state at time \f$t_{n-1}\f$ given past and * present measurements (i.e. the estimate from the forward * filtering pass at time \f$t_{n-1}\f$). */ virtual void smooth(T tnm1, const aux::vector& ytnm1, const P& p_xtnm1_ytnm1) = 0; /** * Apply the measurement function to the current filtered state to * obtain an estimated measurement. * * @return The estimated measurement. */ virtual aux::GaussianPdf backwardMeasure() = 0;protected: /** * \f$P\big(\mathbf{x}(t_n)\, | * \,\mathbf{y}(t_n),\ldots,\mathbf{y}(t_T)\big)\f$; distribution * over the current state given present and future measurements. For * internal use only. */ P p_xtn_ytn_b;}; } }}using namespace indii::ml::filter;template <class T, class P>TwoFilterSmoother<T,P>::TwoFilterSmoother(const P& x) : Smoother<T,P>(x), p_xtn_ytn_b(x) { //}template <class T, class P>TwoFilterSmoother<T,P>::~TwoFilterSmoother() { //}template <class T, class P>const P& TwoFilterSmoother<T,P>::getBackwardFilteredState() const { return this->p_xtn_ytn_b;}template <class T, class P>void TwoFilterSmoother<T,P>::getBackwardFilteredState(const P& p_xtn_ytn) { this->p_xtn_ytn_b = p_xtn_ytn;}#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -