Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "linearanalyticconditionalgaussian.h"
00021 #include "../wrappers/rng/rng.h"
00022
00023
00024 namespace BFL
00025 {
00026 using namespace MatrixWrapper;
00027
00028
00029 LinearAnalyticConditionalGaussian::LinearAnalyticConditionalGaussian(const vector<Matrix> & ratio,
00030 const Gaussian& additiveNoise)
00031 : AnalyticConditionalGaussianAdditiveNoise(additiveNoise,ratio.size())
00032 , _ratio(ratio)
00033 , _mean_temp(DimensionGet())
00034 , _arg(DimensionGet())
00035 {
00036
00037 ColumnVector arg;
00038 for (unsigned int i=0; i < NumConditionalArgumentsGet() ; i++)
00039 {
00040 arg.resize(_ratio[i].columns());
00041 arg = 0.0;
00042 ConditionalArgumentSet(i,arg);
00043 }
00044 }
00045
00046
00047 LinearAnalyticConditionalGaussian::LinearAnalyticConditionalGaussian(const Matrix& a,
00048 const Gaussian& additiveNoise)
00049 : AnalyticConditionalGaussianAdditiveNoise(additiveNoise,1)
00050 , _mean_temp(DimensionGet())
00051 , _arg(DimensionGet())
00052 {
00053 _ratio.resize(1);
00054 _ratio[0] = a;
00055
00056 ColumnVector x(a.columns()); x = 0.0;
00057 ConditionalArgumentSet(0,x);
00058 }
00059
00060 LinearAnalyticConditionalGaussian::~LinearAnalyticConditionalGaussian(){}
00061
00062
00063 LinearAnalyticConditionalGaussian* LinearAnalyticConditionalGaussian::Clone() const
00064 {
00065 return new LinearAnalyticConditionalGaussian(*this);
00066 }
00067
00068 ColumnVector
00069 LinearAnalyticConditionalGaussian::ExpectedValueGet() const
00070 {
00071 _mean_temp = 0.0;
00072 for (unsigned int i=0; i < NumConditionalArgumentsGet() ; i++)
00073 {
00074 _arg = ConditionalArgumentGet(i);
00075 _mean_temp += (ColumnVector) (MatrixGet(i) * _arg);
00076 }
00077 _mean_temp += AdditiveNoiseMuGet();
00078 return _mean_temp;
00079 }
00080
00081 Matrix
00082 LinearAnalyticConditionalGaussian::dfGet(unsigned int i) const
00083 {
00084 assert(i < NumConditionalArgumentsGet());
00085 return _ratio[i];
00086 }
00087
00088 void
00089 LinearAnalyticConditionalGaussian::NumConditionalArgumentsSet(unsigned int numconditionalarguments)
00090 {
00091 ConditionalPdf<ColumnVector,ColumnVector>::NumConditionalArgumentsSet(numconditionalarguments);
00092 _ratio.resize(numconditionalarguments);
00093 }
00094
00095 void
00096 LinearAnalyticConditionalGaussian::MatrixSet(unsigned int i, const Matrix & m)
00097 {
00098 assert(i < NumConditionalArgumentsGet());
00099 _ratio[i] = m;
00100 }
00101
00102 const Matrix&
00103 LinearAnalyticConditionalGaussian::MatrixGet(unsigned int i) const
00104 {
00105 assert(i < NumConditionalArgumentsGet());
00106 return _ratio[i];
00107 }
00108
00109 }
bfl
Author(s): Klaas Gadeyne, Wim Meeussen, Tinne Delaet and many others. See web page for a full contributor list. ROS package maintained by Wim Meeussen.
autogenerated on Sun Oct 5 2014 22:29:53