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
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 #if !defined(ALIZE_Distrib_h)
00056 #define ALIZE_Distrib_h
00057
00058 #if defined(_WIN32)
00059 #if defined(ALIZE_EXPORTS)
00060 #define ALIZE_API __declspec(dllexport)
00061 #else
00062 #define ALIZE_API __declspec(dllimport)
00063 #endif
00064 #else
00065 #define ALIZE_API
00066 #endif
00067
00068 #include "Object.h"
00069 #include "RealVector.h"
00070
00071 namespace alize
00072 {
00073 class Feature;
00074
00080
00081 class ALIZE_API Distrib : public Object
00082 {
00083 friend class TestDistribGD;
00084 friend class TestDistribGF;
00085 friend class TestMixtureGD;
00086 friend class TestMixtureGF;
00087 friend class TestMixtureServer;
00088 friend class TestDistribRefVector;
00089
00090 public :
00091
00092 Distrib(unsigned long vectSize);
00093
00099 virtual const Distrib& operator=(const Distrib& d) = 0;
00100
00106 virtual bool operator==(const Distrib& d) const = 0;
00107
00113 bool operator!=(const Distrib& d) const;
00114
00115 virtual ~Distrib();
00116
00117 Distrib& duplicate(const K&) const;
00118
00123 virtual void reset() = 0;
00124
00128 unsigned long getVectSize() const;
00129
00135 real_t getMean(unsigned long index) const;
00136
00140 DoubleVector& getMeanVect();
00141
00145 const DoubleVector& getMeanVect() const;
00146
00152 void setMean(real_t value, unsigned long index);
00153
00158 void setMeanVect(const DoubleVector& v);
00159
00164 virtual lk_t computeLK(const Feature&) const = 0;
00165 virtual lk_t computeLK(const Feature&, unsigned long idx) const = 0;
00166
00170 real_t getCst() const;
00171
00175 real_t getDet() const;
00176
00180 virtual void computeAll() = 0;
00181
00182 virtual String getClassName() const = 0;
00183 virtual String toString() const = 0;
00184
00185
00186
00190 void setDet(const K&, const real_t v);
00191
00195 void setCst(const K&, const real_t v);
00196
00197 unsigned long& dictIndex(const K&);
00198 unsigned long& refCounter(const K&);
00199
00200 static Distrib& create(const K&, const DistribType,
00201 unsigned long vectSize);
00202 protected:
00203
00204 const unsigned long _vectSize;
00205 real_t _det;
00206 real_t _cst;
00207 DoubleVector _meanVect;
00208 private :
00209 unsigned long _refCounter;
00210 unsigned long _dictIndex;
00211
00212 virtual Distrib& clone() const = 0;
00213 };
00214
00215 }
00216
00217 #endif // !defined(ALIZE_Distrib_h)
00218