Jafar
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
gaussianVector.hpp
00001 /* $Id$ */
00002 
00003 #ifndef JMATH_GAUSSIAN_VECTOR_HPP
00004 #define JMATH_GAUSSIAN_VECTOR_HPP
00005 
00006 #include <ostream>
00007 
00008 #include "boost/shared_ptr.hpp"
00009 
00010 #include "kernel/jafarDebug.hpp"
00011 
00012 #include "jmath/jblas.hpp"
00013 
00014 namespace jafar {
00015   namespace jmath {
00016 
00022     class GaussianVector {
00023 
00024     public:
00025 
00027       jblas::vec x;
00029       jblas::sym_mat P;
00030 
00031       GaussianVector() {}
00032       GaussianVector(std::size_t size_);
00033       GaussianVector(const jblas::vec& x_, const jblas::sym_mat& P_);
00034       GaussianVector(const GaussianVector& v_);
00035 
00036       inline std::size_t size() const {return x.size();};
00037 
00038       void resize(std::size_t s) {
00039   if (size() != s) {
00040     x.resize(s);
00041     P.resize(s,s);
00042   }
00043       }
00044 
00046       void clear() {
00047   x.clear();
00048   P.clear();
00049       }
00050 
00051       double probabilityDensity(const jblas::vec& v) const;
00052 
00053 #ifndef SWIG
00054       friend std::ostream& operator <<(std::ostream& s, const GaussianVector& v_);
00055 #endif
00056     };
00057 
00058 #ifndef SWIG
00059     std::ostream& operator <<(std::ostream& s, const GaussianVector& v_);
00060 #endif
00061 
00066     class WeightedGaussianVector : public GaussianVector {
00067 
00068     public:
00069 
00071       double w;
00072 
00073       WeightedGaussianVector() : GaussianVector(), w(1.0) {}
00074       WeightedGaussianVector(std::size_t size_);
00075       WeightedGaussianVector(const jblas::vec& x_, const jblas::sym_mat& P_, double w_=1.0);
00076       WeightedGaussianVector(const GaussianVector& gv_, double w_=1.0);
00077       WeightedGaussianVector(const WeightedGaussianVector& v_);
00078 
00079 
00080 #ifndef SWIG
00081       friend std::ostream& operator <<(std::ostream& s, const WeightedGaussianVector& v_);
00082 #endif
00083      };
00084 
00085 
00086 #ifndef SWIG
00087     std::ostream& operator <<(std::ostream& s, const WeightedGaussianVector& v_);
00088 #endif
00089 
00090  } // namespace jmath
00091 } // namespace jafar
00092 
00093 #endif // JMATH_GAUSSIAN_VECTOR_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Wed Oct 15 2014 00:37:21 for Jafar by doxygen 1.7.6.1
LAAS-CNRS