Bayesian Filtering Library Generated from SVN r
conditionalgaussian.h
1// $Id$
2// Copyright (C) 2002 Klaas Gadeyne <first dot last at gmail dot com>
3// Copyright (C) 2008 Tinne De Laet <first dot last at mech dot kuleuven dot be>
4//
5// This program is free software; you can redistribute it and/or modify
6// it under the terms of the GNU Lesser General Public License as published by
7// the Free Software Foundation; either version 2.1 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU Lesser General Public License for more details.
14//
15// You should have received a copy of the GNU Lesser General Public License
16// along with this program; if not, write to the Free Software
17// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18//
19
20#ifndef __CONDITIONAL_GAUSSIAN__
21#define __CONDITIONAL_GAUSSIAN__
22
23#include "conditionalpdf.h"
24
25namespace BFL
26{
28
40 class ConditionalGaussian : public ConditionalPdf<MatrixWrapper::ColumnVector, MatrixWrapper::ColumnVector>
41 {
42 public:
44
49 ConditionalGaussian(int dim = 0, int num_conditional_arguments=0);
50
51 // Default Copy constructor will do
52
55
57 virtual ConditionalGaussian* Clone() const;
58
59 // implemented virtuals!
60 virtual Probability ProbabilityGet(const MatrixWrapper::ColumnVector& input) const;
61 virtual bool SampleFrom (Sample<MatrixWrapper::ColumnVector>& sample, const SampleMthd method=SampleMthd::DEFAULT, void * args=NULL) const;
62 virtual bool SampleFrom (std::vector<Sample<MatrixWrapper::ColumnVector> >& samples, const unsigned int num_samples,
63 const SampleMthd method=SampleMthd::DEFAULT, void * args=NULL) const;
64
65 protected:
66 // variables to avoid allocation on the heap during sampling
67 mutable ColumnVector _diff;
68 mutable ColumnVector _Mu;
69 mutable Matrix _Low_triangle;
70 mutable ColumnVector _samples;
71 mutable ColumnVector _SampleValue;
72
73 };
74
75} // End namespace BFL
76
77#endif // __CONDITIONAL_GAUSSIAN__
78
Abstract Class representing all Conditional gaussians.
virtual ~ConditionalGaussian()
Destructor.
virtual ConditionalGaussian * Clone() const
Clone function.
virtual Probability ProbabilityGet(const MatrixWrapper::ColumnVector &input) const
Get the probability of a certain argument.
virtual bool SampleFrom(Sample< MatrixWrapper::ColumnVector > &sample, const SampleMthd method=SampleMthd::DEFAULT, void *args=NULL) const
Draw 1 sample from the Pdf:
ConditionalGaussian(int dim=0, int num_conditional_arguments=0)
Constructor.
Abstract Class representing conditional Pdfs P(x | ...)
Class representing a probability (a double between 0 and 1)
Definition: bfl_constants.h:38