mixmod  3.2.0
Mixture models for clustering and classification
 All Classes Namespaces Files Functions Variables Enumerations Friends
GaussianData.h
1 /***************************************************************************
2  SRC/mixmod/Kernel/IO/GaussianData.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 XEMGAUSSIANDATA_H
26 #define XEMGAUSSIANDATA_H
27 
28 #include "mixmod/Kernel/IO/Data.h"
29 
30 namespace XEM {
31 
37 class GaussianData : public Data {
38 
39 public:
40 
42  GaussianData();
43 
45  GaussianData(const GaussianData & iData);
46 
48  GaussianData(int64_t nbSample, int64_t pbDimension, const std::string & dataFileName);
49 
51  GaussianData(int64_t nbSample, int64_t pbDimension);
52 
54  GaussianData(int64_t nbSample, int64_t pbDimension, double ** matrix);
55 
57  GaussianData(int64_t nbSample, int64_t pbDimension, double weightTotal, Sample **& matrix, double * weight);
58 
60  // used in DCV context
61  GaussianData(int64_t nbSample, int64_t pbDimension, Data * originalData, CVBlock & block);
62 
64  virtual ~GaussianData();
65 
69  virtual Data * clone() const;
70 
74  virtual Sample ** cloneMatrix();
75 
76  //TODO a enlever XEMInput
80  virtual void input(std::ifstream & fi);
81 
84  virtual void input(const DataDescription & dataDescription);
85 
89  virtual void output(std::ostream & fo);
90 
91  virtual bool verify()const;
92 
94  double ** _yStore;
95 
96  double ** getYStore();
97 
98  double getInv2PiPow() const;
99 
100  double getHalfPbDimensionLog2Pi() const;
101 
102  double getPbDimensionLog2Pi() const;
103 
104  double * getTmpTabOfSizePbDimension() const;
105 
106 protected:
107 
109  double _Inv2PiPow;
110 
112  double _halfPbDimensionLog2Pi;
113 
114  double _pbDimensionLog2Pi;
115 
116  // tableau de double longueur _pbDimension
117  // utilisé pour ne pas avoir à faire sans arret allocation / destruction
118  // utilisé par XEMnorme, getLogLikeLihoodOne
119  double * __tmpTabOfSizePbDimension;
120 
121  bool _deleteSamples;
122 };
123 
124 inline double ** GaussianData::getYStore() {
125  return _yStore;
126 }
127 
128 inline double GaussianData::getInv2PiPow() const {
129  return _Inv2PiPow;
130 }
131 
132 inline double GaussianData::getHalfPbDimensionLog2Pi()const {
133  return _halfPbDimensionLog2Pi;
134 }
135 
136 inline double GaussianData::getPbDimensionLog2Pi()const {
137  return _pbDimensionLog2Pi;
138 }
139 
140 inline double* GaussianData::getTmpTabOfSizePbDimension()const {
141  return __tmpTabOfSizePbDimension;
142 }
143 
144 }
145 
146 #endif
GaussianData()
Default constructor.
Definition: GaussianData.cpp:39
virtual void input(std::ifstream &fi)
Read data from gaussian data file Gaussian Data file to read.
Definition: GaussianData.cpp:251
XEMCVBlock.
Definition: Util.h:393
virtual Sample ** cloneMatrix()
Copy.
Definition: GaussianData.cpp:237
virtual Data * clone() const
Selector.
Definition: GaussianData.cpp:229
virtual ~GaussianData()
Destructor.
Definition: GaussianData.cpp:202
Base class for Sample.
Definition: Sample.h:41
Base class for Gaussian Data.
Definition: GaussianData.h:37
Base class for Data.
Definition: Data.h:43
virtual void output(std::ostream &fo)
Write gaussian data in output file Output file to write into.
Definition: GaussianData.cpp:338
Definition: DataDescription.h:45