mixmod  3.2.0
Mixture models for clustering and classification
 All Classes Namespaces Files Functions Variables Enumerations Friends
ClusteringOutput.h
1 /***************************************************************************
2  SRC/mixmod/Clustering/ClusteringOutput.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 XEMCLUSTERINGOUTPUT_H
26 #define XEMCLUSTERINGOUTPUT_H
27 
28 #include "mixmod/Utilities/Util.h"
29 
30 namespace XEM {
31 
32 // pre-declaration
33 class Model;
34 class Criterion;
35 class ClusteringModelOutput;
36 
45 
46 public:
47 
49  ClusteringOutput(std::vector<CriterionName> const & criterionName);
50 
52  ClusteringOutput(const ClusteringOutput & cOutput);
53 
54  ClusteringOutput* clone();
55 
56  // Add one ClusteringModelOutput (incremental construction)
57  void addEstimation(ClusteringModelOutput* cmoutput);
58 
60  ClusteringOutput(std::vector<Model*> const & estimations, std::vector<CriterionName> const & criterionName);
61 
63  virtual ~ClusteringOutput();
64 
66  bool operator ==(const ClusteringOutput & output) const;
67 
68  bool operator !=(const ClusteringOutput & output) const;
69 
70  bool atLeastOneEstimationNoError() const;
71 
72  const int getNbEstimationWithNoError() const;
73 
75  void sort(CriterionName criterionName);
76 
77  void editFile() const;
78 
81  ClusteringModelOutput * getClusteringModelOutput(const int64_t index) const;
82 
83  int64_t getNbClusteringModelOutput() const;
84 
85  std::vector<ClusteringModelOutput*> const & getClusteringModelOutput() const;
86 
87  void setClusteringModelOutput(std::vector<ClusteringModelOutput *> & clusteringModelOutput);
88 
89  const int getCriterionSize() const;
90  const CriterionName & getCriterionName(const int index) const;
91  const std::vector<CriterionName> & getCriterionName() const;
92 
93 private:
94 
95  // Vector containing output for each model
96  std::vector<ClusteringModelOutput*> _clusteringModelOutput;
97  // vector containing criterion name
98  // that will be useful to deal with output in mixmodGUI
99  std::vector<CriterionName> const & _criterionName;
100 };
101 
102 inline std::vector<ClusteringModelOutput*> const & ClusteringOutput::getClusteringModelOutput() const {
103  return _clusteringModelOutput;
104 }
105 
106 inline ClusteringModelOutput * ClusteringOutput::getClusteringModelOutput(const int64_t index) const {
107  return _clusteringModelOutput[index];
108 }
109 
110 inline int64_t ClusteringOutput::getNbClusteringModelOutput() const {
111  return _clusteringModelOutput.size();
112 }
113 
114 inline const int ClusteringOutput::getCriterionSize() const {
115  return _criterionName.size();
116 }
117 
118 inline const CriterionName & ClusteringOutput::getCriterionName(const int index) const {
119  return _criterionName[index];
120 }
121 
122 inline const std::vector<CriterionName> & ClusteringOutput::getCriterionName() const {
123  return _criterionName;
124 }
125 
126 }
127 
128 #endif
void sort(CriterionName criterionName)
sort vector of XEMClusteringModelOutput (with the ith criterion value)
Definition: ClusteringOutput.cpp:226
ClusteringOutput(std::vector< CriterionName > const &criterionName)
Default Constructor.
Definition: ClusteringOutput.cpp:44
virtual ~ClusteringOutput()
Destructor.
Definition: ClusteringOutput.cpp:84
ClusteringModelOutput * getClusteringModelOutput(const int64_t index) const
Definition: ClusteringOutput.h:106
Definition: ClusteringOutput.h:44
CriterionName
Enumeration of Criterion type.
Definition: Util.h:303
Constants definitions, various utilities to describe models, and others...
bool operator==(const ClusteringOutput &output) const
Comparison operator.
Definition: ClusteringOutput.cpp:96
Definition: ClusteringModelOutput.h:38