direct_statistics.h
Go to the documentation of this file.
1 
40 #ifndef HIGH_PRECISION_PSO_STATISTICS_DIRECT_STATISTICS_H_
41 #define HIGH_PRECISION_PSO_STATISTICS_DIRECT_STATISTICS_H_
42 
43 #include <gmp.h>
44 #include <vector>
45 
48 
49 namespace highprecisionpso {
50 
54 class Statistic {
55 public:
59  virtual ~Statistic(){}
65  std::string EvaluationToString();
66 
72  virtual std::vector<mpf_t*> Evaluate() = 0;
78  virtual std::string GetName() = 0;
79 };
80 
84 class CombineStatistic : public Statistic {
85 public:
93  CombineStatistic(PairReduceOperation* operation, Statistic* operator1, Statistic* operator2);
99  std::vector<mpf_t*> Evaluate();
100  std::string GetName();
101 
102 private:
103  PairReduceOperation* operation_;
104  Statistic* operator1_;
105  Statistic* operator2_;
106 };
107 
112 public:
119  StatisticReduceOperator(StatisticReduceOperation* reduce_operation, SpecificStatisticalEvaluation* specific_evaluation);
125  std::vector<mpf_t*> Evaluate();
126  std::string GetName();
127 
128 private:
129  StatisticReduceOperation* reduce_operation_;
130  SpecificStatisticalEvaluation* specific_evaluation_;
131 };
132 
137 public:
144  OperatedStatistic(Operation* operation, Statistic* statistic);
150  std::vector<mpf_t*> Evaluate();
151  std::string GetName();
152 
153 private:
154  Operation* operation_;
155  Statistic* statistic_;
156 };
157 
161 class NamedStatistic: public Statistic {
162 public:
169  NamedStatistic(std::string name, Statistic* statistic);
170  std::vector<mpf_t*> Evaluate();
171  std::string GetName();
172 
173 private:
174  std::string name_;
175  Statistic* statistic_;
176 };
177 
182 public:
188  std::vector<mpf_t*> Evaluate();
189  std::string GetName();
190 };
191 
196 public:
202  std::vector<mpf_t*> Evaluate();
203  std::string GetName();
204 };
205 
210 public:
216  std::vector<mpf_t*> Evaluate();
217  std::string GetName();
218 };
219 
224 public:
230  std::vector<mpf_t*> Evaluate();
231  std::string GetName();
232 };
233 
238 public:
244  std::vector<mpf_t*> Evaluate();
245  std::string GetName();
246 };
247 
252 public:
258  std::vector<mpf_t*> Evaluate();
259  std::string GetName();
260 };
261 
267 class ConstantStatistic : public Statistic {
268 public:
275  ConstantStatistic(int dimensions, ConstantEvaluation* constant_evaluation);
281  std::vector<mpf_t*> Evaluate();
282  std::string GetName();
283 
284 private:
285  int dimensions_;
286  ConstantEvaluation* constant_evaluation_;
287 };
288 
289 } // namespace highprecisionpso
290 
291 #endif /* HIGH_PRECISION_PSO_STATISTICS_DIRECT_STATISTICS_H_ */
std::string EvaluationToString()
Calls the normal evaluation function and transforms the result to a string.
virtual std::vector< mpf_t * > Evaluate()=0
Performs some statistical evaluations.
This class implements a statistic, where the name is set manually.
Definition: direct_statistics.h:161
virtual ~Statistic()
Definition: direct_statistics.h:59
This class implements a statistic, which evaluates how the precision of the evaluations evolve...
Definition: direct_statistics.h:251
This class is an abstract class. It supplies the interface for generating a constant value...
Definition: general_objects.h:532
This class is an abstract class. It supplies the interface to reduce specific statistical evaluations...
Definition: specific_statistical_evaluations.h:231
This class implements a statistic, which operates on the values of another statistic.
Definition: direct_statistics.h:136
virtual std::string GetName()=0
Returns a string representation of this object.
This class implements a statistic, which evaluates the distance of the global best found position to ...
Definition: direct_statistics.h:195
This class implements a statistic, which evaluates the objective function at the global best position...
Definition: direct_statistics.h:209
This class implements a statistic, which reduces a specific statistical evaluation to an analyzable s...
Definition: direct_statistics.h:111
This class is an abstract class. It supplies the interface to operate on single mpf_t values...
Definition: general_objects.h:683
This class implements a statistic, which evaluates how often each particle updates a global attractor...
Definition: direct_statistics.h:237
This class is an abstract class. It supplies the interface for statistical evaluations.
Definition: direct_statistics.h:54
This file contain classes, which can evaluate matrices depending on the current state of the particle...
This class implements a statistic, which always evaluates to the same value.
Definition: direct_statistics.h:267
This class is an abstract class. It supplies the interface for intermediate statistical evaluations...
Definition: specific_statistical_evaluations.h:54
This class implements a statistic, which evaluates how often each particle updates its local attracto...
Definition: direct_statistics.h:223
This class implements a statistic, which combines two statistics by a combination operation...
Definition: direct_statistics.h:84
This class is an abstract class. It supplies the interface for reducing two mpf_t values to a single ...
Definition: general_objects.h:403
This file contains various general objects which can be used by or contained in other objects...
base namespace for this project.
Definition: absorption.h:45
This class implements a statistic, which displays the position entries of the overall best position f...
Definition: direct_statistics.h:181