mixmod  3.2.0
Mixture models for clustering and classification
 All Classes Namespaces Files Functions Variables Enumerations Friends
Description.h
1 /***************************************************************************
2  SRC/mixmod/Kernel/IO/Description.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 XEMDESCRIPTION_H
27 #define XEMDESCRIPTION_H
28 
29 #include "mixmod/Utilities/Util.h"
30 
31 namespace XEM {
32 
33 // pre-declaration
34 class ColumnDescription;
35 
42 class Description {
43 
44 public:
46  Description();
47 
49  Description(int64_t nbSample, int64_t nbColumn,
50  std::vector<ColumnDescription *> columnDescription,
51  FormatNumeric::FormatNumericFile format,
52  std::string filename, std::string InfoName = "");
53 
55  Description(Description & description);
56 
58  virtual ~Description();
59 
62 
64  Description & operator=(const Description & description);
65 
67  //get Name
68  std::string getInfoName()const;
69 
70  //get NbSample
71  int64_t getNbSample() const;
72 
73  //get FileName
74  std::string getFileName()const;
75 
76  //get NbColumn
77  int64_t getNbColumn()const;
78 
79  //get Format
80  FormatNumeric::FormatNumericFile getFormat() const;
81 
82  //get ColumnDescription
83  const ColumnDescription * getColumnDescription(int64_t index)const;
84 
85  const std::vector<ColumnDescription*> getAllColumnDescription()const;
86 
87  int64_t getPbDimension() const;
88 
90  //set InfoName
91  void setInfoName(std::string & iInfoName);
92 
93  virtual void saveNumericValues(std::string fileName = "") = 0;
94 
95 protected:
96 
97  std::string _infoName;
98  int64_t _nbSample;
99  int64_t _nbColumn;
100  std::string _fileName; //numeric file name
101  FormatNumeric::FormatNumericFile _format; //format of numeric file
102  std::vector<ColumnDescription*> _columnDescription; //each variable has a description
103 };
104 
105 inline std::string Description::getInfoName()const {
106  return _infoName;
107 }
108 
109 inline int64_t Description::getNbSample()const {
110  return _nbSample;
111 }
112 
113 inline int64_t Description::getNbColumn()const {
114  return _nbColumn;
115 }
116 
117 inline std::string Description::getFileName()const {
118  return _fileName;
119 }
120 
121 inline const ColumnDescription * Description::getColumnDescription(int64_t index)const {
122  if (index >= 0 && index <= _nbColumn)
123  return _columnDescription[index];
124  else THROW(InputException, wrongIndexInGetMethod);
125 }
126 
127 inline const std::vector<ColumnDescription*> Description::getAllColumnDescription()const {
128  return _columnDescription;
129 }
130 
131 inline FormatNumeric::FormatNumericFile Description::getFormat()const {
132  return _format;
133 }
134 
135 inline void Description::setInfoName(std::string & iInfoName) {
136  _infoName = iInfoName;
137 }
138 
139 }
140 
141 #endif // XEMDESCRIPTION_H
void initializationColumnDescription()
initialization ColumnDescription by default
Definition: Description.cpp:103
std::string getInfoName() const
get
Definition: Description.h:105
Description & operator=(const Description &description)
operator=
Definition: Description.cpp:78
virtual ~Description()
Destructor.
Definition: Description.cpp:95
Definition: ColumnDescription.h:38
Description()
Default constructor.
Definition: Description.cpp:37
Constants definitions, various utilities to describe models, and others...
void setInfoName(std::string &iInfoName)
set
Definition: Description.h:135
Definition: Description.h:42