mixmod  3.2.0
Mixture models for clustering and classification
 All Classes Namespaces Files Functions Variables Enumerations Friends
ParameterDescription.h
1 /***************************************************************************
2  SRC/mixmod/Kernel/IO/ParameterDescription.h description
3  copyright : (C) MIXMOD Team - 2001-2016
4  email : contact@mixmod.org
5  ***************************************************************************/
6 
7 /***************************************************************************
8  This file is part of MIXMOD
9 
10  MIXMOD is free software: you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  MIXMOD is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with MIXMOD. If not, see <http://www.gnu.org/licenses/>.
22 
23  All informations available on : http://www.mixmod.org
24 ***************************************************************************/
25 
26 #ifndef XEMPARAMETERDESCRIPTION_H
27 #define XEMPARAMETERDESCRIPTION_H
28 
29 #include "mixmod/Utilities/Util.h"
30 
31 namespace XEM {
32 
33 // pre-declaration
34 class Model;
35 class ModelOutput;
36 class Parameter;
37 
45 
46 public:
49 
51  ParameterDescription(Model* iEstimation);
52 
54  ParameterDescription(ModelOutput* iEstimation);
55 
56  // constructor for Binary
59  int64_t nbCluster,
60  int64_t nbVariable,
61  std::vector< int64_t > nbFactor,
62  FormatNumeric::FormatNumericFile format,
63  std::string filename,
64  std::string infoName,
65  ModelName & modelName);
66 
67  // constructor for Gaussian
70  int64_t nbCluster,
71  int64_t nbVariable,
72  FormatNumeric::FormatNumericFile format,
73  std::string filename,
74  std::string infoName,
75  ModelName & modelName);
76 
77  // constructor for Composite
80  int64_t nbCluster,
81  int64_t nbVariable_binary,
82  int64_t nbVariable_gaussian,
83  std::vector< int64_t > nbFactor,
84  FormatNumeric::FormatNumericFile format,
85  std::string filename,
86  std::string infoName,
87  ModelName & modelName);
88 
90 
91  //constructor for binary data
93  int64_t nbCluster,
94  int64_t nbVariable,
95  ModelName& modelName,
96  double * proportions,
97  double ** centers,
98  double *** scatters,
99  std::vector< int64_t > nbFactor);
100 
101  //constructor for Gaussian data
103  int64_t nbCluster,
104  int64_t nbVariable,
105  ModelName& modelName,
106  double * proportions,
107  double ** means,
108  double *** variances);
109 
110  //constructor for Heterogeneous
112  int64_t nbCluster,
113  int64_t nbBinaryVariable,
114  int64_t nbGaussianVariable,
115  ModelName& modelName,
116  double * proportions,
117  double ** centers,
118  double *** scatters,
119  double ** means,
120  double *** variances,
121  std::vector< int64_t > nbFactor);
122 
125 
127  bool operator==(ParameterDescription & paramDescription) const;
128 
131 
133  std::string getInfoName();
134 
136  int64_t getNbVariable();
137 
139  int64_t getNbCluster();
140 
142  FormatNumeric::FormatNumericFile getFormat();
143 
145  std::string getFilename();
146 
149 
151  std::vector<int64_t> & getTabNbFactor();
152 
153  void saveNumericValues(std::string fileName = "");
154 
155 private:
156 
157  std::string _infoName;
158 
159  int64_t _nbVariable;
160 
161  int64_t _nbCluster;
162 
163  FormatNumeric::FormatNumericFile _format; //format of numeric file
164 
165  std::string _filename;
166 
167  std::vector<int64_t> _nbFactor;
168 
169  ModelType * _modelType;
170 
171  Parameter * _parameter;
172 };
173 
175  if (_parameter) {
176  return _parameter;
177  }
178  else {
179  THROW(OtherException, nullPointerError);
180  }
181 }
182 
184  return _nbCluster;
185 }
186 
187 inline std::string ParameterDescription::getInfoName() {
188  return _infoName;
189 }
190 
192  return _nbVariable;
193 }
194 
195 inline FormatNumeric::FormatNumericFile ParameterDescription::getFormat() {
196  return _format;
197 }
198 
199 inline std::string ParameterDescription::getFilename() {
200  return _filename;
201 }
202 
204  return _modelType;
205 }
206 
207 inline std::vector<int64_t> & ParameterDescription::getTabNbFactor() {
208  return _nbFactor;
209 }
210 
211 }
212 
213 #endif // XEMDATADESCRIPTION_H
Definition: ModelOutput.h:52
std::string getInfoName()
getInfoName
Definition: ParameterDescription.h:187
Base class for ModelType(s)
Definition: ModelType.h:37
ModelName
Enumeration of model name.
Definition: Util.h:403
std::vector< int64_t > & getTabNbFactor()
getTabNbModality
Definition: ParameterDescription.h:207
int64_t getNbVariable()
getPbDimension
Definition: ParameterDescription.h:191
Definition: OtherException.h:37
ModelType * getModelType()
getModelType
Definition: ParameterDescription.h:203
~ParameterDescription()
Destructor.
Definition: ParameterDescription.cpp:290
Parameter * getParameter()
getParameter
Definition: ParameterDescription.h:174
FormatNumeric::FormatNumericFile getFormat()
getFormat
Definition: ParameterDescription.h:195
Definition: Model.h:50
bool operator==(ParameterDescription &paramDescription) const
Comparison operator.
Definition: ParameterDescription.cpp:296
ParameterDescription()
Default constructor.
Definition: ParameterDescription.cpp:41
Constants definitions, various utilities to describe models, and others...
std::string getFilename()
getFilename
Definition: ParameterDescription.h:199
Definition: ParameterDescription.h:44
int64_t getNbCluster()
getNbCluster
Definition: ParameterDescription.h:183
Base class for XEMParameter(s)
Definition: Parameter.h:45