00001 #ifndef INDII_ML_AUX_PDF_HPP
00002 #define INDII_ML_AUX_PDF_HPP
00003
00004 #include "vector.hpp"
00005 #include "matrix.hpp"
00006
00007 namespace indii {
00008 namespace ml {
00009 namespace aux {
00010
00011
00012
00013
00014
00015
00016
00017
00018 class Pdf {
00019 public:
00020
00021
00022
00023
00024
00025
00026
00027 Pdf();
00028
00029
00030
00031
00032
00033
00034 Pdf(const unsigned int N);
00035
00036
00037
00038
00039 virtual ~Pdf();
00040
00041
00042
00043
00044
00045
00046 unsigned int getDimensions() const;
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 virtual void setDimensions(const unsigned int N,
00057 const bool preserve = false) = 0;
00058
00059
00060
00061
00062
00063
00064 virtual const vector& getExpectation() = 0;
00065
00066
00067
00068
00069
00070
00071 virtual const symmetric_matrix& getCovariance() = 0;
00072
00073
00074
00075
00076
00077
00078 virtual vector sample() = 0;
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088 virtual double densityAt(const vector& x) = 0;
00089
00090 protected:
00091
00092
00093
00094 unsigned int N;
00095
00096 private:
00097
00098
00099
00100 template<class Archive>
00101 void serialize(Archive& ar, const unsigned int version);
00102
00103
00104
00105
00106 friend class boost::serialization::access;
00107
00108 };
00109
00110 }
00111 }
00112 }
00113
00114 inline unsigned int indii::ml::aux::Pdf::getDimensions() const {
00115 return N;
00116 }
00117
00118 template<class Archive>
00119 void indii::ml::aux::Pdf::serialize(Archive& ar, const unsigned int version) {
00120 ar & N;
00121 }
00122
00123 #endif
00124