C++ main module for mmsd Package  1.0
MMSD_StiefelGaussianLaw.h
Go to the documentation of this file.
1 #ifndef MMSD_StiefelGaussianLaw_H
2 #define MMSD_StiefelGaussianLaw_H
3 
4 
5 #include "MMSD_GaussianLaw.h"
6 #include "MMSD_StiefelFunction.h"
8 
9 
16 class MMSD_StiefelGaussianLaw : public virtual MMSD_GaussianLaw {
17  SP_OBJECT(MMSD_StiefelGaussianLaw);
18  // ATTRIBUTES
19 public:
20  private:
21 
22 
23  SP::MATH_StiefelOptimizer mOptimizer;
24  SP::MMSD_StiefelFunction mFunction;
25 
26 
27 
28 
29 
30 
31 protected:
32  // METHODS
33 
34  // CONSTRUCTORS
35 
38 
39 
40 
41  // DESTRUCTORS
42 
43 
46  virtual ~MMSD_StiefelGaussianLaw(void);
47 
48 
49 
50 public:
51  //----------------
52  // NEW constructors
53  // ---------------
54 
57  inline static SP::MMSD_StiefelGaussianLaw New() {
58  return New(6,1.e-16);
59  }
62  inline static SP::MMSD_StiefelGaussianLaw New(const int& nIterations,const double& minEigenValue) {
63  SP::MMSD_StiefelGaussianLaw p(new MMSD_StiefelGaussianLaw(),
65  p->setThis(p);
66  p->setMaxIterationsNumber(nIterations);
67  p->setMinEigenValue(minEigenValue);
68  return p;
69  }
70 
71  // -----------------
72  // SET & GET Methods
73  // -----------------
74 
75 
78  inline void setMaxIterationsNumber(const int& n) {
79  mOptimizer->setMaxIterationsNumber(n);
80  };
83  inline int getMaxIterationsNumber() const {
84  return mOptimizer->getMaxIterationsNumber();
85  };
86 
87 
88 protected:
89 
90 
91 public:
95  virtual void restore(const MMSD_DoubleFullMatrix& properties) {
96  MMSD_GaussianLaw::restore(properties);
97  }
98 
107  virtual void initialize(const int& clusterIndex,
108  const int& samplesNumber,
109  const MMSD_IntegerVector& clustersIndex,
110  const MMSD_DoubleFullMatrix& Y) {
111  MMSD_Law::initialize(clusterIndex,samplesNumber,clustersIndex,Y);
112 
113 
114 
115 
116  }
117 
118  // -----------------------------
119  // Parameters estimation methods
120  // ------------------------------
121 
122 
123 
124 protected:
125 
126 
141  const MMSD_DoubleVector& Diag,
142  const MMSD_DoubleVector& mean,
143  const MMSD_DoubleFullMatrix& W,
144  const MMSD_DoubleVector& probs,
147 
148 
149 
150 
151  // ----------------------
152  // String representation
153  // ----------------------
154 public:
157  virtual tString toString() const {
159  return ret;
160  }
161 
162 };
163 
164 #endif
void setMaxIterationsNumber(const int &n)
set the max iterations number for the optimizer algorithm
Definition: MMSD_StiefelGaussianLaw.h:78
virtual void initialize(const int &clusterIndex, const int &samplesNumber, const MMSD_IntegerVector &clustersIndex, const MMSD_DoubleFullMatrix &Y)
initialization of the parameters opf the law
Definition: MMSD_StiefelGaussianLaw.h:107
This class describes the FullMatrix class.
Definition: MMSD_DoubleFullMatrix.h:17
virtual tString toString() const
turn the class into string
Definition: MMSD_GaussianLaw.h:172
virtual void restore(const MMSD_DoubleFullMatrix &properties)
restore the unstored values after a backup see MMSD_Law::restore()
Definition: MMSD_StiefelGaussianLaw.h:95
virtual void updateCovarianceDecompositionMatrix(const MMSD_DoubleFullMatrix &Y, const MMSD_DoubleVector &Diag, const MMSD_DoubleVector &mean, const MMSD_DoubleFullMatrix &W, const MMSD_DoubleVector &probs, MMSD_DoubleFullMatrix &P, MMSD_DoubleFullMatrix &YP)
pdate the decomposition matrix of the covariance parameters
Definition: MMSD_StiefelGaussianLaw.cpp:24
virtual tString toString() const
turn the class into string
Definition: MMSD_StiefelGaussianLaw.h:157
This class is a Gaussian Law inherits from MMSD_Law.
Definition: MMSD_GaussianLaw.h:21
virtual void initialize(const int &clusterIndex, const int &samplesNumber, const MMSD_IntegerVector &clustersIndex, const MMSD_DoubleFullMatrix &properties)
initialization of the parameters opf the law
Definition: MMSD_Law.cpp:59
int getMaxIterationsNumber() const
get the max iterations number for the optimizer algorithm
Definition: MMSD_StiefelGaussianLaw.h:83
Definition: MMSD_DoubleVector.h:16
static SP::MMSD_StiefelGaussianLaw New(const int &nIterations, const double &minEigenValue)
create an instance of Stiefel Gaussian law
Definition: MMSD_StiefelGaussianLaw.h:62
virtual void restore(const MMSD_DoubleFullMatrix &properties)
restore the unstored values after a backup
Definition: MMSD_Law.cpp:50
static SP::MMSD_StiefelGaussianLaw New()
create an instance of Stiefel Gaussian law
Definition: MMSD_StiefelGaussianLaw.h:57
Definition: MMSD_IntegerVector.h:15
This class is a Stiefel Gaussian Law.
Definition: MMSD_StiefelGaussianLaw.h:16
#define tString
Definition: types.h:49
virtual ~MMSD_StiefelGaussianLaw(void)
destroy an object.
Definition: MMSD_StiefelGaussianLaw.cpp:20
DEFINE_SPTR(MMSD_StiefelGaussianLaw)
MMSD_StiefelGaussianLaw(void)
create an object
Definition: MMSD_StiefelGaussianLaw.cpp:9
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:106