00001 #ifndef INDII_ML_FILTER_RAUCHTUNGSTRIEBELSMOOTHER_HPP
00002 #define INDII_ML_FILTER_RAUCHTUNGSTRIEBELSMOOTHER_HPP
00003
00004 #include "Smoother.hpp"
00005 #include "RauchTungStriebelSmootherModel.hpp"
00006
00007 #include <stack>
00008
00009 namespace indii {
00010 namespace ml {
00011 namespace filter {
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 template <class T>
00032 class RauchTungStriebelSmoother : public Smoother<T> {
00033 public:
00034
00035
00036
00037
00038
00039
00040
00041
00042 RauchTungStriebelSmoother(RauchTungStriebelSmootherModel<T>* model,
00043 const T tT, const indii::ml::aux::GaussianPdf& p_xT);
00044
00045
00046
00047
00048 virtual ~RauchTungStriebelSmoother();
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 virtual void smooth(const T tn,
00060 const indii::ml::aux::GaussianPdf& p_xtn_ytn);
00061
00062 virtual indii::ml::aux::GaussianPdf smoothedMeasure();
00063
00064 private:
00065
00066
00067
00068 RauchTungStriebelSmootherModel<T>* model;
00069
00070 };
00071
00072 }
00073 }
00074 }
00075
00076 template <class T>
00077 indii::ml::filter::RauchTungStriebelSmoother<T>::RauchTungStriebelSmoother(
00078 RauchTungStriebelSmootherModel<T>* model, const T tT,
00079 const indii::ml::aux::GaussianPdf& p_xT) : Smoother<T>(tT, p_xT),
00080 model(model) {
00081
00082 }
00083
00084 template <class T>
00085 indii::ml::filter::RauchTungStriebelSmoother<T>::~RauchTungStriebelSmoother() {
00086
00087 }
00088
00089 template <class T>
00090 void indii::ml::filter::RauchTungStriebelSmoother<T>::smooth(const T tn,
00091 const indii::ml::aux::GaussianPdf& p_xtn_ytn) {
00092 namespace aux = indii::ml::aux;
00093
00094
00095 assert (tn < this->tn);
00096
00097
00098 T delta = this->tn - tn;
00099 this->tn = tn;
00100
00101
00102 aux::GaussianPdf p_xtnp1_ytn(model->p_xtnp1_ytn(p_xtn_ytn, delta));
00103 this->p_xtn_ytT = model->p_xtn_ytT(this->p_xtn_ytT, p_xtnp1_ytn,
00104 p_xtn_ytn, delta);
00105
00106
00107 assert (this->tn == tn);
00108 }
00109
00110 template <class T>
00111 indii::ml::aux::GaussianPdf
00112 indii::ml::filter::RauchTungStriebelSmoother<T>::smoothedMeasure() {
00113 return model->p_y_x(this->p_xtn_ytT);
00114 }
00115
00116 #endif
00117