mixmod  3.2.0
Mixture models for clustering and classification
 All Classes Namespaces Files Functions Variables Enumerations Friends
CompositeData.h
1 /***************************************************************************
2  SRC/mixmod/Kernel/IO/CompositeData.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 XEMCOMPOSITEDATA_H_
26 #define XEMCOMPOSITEDATA_H_
27 
31 #include "mixmod/Kernel/IO/Data.h"
32 #include "mixmod/Kernel/IO/GaussianData.h"
33 #include "mixmod/Kernel/IO/BinaryData.h"
34 
35 namespace XEM {
36 
37 class CompositeData : public Data {
38 
39 public:
40 
41  //default constructor
42  CompositeData();
43  //copy constructor
45  //Initialization constructor
47  virtual CompositeData * clone() const;
48 
49  virtual void input(std::ifstream&) {
50  THROW(OtherException, FunctionNotYetImplemented);
51  }
52 
53  virtual void input(const DataDescription&);
54 
55  virtual void output(std::ostream&) {
56  THROW(OtherException, FunctionNotYetImplemented);
57  }
58 
59  virtual Sample** cloneMatrix() {
60  THROW(OtherException, FunctionNotYetImplemented);
61  }
62 
64  inline operator GaussianData*() {
65  return (GaussianData*) _dataComponent[1];
66  }
67 
69  inline operator BinaryData*() {
70  return (BinaryData*) _dataComponent[0];
71  }
72 
75  return (GaussianData*) _dataComponent[1];
76  }
77 
80  return (BinaryData*) _dataComponent[0];
81  }
83  virtual ~CompositeData();
84 
85 protected:
86 
87  vector<Data*> _dataComponent;
88 };
89 
90 }
91 
92 #endif /* XEMCOMPOSITEDATA_H_ */
virtual void output(std::ostream &)
Write data in output file Output file to write into.
Definition: CompositeData.h:55
Definition: OtherException.h:37
Base class for Binary Data.
Definition: BinaryData.h:41
Definition: CompositeData.h:37
virtual BinaryData * getBinaryData()
Definition: CompositeData.h:79
virtual ~CompositeData()
Definition: CompositeData.cpp:87
virtual void input(std::ifstream &)
Read data from data file Data file to read.
Definition: CompositeData.h:49
Base class for Sample.
Definition: Sample.h:41
virtual CompositeData * clone() const
Selector.
Definition: CompositeData.cpp:82
Base class for Gaussian Data.
Definition: GaussianData.h:37
Base class for Data.
Definition: Data.h:43
virtual GaussianData * getGaussianData()
Definition: CompositeData.h:74
Definition: DataDescription.h:45