00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "filter.h"
00020
00021 #define StateVar SVar
00022 #define MeasVar MVar
00023
00024
00025 template<typename SVar, typename MVar>
00026 Filter<SVar,MVar>::Filter(Pdf<SVar>* prior)
00027 : _prior(prior),
00028 _timestep(0)
00029 {}
00030
00031 template<typename SVar, typename MVar>
00032 Filter<SVar,MVar>::~Filter(){}
00033
00036 template<typename SVar, typename MVar>
00037 Filter<SVar,MVar>::Filter(const Filter<SVar,MVar>& filt)
00038 {}
00039
00040 template<typename SVar, typename MVar> void
00041 Filter<SVar,MVar>::Reset(Pdf<SVar> * prior)
00042 {
00043 _prior = prior;
00044 _post = prior;
00045
00046 }
00047
00048 template<typename SVar, typename MVar> int
00049 Filter<SVar,MVar>::TimeStepGet() const
00050 {
00051 return _timestep;
00052 }
00053
00054 template<typename SVar, typename MVar> bool
00055 Filter<SVar,MVar>::Update(SystemModel<SVar>* const sysmodel,
00056 const SVar& u,
00057 MeasurementModel<MVar,SVar>* const measmodel,
00058 const MVar& z,
00059 const SVar& s)
00060 {
00061 return this->UpdateInternal(sysmodel,u,measmodel,z,s);
00062 }
00063
00064 template<typename SVar, typename MVar> bool
00065 Filter<SVar,MVar>::Update(SystemModel<SVar>* const sysmodel,
00066 MeasurementModel<MVar,SVar>* const measmodel,
00067 const MVar& z,
00068 const SVar& s)
00069 {
00070 SVar u;
00071 return this->UpdateInternal(sysmodel,u,measmodel,z,s);
00072 }
00073
00074 template<typename SVar, typename MVar> bool
00075 Filter<SVar,MVar>::Update(SystemModel<SVar>* const sysmodel,
00076 MeasurementModel<MVar,SVar>* const measmodel,
00077 const MVar& z)
00078 {
00079 SVar s; SVar u;
00080 return this->UpdateInternal(sysmodel,u,measmodel,z,s);
00081 }
00082
00083 template<typename SVar, typename MVar> bool
00084 Filter<SVar,MVar>::Update(SystemModel<SVar>* const sysmodel,
00085 const SVar& u,
00086 MeasurementModel<MVar,SVar>* const measmodel,
00087 const MVar& z)
00088 {
00089 SVar s;
00090 return this->UpdateInternal(sysmodel,u,measmodel,z,s);
00091 }
00092
00093 template<typename SVar, typename MVar> bool
00094 Filter<SVar,MVar>::Update(SystemModel<SVar>* const sysmodel,
00095 const SVar& u)
00096 {
00097 SVar s; MVar z;
00098 return this->UpdateInternal(sysmodel,u,NULL,z,s);
00099 }
00100
00101 template<typename SVar, typename MVar> bool
00102 Filter<SVar,MVar>::Update(SystemModel<SVar>* const sysmodel)
00103 {
00104 SVar s; MVar z; SVar u;
00105 return this->UpdateInternal(sysmodel,u,NULL,z,s);
00106 }
00107
00108 template<typename SVar, typename MVar> bool
00109 Filter<SVar,MVar>::Update(MeasurementModel<MVar,SVar>* const measmodel,
00110 const MVar& z,
00111 const SVar& s)
00112 {
00113 SVar u;
00114 return this->UpdateInternal(NULL,u,measmodel,z,s);
00115 }
00116
00117 template<typename SVar, typename MVar> bool
00118 Filter<SVar,MVar>:: Update(MeasurementModel<MVar,SVar>* const measmodel,
00119 const MVar& z)
00120 {
00121 SVar u; SVar s;
00122 return this->UpdateInternal(NULL,u,measmodel,z,s);
00123 }
00124
00125 template<typename SVar, typename MVar> Pdf<SVar> *
00126 Filter<SVar,MVar>::PostGet()
00127 {
00128 return _post;
00129 }