linearanalyticmeasurementmodel_gaussianuncertainty.cpp
Go to the documentation of this file.
00001 // $Id$
00002 // Copyright (C) 2002 Klaas Gadeyne <first dot last at gmail dot com>
00003 //
00004 // This program is free software; you can redistribute it and/or modify
00005 // it under the terms of the GNU Lesser General Public License as published by
00006 // the Free Software Foundation; either version 2.1 of the License, or
00007 // (at your option) any later version.
00008 //
00009 // This program is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU Lesser General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU Lesser General Public License
00015 // along with this program; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017 //
00018 
00019 #include "linearanalyticmeasurementmodel_gaussianuncertainty.h"
00020 #include "../sample/sample.h"
00021 #include <cassert>
00022 
00023 namespace BFL
00024 {
00025   using namespace MatrixWrapper;
00026 
00027 
00028 
00029   LinearAnalyticMeasurementModelGaussianUncertainty::LinearAnalyticMeasurementModelGaussianUncertainty
00030   ( LinearAnalyticConditionalGaussian* pdf)
00031     : AnalyticMeasurementModelGaussianUncertainty( pdf )
00032   {}
00033 
00034   /*
00035   LinearAnalyticMeasurementModelGaussianUncertainty::LinearAnalyticMeasurementModelGaussianUncertainty
00036   ( const LinearAnalyticMeasurementModelGaussianUncertainty& l )
00037     : AnalyticMeasurementModelGaussianUncertainty()
00038   {
00039     this->_MeasurementPdf = new LinearAnalyticConditionalGaussian(*l.MeasurementPdfGet());
00040   }
00041   */
00042 
00043   LinearAnalyticMeasurementModelGaussianUncertainty::~LinearAnalyticMeasurementModelGaussianUncertainty()
00044   {}
00045 
00046 
00047   ColumnVector
00048   LinearAnalyticMeasurementModelGaussianUncertainty::PredictionGet(const ColumnVector& u,
00049                                                                    const ColumnVector& x)
00050   {
00051     MeasurementPdfGet()->ConditionalArgumentSet(0,x);
00052     if (MeasurementPdfGet()->NumConditionalArgumentsGet() == 2) MeasurementPdfGet()->ConditionalArgumentSet(1,u);
00053     return MeasurementPdfGet()->ExpectedValueGet();
00054   }
00055 
00056 
00057   SymmetricMatrix
00058   LinearAnalyticMeasurementModelGaussianUncertainty::CovarianceGet(const ColumnVector& u,
00059                                                                    const ColumnVector& x)
00060   {
00061     MeasurementPdfGet()->ConditionalArgumentSet(0,x);
00062     if (MeasurementPdfGet()->NumConditionalArgumentsGet() == 2) MeasurementPdfGet()->ConditionalArgumentSet(1,u);
00063     return  MeasurementPdfGet()->CovarianceGet();
00064   }
00065 
00066 
00067   Matrix
00068   LinearAnalyticMeasurementModelGaussianUncertainty::df_dxGet(const ColumnVector& u,
00069                                                               const ColumnVector& x)
00070   {
00071     MeasurementPdfGet()->ConditionalArgumentSet(0,x);
00072     if (MeasurementPdfGet()->NumConditionalArgumentsGet() == 2) MeasurementPdfGet()->ConditionalArgumentSet(1,u);
00073     return dynamic_cast<AnalyticConditionalGaussian *>(MeasurementPdfGet())->dfGet(0);
00074   }
00075 
00076 
00077   void
00078   LinearAnalyticMeasurementModelGaussianUncertainty::HSet(const Matrix& h)
00079   {
00080     dynamic_cast<LinearAnalyticConditionalGaussian *>(MeasurementPdfGet())->MatrixSet(0,h);
00081   }
00082 
00083 
00084   void
00085   LinearAnalyticMeasurementModelGaussianUncertainty::JSet(const Matrix& j)
00086   {
00087     dynamic_cast<LinearAnalyticConditionalGaussian *>(MeasurementPdfGet())->MatrixSet(1,j);
00088   }
00089 
00090 
00091   const Matrix&
00092   LinearAnalyticMeasurementModelGaussianUncertainty::HGet() const
00093   {
00094     return dynamic_cast<LinearAnalyticConditionalGaussian *>(_MeasurementPdf)->MatrixGet(0);
00095   }
00096 
00097 
00098   const Matrix&
00099   LinearAnalyticMeasurementModelGaussianUncertainty::JGet() const
00100   {
00101     return dynamic_cast<LinearAnalyticConditionalGaussian *>(_MeasurementPdf)->MatrixGet(1);
00102   }
00103 
00104 
00105 }


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 Mon Feb 11 2019 03:45:12