mixmod  3.2.0
Mixture models for clustering and classification
 All Classes Namespaces Files Functions Variables Enumerations Friends
CompositeSample.h
1 /***************************************************************************
2  SRC/mixmod/Kernel/IO/CompositeSample.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 XEMCOMPOSITESAMPLE_H_
26 #define XEMCOMPOSITESAMPLE_H_
27 
31 #include "mixmod/Kernel/IO/Sample.h"
32 
33 namespace XEM {
34 
35 class BinarySample;
36 class GaussianSample;
37 
38 class CompositeSample : public Sample {
39 
40 public:
41 
42  //Default constructor
44  //Initialization constructor
47  operator BinarySample*();
49  operator GaussianSample*();
50 
52  virtual GaussianSample* getGaussianSample() const {
53  return (GaussianSample*) _sampleComponent[1];
54  }
55 
57  virtual BinarySample* getBinarySample() const {
58  return (BinarySample*) _sampleComponent[0];
59  }
60  virtual ~CompositeSample();
61 
62 protected:
63 
64  vector<Sample*> _sampleComponent;
65 };
66 
67 inline CompositeSample::operator BinarySample *() {
68  return _sampleComponent[0]->getBinarySample();
69 }
70 
71 inline CompositeSample::operator GaussianSample *() {
72  return _sampleComponent[1]->getGaussianSample();
73 }
74 
75 }
76 
77 #endif /* XEMCOMPOSITESAMPLE_H_ */
virtual BinarySample * getBinarySample() const
Definition: CompositeSample.h:57
Definition: CompositeSample.h:38
virtual GaussianSample * getGaussianSample() const
Definition: CompositeSample.h:52
Base class for Sample.
Definition: BinarySample.h:37
Base class for Sample.
Definition: GaussianSample.h:37
Base class for Sample.
Definition: Sample.h:41