Bayesian Filtering Library Generated from SVN r
backwardfilter.h
1// $Id: backwardfilter.h 6736 2006-12-21 11:24:42Z tdelaet $
2// Copyright (C) 2006 Tinne De Laet <first dot last at mech dot kuleuven dot be>
3//
4 /***************************************************************************
5 * This library is free software; you can redistribute it and/or *
6 * modify it under the terms of the GNU General Public *
7 * License as published by the Free Software Foundation; *
8 * version 2 of the License. *
9 * *
10 * As a special exception, you may use this file as part of a free *
11 * software library without restriction. Specifically, if other files *
12 * instantiate templates or use macros or inline functions from this *
13 * file, or you compile this file and link it with other files to *
14 * produce an executable, this file does not by itself cause the *
15 * resulting executable to be covered by the GNU General Public *
16 * License. This exception does not however invalidate any other *
17 * reasons why the executable file might be covered by the GNU General *
18 * Public License. *
19 * *
20 * This library is distributed in the hope that it will be useful, *
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
23 * Lesser General Public License for more details. *
24 * *
25 * You should have received a copy of the GNU General Public *
26 * License along with this library; if not, write to the Free Software *
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
28 * Boston, MA 02110-1301 USA *
29 * *
30 ***************************************************************************/
31
32#ifndef __BACKWARDFILTER__
33#define __BACKWARDFILTER__
34
35#include "../model/systemmodel.h"
36#include "../pdf/pdf.h"
37
38namespace BFL
39{
40 using namespace std;
41
43
59 template <typename StateVar> class BackwardFilter
60 {
61 protected:
62
65
67
70
73
75
79 virtual bool UpdateInternal(SystemModel<StateVar>* const sysmodel,
80 const StateVar& u,
81 Pdf<StateVar>* const filtered_post)=0;
82
83 public:
85
89
92
94 virtual ~BackwardFilter();
95
97 virtual void Reset(Pdf<StateVar> * prior);
98
100
104 virtual bool Update(SystemModel<StateVar>* const sysmodel,
105 const StateVar& u,
106 Pdf<StateVar>* const filtered_post);
107
109
113 virtual bool Update(SystemModel<StateVar>* const sysmodel,
114 Pdf<StateVar>* const filtered_post);
115
117
121
123
126 int TimeStepGet() const;
127 };
128
129 // For template instantiation
130#include "backwardfilter.cpp"
131
132} // End namespace BFL
133
134#endif // __BACKWARDFILTER__
Virtual Baseclass representing all bayesian backward filters.
virtual bool Update(SystemModel< StateVar > *const sysmodel, Pdf< StateVar > *const filtered_post)
Full Update (system without inputs)
virtual bool Update(SystemModel< StateVar > *const sysmodel, const StateVar &u, Pdf< StateVar > *const filtered_post)
Full Update (system with inputs)
BackwardFilter(const BackwardFilter< StateVar > &filt)
copy constructor
Pdf< StateVar > * _post
Pointer to the Posterior Pdf.
virtual bool UpdateInternal(SystemModel< StateVar > *const sysmodel, const StateVar &u, Pdf< StateVar > *const filtered_post)=0
Actual implementation of Update, varies along filters.
virtual ~BackwardFilter()
destructor
virtual Pdf< StateVar > * PostGet()
Get Posterior density.
Pdf< StateVar > * _prior
prior Pdf
virtual void Reset(Pdf< StateVar > *prior)
Reset Filter.
BackwardFilter(Pdf< StateVar > *prior)
Constructor.
int _timestep
Represents the current timestep of the filter.
int TimeStepGet() const
Get current time.