mixmod  3.2.0
Mixture models for clustering and classification
 All Classes Namespaces Files Functions Variables Enumerations Friends
ModelType.h
1 /***************************************************************************
2  SRC/mixmod/Kernel/Model/ModelType.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 #ifndef XEMMODELTYPE_H
26 #define XEMMODELTYPE_H
27 
28 #include "mixmod/Utilities/Util.h"
29 
30 namespace XEM {
31 
37 class ModelType {
38 
39 public:
40 
42  ModelType();
43 
44  // constructor
45  ModelType(ModelName name, int64_t nbSubDimensionFree = 0);
46 
47  // copy constructor
48  ModelType(const ModelType & iModelType);
49 
51  ~ModelType();
52 
54  bool operator ==(const ModelType & modelType) const;
55 
57  void input(std::ifstream & fi, int64_t nbCluster);
58 
60  ModelName _nameModel;
61 
62  ModelType* clone();
63 
65  //int64_t _nbSubDimensionEqual;
67  //int64_t _nbSubDimensionFree;
68 
70  int64_t _subDimensionEqual;
71 
73  int64_t _nbSubDimensionFree;
74 
76  int64_t * _tabSubDimensionFree;
77 
79  const ModelName & getModelName() const;
80 
82  const int64_t & getSubDimensionEqual() const;
83 
85  const int64_t * getTabSubDimensionFree() const;
86 
88  const int64_t & getTabSubDimensionFreeI(int64_t index) const;
89 
91  void setTabSubDimensionFree(int64_t iTabSubDimensionFree, int64_t position);
92 
94  void setSubDimensionEqual(int64_t iSubDimensionEqual);
95 
97  friend std::ostream & operator<<(std::ostream & fo, ModelType & modelType);
98 
99  // print out model type
100  void print(std::ostream & flux) const;
101  // print out model type short cut
102  void printShortcut(std::ostream & flux) const;
104  void edit(std::ostream & oFile);
105 };
106 
107 inline const ModelName & ModelType::getModelName() const {
108  return _nameModel;
109 }
110 
111 inline const int64_t & ModelType::getSubDimensionEqual() const {
112  return _subDimensionEqual;
113 }
114 
115 inline const int64_t * ModelType::getTabSubDimensionFree() const {
116  return _tabSubDimensionFree;
117 }
118 
119 inline const int64_t & ModelType::getTabSubDimensionFreeI(int64_t index) const {
120  return _tabSubDimensionFree[index];
121 }
122 
123 
124 }
125 
126 #endif
Base class for ModelType(s)
Definition: ModelType.h:37
const int64_t * getTabSubDimensionFree() const
getTabSubDimensionFree
Definition: ModelType.h:115
ModelName
Enumeration of model name.
Definition: Util.h:403
const ModelName & getModelName() const
getModelName
Definition: ModelType.h:107
void setTabSubDimensionFree(int64_t iTabSubDimensionFree, int64_t position)
setSubDimensionFree
Definition: ModelType.cpp:942
const int64_t & getSubDimensionEqual() const
getSubDimensionEqual
Definition: ModelType.h:111
const int64_t & getTabSubDimensionFreeI(int64_t index) const
getTabSubDimensionFreeI
Definition: ModelType.h:119
void edit(std::ostream &oFile)
editModelType
Definition: ModelType.cpp:708
Constants definitions, various utilities to describe models, and others...
void setSubDimensionEqual(int64_t iSubDimensionEqual)
setSubDimensionEqual
Definition: ModelType.cpp:954
friend std::ostream & operator<<(std::ostream &fo, ModelType &modelType)
<<
Definition: ModelType.cpp:425
bool operator==(const ModelType &modelType) const
Comparison operator.
Definition: ModelType.cpp:71
void input(std::ifstream &fi, int64_t nbCluster)
Input model type.
Definition: ModelType.cpp:84
~ModelType()
Destructor.
Definition: ModelType.cpp:60
ModelType()
Default constructor.
Definition: ModelType.cpp:32