mixmod  3.2.0
Mixture models for clustering and classification
 All Classes Namespaces Files Functions Variables Enumerations Friends
BinaryData.h
1 /***************************************************************************
2  SRC/mixmod/Kernel/IO/BinaryData.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 XEMBINARYDATA_H
26 #define XEMBINARYDATA_H
27 
28 #include "mixmod/Kernel/IO/Data.h"
29 
30 namespace XEM {
31 
32 // pre-declaration
33 class Partition;
34 class BinarySample;
35 
41 class BinaryData : public Data {
42 
43 public:
44 
46  BinaryData();
47 
49  BinaryData(const BinaryData & iData);
50 
52  BinaryData(int64_t nbSample, int64_t pbDimension,
53  const std::string & dataFileName, int64_t * tabNbModality);
54 
56  BinaryData(int64_t nbSample, int64_t pbDimension, std::vector<int64_t> nbModality);
57 
59  BinaryData(int64_t nbSample, int64_t pbDimension,
60  std::vector<int64_t> nbModality, int64_t ** matrix);
61 
63  BinaryData(int64_t nbSample, int64_t pbDimension, int64_t * tabNbModality,
64  double weightTotal, Sample **& matrix, double * weight);
65 
66 
68  BinaryData(int64_t nbSample, int64_t pbDimension, Data * originalData, CVBlock & block);
69 
71  virtual ~BinaryData();
72 
73 
74 
75  virtual void input(const DataDescription & dataDescription);
76 
80  virtual Data * clone() const;
81 
85  virtual Sample ** cloneMatrix();
86 
90  virtual void input(std::ifstream & fi);
91 
95  virtual void output(std::ostream & fo);
96 
97 
98  virtual bool verify()const;
99 
103  Sample ** getDataMatrix() const;
104 
109  int64_t * getDataTabValue(int64_t idxSample) const;
110 
114  int64_t * getTabNbModality() const;
115 
116  Data * reduceData(std::vector<int64_t> & correspondcenceOriginDataToReduceData,
117  Partition * knownPartition, Partition * initPartition,
118  Partition *& oKnownPartition, Partition *& oInitPartition);
119 
120 protected:
121 
123  int64_t * _tabNbModality;
124  Data * _reducedData;
125 };
126 
127 //---------------
128 // inline methods
129 //---------------
130 
132  return _matrix;
133 }
134 
135 inline int64_t * BinaryData::getTabNbModality() const {
136  return _tabNbModality;
137 }
138 
139 }
140 
141 #endif
Sample ** getDataMatrix() const
Get matrix of data Sample.
Definition: BinaryData.h:131
virtual Sample ** cloneMatrix()
Copy.
Definition: BinaryData.cpp:217
Base class for Binary Data.
Definition: BinaryData.h:41
virtual ~BinaryData()
Desctructor.
Definition: BinaryData.cpp:183
XEMCVBlock.
Definition: Util.h:393
int64_t * getDataTabValue(int64_t idxSample) const
Get matrix of data Sample.
Definition: BinaryData.cpp:621
Base class for Partition(s)
Definition: Partition.h:39
BinaryData()
Default constructor.
Definition: BinaryData.cpp:41
virtual void input(const DataDescription &dataDescription)
Read data from XEMDataDescription.
Definition: BinaryData.cpp:259
virtual void output(std::ostream &fo)
Write binary data in output file.
Definition: BinaryData.cpp:318
Base class for Sample.
Definition: Sample.h:41
int64_t * getTabNbModality() const
Get tab modality.
Definition: BinaryData.h:135
virtual Data * clone() const
copy
Definition: BinaryData.cpp:209
Base class for Data.
Definition: Data.h:43
Definition: DataDescription.h:45