mixmod  3.2.0
Mixture models for clustering and classification
 All Classes Namespaces Files Functions Variables Enumerations Friends
CriterionOutput.h
1 /***************************************************************************
2  SRC/mixmod/Kernel/Criterion/CriterionOutput.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 XEMCriterionOutput_H
26 #define XEMCriterionOutput_H
27 
28 #include "mixmod/Utilities/Util.h"
29 
30 namespace XEM {
31 
37 
38 public:
39 
42 
44  CriterionOutput(const CriterionOutput& criterionOutput);
45 
47  CriterionOutput(CriterionName criterionName);
48 
50  CriterionOutput(CriterionName criterionName, double criterionValue, Exception& criterionErrorType);
51 
53  virtual ~CriterionOutput();
54 
56  bool operator ==(const CriterionOutput & criterionOutput) const;
57 
59  void editType(std::ostream & oFile) const;
60 
62  void editValue(std::ostream & oFile, bool text = false) const;
63 
65  void editTypeAndValue(std::ostream & oFile) const;
66 
67  //--------------
68  // get
69  //--------------
71  CriterionName const getCriterionName() const;
72 
74  double const getValue() const;
75 
77  Exception & getError() const;
78 
79  //--------------
80  // set
81  //--------------
83  void setCriterionName(CriterionName criterionName);
84 
86  void setValue(double value);
87 
89  void setError(Exception& e);
90 
91 private:
92 
94  double _value;
95 
97  Exception * _error;
98 
100  CriterionName _criterionName;
101 };
102 
104  return _criterionName;
105 }
106 
107 inline double const CriterionOutput::getValue() const {
108  return _value;
109 }
110 
112  return *_error;
113 }
114 
116  _criterionName = criterionName;
117 }
118 
119 inline void CriterionOutput::setValue(double value) {
120  _value = value;
121 }
122 
124  if (_error) delete _error;
125  _error = e.clone();
126 }
127 
128 }
129 
130 #endif
void editType(std::ostream &oFile) const
editType
Definition: CriterionOutput.cpp:91
void setError(Exception &e)
setError
Definition: CriterionOutput.h:123
double const getValue() const
getValue
Definition: CriterionOutput.h:107
CriterionOutput()
Default constructor.
Definition: CriterionOutput.cpp:33
Definition: Exception.h:42
void editValue(std::ostream &oFile, bool text=false) const
editValue
Definition: CriterionOutput.cpp:114
CriterionName const getCriterionName() const
getCriterionName
Definition: CriterionOutput.h:103
virtual ~CriterionOutput()
Destructor.
Definition: CriterionOutput.cpp:73
void setValue(double value)
setValue
Definition: CriterionOutput.h:119
Exception & getError() const
getError
Definition: CriterionOutput.h:111
CriterionName
Enumeration of Criterion type.
Definition: Util.h:303
void editTypeAndValue(std::ostream &oFile) const
editTypeAndValue
Definition: CriterionOutput.cpp:134
Constants definitions, various utilities to describe models, and others...
void setCriterionName(CriterionName criterionName)
setCriterionName
Definition: CriterionOutput.h:115
bool operator==(const CriterionOutput &criterionOutput) const
Comparison operator.
Definition: CriterionOutput.cpp:81
Base class for Label(s)
Definition: CriterionOutput.h:36