mixmod  3.2.0
Mixture models for clustering and classification
 All Classes Namespaces Files Functions Variables Enumerations Friends
CompositeParameter.h
1 /***************************************************************************
2  SRC/mixmod/Kernel/Parameter/CompositeParameter.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 XEMCOMPOSITEPARAMETER_H_
26 #define XEMCOMPOSITEPARAMETER_H_
27 
32 #include "mixmod/Kernel/Parameter/Parameter.h"
33 #include "mixmod/Kernel/Parameter/GaussianEDDAParameter.h"
34 
35 namespace XEM {
36 
37 class GaussianParameter;
38 class BinaryParameter;
39 
40 class CompositeParameter : public Parameter {
41 
42 public:
43 
44  //default constructor
46  //copy constructor
48  //Actual constructor
49  CompositeParameter(Model*, ModelType*, int64_t*);
50  CompositeParameter(const Parameter * igaussian, const Parameter * ibinary,
51  ModelType * imodelType);
52  void InstantiateBinaryandGaussianParamter(ModelType*, int64_t*);
53  virtual void setModel(Model * iModel);
54  virtual void reset();
55  virtual CompositeParameter * clone() const;
57  virtual double getPdf(int64_t iSample, int64_t kCluster) const;
58  virtual void getAllPdf(double ** tabFik, double * tabProportion) const;
60  virtual double getPdf(Sample * x, int64_t kCluster) const;
61  virtual int64_t getFreeParameter() const;
62 
63  virtual double getLogLikelihoodOne() const;
64  virtual void initUSER(Parameter * iParam);
65  virtual void initForInitRANDOM();
66  virtual void updateForInitRANDOMorUSER_PARTITION(Sample ** tabSampleForInit, bool * tabClusterToInitialze);
67 
68  virtual void initForInitUSER_PARTITION(int64_t & nbInitializedCluster, bool * tabNotInitializedCluster, Partition * initPartition) {
69  THROW(OtherException, FunctionNotYetImplemented);
70  }
71  virtual void MStep();
72  virtual void edit();
73  virtual void edit(std::ofstream & oFile, bool text = false);
74 
75  virtual void input(std::ifstream & fi);
76 
77  virtual void recopy(Parameter * otherParameter);
78  virtual void updateForCV(Model * originalModel, CVBlock & CVBlock);
80  operator BinaryParameter*();
82  operator GaussianParameter*();
83 
84  virtual BinaryParameter* getBinaryParameter() {
85  return (BinaryParameter*) _parameterComponent[0];
86  }
87 
88  virtual GaussianParameter* getGaussianParameter() {
89  return (GaussianParameter*) _parameterComponent[1];
90  }
91  virtual ~CompositeParameter();
92 
93 protected:
94 
95  vector<Parameter*> _parameterComponent;
96  vector<ModelType*> _parameterModelType;
97 };
98 
99 inline CompositeParameter::operator BinaryParameter *() {
100  return (BinaryParameter*) _parameterComponent[0];
101 }
102 
103 inline CompositeParameter::operator GaussianParameter *() {
104  return (GaussianParameter*) _parameterComponent[1];
105 }
106 
107 }
108 
109 #endif /* XEMCOMPOSITEPARAMETER_H_ */
virtual void initUSER(Parameter *iParam)
init user
Definition: CompositeParameter.cpp:553
virtual double getLogLikelihoodOne() const
get loglikelihood with one cluster
Definition: CompositeParameter.cpp:93
virtual int64_t getFreeParameter() const
Selector.
Definition: CompositeParameter.cpp:518
Base class for ModelType(s)
Definition: ModelType.h:37
virtual void setModel(Model *iModel)
setModel , made it virtual so that composite paramter class can override it.
Definition: CompositeParameter.cpp:588
virtual void input(std::ifstream &fi)
input
Definition: CompositeParameter.cpp:577
Definition: OtherException.h:37
Base class for XEMBinaryParameter(s)
Definition: BinaryParameter.h:41
XEMCVBlock.
Definition: Util.h:393
virtual double getPdf(int64_t iSample, int64_t kCluster) const
Definition: CompositeParameter.cpp:482
Base class for Partition(s)
Definition: Partition.h:39
Definition: Model.h:50
virtual void reset()
reset to default values
Definition: CompositeParameter.cpp:543
Base class for XEMGaussianParameter(s)
Definition: GaussianParameter.h:42
virtual void initForInitRANDOM()
initialize attributes before an InitRandom
Definition: CompositeParameter.cpp:524
virtual void MStep()
Maximum a posteriori step method.
Definition: CompositeParameter.cpp:496
Base class for Sample.
Definition: Sample.h:41
virtual CompositeParameter * clone() const
Selector.
Definition: CompositeParameter.cpp:513
virtual void initForInitUSER_PARTITION(int64_t &nbInitializedCluster, bool *tabNotInitializedCluster, Partition *initPartition)
Definition: CompositeParameter.h:68
virtual void recopy(Parameter *otherParameter)
recopie sans faire construction / destruction
Definition: CompositeParameter.cpp:538
Base class for XEMParameter(s)
Definition: Parameter.h:45
Definition: CompositeParameter.h:40