mixmod  3.2.0
Mixture models for clustering and classification
 All Classes Namespaces Files Functions Variables Enumerations Friends
BinaryEkParameter.h
1 /***************************************************************************
2  SRC/mixmod/Kernel/Parameter/BinaryEkParameter.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 XEMBinaryEkParameter_H
26 #define XEMBinaryEkParameter_H
27 
28 #include "mixmod/Kernel/Parameter/BinaryParameter.h"
29 
30 namespace XEM {
31 
36 
37 public:
38 
41 
43  // called by XEMModel
44  BinaryEkParameter(Model * iModel, ModelType * iModelType, int64_t * tabNbModality);
45 
47  BinaryEkParameter(const BinaryEkParameter * iParameter);
48 
51 
53  virtual bool operator ==(const BinaryEkParameter & param) const;
54 
56  virtual void reset();
57 
59  Parameter * clone() const;
60 
62  double * getScatter() const;
63 
65  int64_t getFreeParameter() const;
66 
67  double getPdf(int64_t iSample, int64_t kCluster) const;
68 
69  long double getLogPdf(int64_t iSample, int64_t kCluster) const;
70 
74  double getPdf(Sample * x, int64_t kCluster) const;
75 
77  double getLogLikelihoodOne() const;
78 
80  void computeScatter();
81 
83  void computeRandomScatter();
84 
86  void recopyScatter(Parameter * iParam);
87 
89  void createScatter(double *** scatter);
90 
92  void editScatter(int64_t k);
93 
95  void editScatter(std::ofstream & oFile, int64_t k, bool text = false);
96 
97  // Read Scatter in input file
98  void inputScatter(std::ifstream & fi);
99  void inputScatter(double *** scatters);
100 
101  double *** scatterToArray() const;
102 
103 private:
104 
106  double * _scatter;
107 };
108 
109 inline double * BinaryEkParameter::getScatter() const {
110  return _scatter;
111 }
112 
113 }
114 
115 #endif
int64_t getFreeParameter() const
getFreeParameter
Definition: BinaryEkParameter.cpp:110
long double getLogPdf(int64_t iSample, int64_t kCluster) const
Compute log probability density.
Definition: BinaryEkParameter.cpp:142
Base class for ModelType(s)
Definition: ModelType.h:37
~BinaryEkParameter()
Destructor.
Definition: BinaryEkParameter.cpp:79
void editScatter(int64_t k)
editScatter (for debug)
Definition: BinaryEkParameter.cpp:304
double * getScatter() const
selector : return scatter value
Definition: BinaryEkParameter.h:109
virtual void reset()
reset to default values
Definition: BinaryEkParameter.cpp:99
Base class for XEMBinaryParameter(s)
Definition: BinaryParameter.h:41
Definition: BinaryEkParameter.h:35
void computeScatter()
Compute scatter(s)
Definition: BinaryEkParameter.cpp:225
Definition: Model.h:50
void createScatter(double ***scatter)
create Scatter from "Binary Parameter Ekjh"
Definition: BinaryEkParameter.cpp:289
Parameter * clone() const
clone
Definition: BinaryEkParameter.cpp:71
void recopyScatter(Parameter *iParam)
recopy scatter from param (used for init : USER)
Definition: BinaryEkParameter.cpp:275
double getPdf(int64_t iSample, int64_t kCluster) const
Compute probability density.
Definition: BinaryEkParameter.cpp:121
Base class for Sample.
Definition: Sample.h:41
Base class for XEMParameter(s)
Definition: Parameter.h:45
virtual bool operator==(const BinaryEkParameter &param) const
Comparison operator.
Definition: BinaryEkParameter.cpp:88
BinaryEkParameter()
Default constructor.
Definition: BinaryEkParameter.cpp:37
double getLogLikelihoodOne() const
getlogLikelihoodOne (one cluster)
Definition: BinaryEkParameter.cpp:186
void computeRandomScatter()
Compute random scatter(s)
Definition: BinaryEkParameter.cpp:257