00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef GAUSSIAN_H
00020 #define GAUSSIAN_H
00021
00022 #include "pdf.h"
00023
00024 namespace BFL
00025 {
00027 class Gaussian: public Pdf<MatrixWrapper::ColumnVector>
00028 {
00029 private:
00030 MatrixWrapper::ColumnVector _Mu;
00031 MatrixWrapper::SymmetricMatrix _Sigma;
00032
00033
00034 mutable bool _Sigma_changed;
00035 mutable MatrixWrapper::SymmetricMatrix _Sigma_inverse;
00036 mutable double _sqrt_pow;
00037 mutable ColumnVector _diff;
00038 mutable ColumnVector _tempColumn;
00039
00040 mutable ColumnVector _samples;
00041 mutable ColumnVector _sampleValue;
00042 mutable Matrix _Low_triangle;
00043
00044 public:
00046
00050 Gaussian (const MatrixWrapper::ColumnVector& Mu, const MatrixWrapper::SymmetricMatrix& Sigma);
00051
00053 Gaussian (int dimension = 0);
00054
00056
00058 virtual ~Gaussian();
00059
00061 friend std::ostream& operator<< (std::ostream& os, const Gaussian& g);
00062
00064 virtual Gaussian* Clone() const;
00065
00066
00067 virtual Probability ProbabilityGet(const MatrixWrapper::ColumnVector& input) const;
00068 bool SampleFrom (vector<Sample<MatrixWrapper::ColumnVector> >& list_samples,
00069 const int num_samples,
00070 int method=DEFAULT,
00071 void * args=NULL) const;
00072 virtual bool SampleFrom (Sample<MatrixWrapper::ColumnVector>& one_sample, int method=DEFAULT, void * args=NULL) const;
00073
00074 virtual MatrixWrapper::ColumnVector ExpectedValueGet() const;
00075 virtual MatrixWrapper::SymmetricMatrix CovarianceGet() const;
00076
00077
00079
00082 void ExpectedValueSet (const MatrixWrapper::ColumnVector& mu);
00083
00085
00088 void CovarianceSet (const MatrixWrapper::SymmetricMatrix& cov);
00089 };
00090
00091 }
00092 #endif