manual_function.h
Go to the documentation of this file.
1 
40 #ifndef HIGH_PRECISION_PSO_FUNCTION_MANUAL_FUNCTION_H_
41 #define HIGH_PRECISION_PSO_FUNCTION_MANUAL_FUNCTION_H_
42 
43 #include <gmp.h>
44 #include <string>
45 #include <vector>
46 
47 #include "function/function.h"
49 
50 namespace highprecisionpso {
51 
56 public:
63  FunctionReduceOperator(VectorReduceOperation* vector_reduce_operation, SpecificFunction* specific_function);
71  mpf_t* Eval(const std::vector<mpf_t*> & pos);
72  std::string GetName();
73 
74 private:
75  VectorReduceOperation* vector_reduce_operation_;
76  SpecificFunction* specific_function_;
77 };
78 
82 class OperatedFunction : public Function {
83 public:
90  OperatedFunction(Operation* operation, Function* function);
98  mpf_t* Eval(const std::vector<mpf_t*> & pos);
99  std::string GetName();
100 
101 private:
102  Operation* operation_;
103  Function* function_;
104 };
105 
109 class CombineFunction : public Function {
110 public:
118  CombineFunction(PairReduceOperation* operation, Function* operator1, Function* operator2);
126  mpf_t* Eval(const std::vector<mpf_t*> & pos);
127  std::string GetName();
128 
129 private:
130  PairReduceOperation* operation_;
131  Function* operator1_;
132  Function* operator2_;
133 };
134 
138 class ConstantFunction : public Function {
139 public:
145  ConstantFunction(ConstantEvaluation* constant_evaluation);
153  mpf_t* Eval(const std::vector<mpf_t*> & pos);
154  std::string GetName();
155 
156 private:
157  ConstantEvaluation* constant_evaluation_;
158 };
159 
160 } // namespace highprecisionpso
161 
162 #endif /* HIGH_PRECISION_PSO_FUNCTION_MANUAL_FUNCTION_H_ */
163 
This file contains abstract classes for function generation.
This class is an abstract class. It supplies an interface for operations on vectors.
Definition: function.h:191
This class implements a specific function with an evaluation function that always evaluates to a vect...
Definition: manual_function.h:138
This class is an abstract class. It supplies the interface for generating a constant value...
Definition: general_objects.h:532
std::string GetName()
Returns a string representation of this object.
This class implements a function which combines two functions with an operation.
Definition: manual_function.h:109
mpf_t * Eval(const std::vector< mpf_t * > &pos)
Reduces the result of the stored specific function by the stored vector reduce operation.
This an abstract class. It supplies the interface for reducing a vector of mpf_t values to a single v...
Definition: general_objects.h:153
This class is an abstract class. It supplies the interface to operate on single mpf_t values...
Definition: general_objects.h:683
FunctionReduceOperator(VectorReduceOperation *vector_reduce_operation, SpecificFunction *specific_function)
The constructor, where the specific function, which should be reduced, and the vector reduce operatio...
This class is a function, which reduces a specific function to a function with a vector reduce operat...
Definition: manual_function.h:55
This class is a function, which applies some operation to the result of another function.
Definition: manual_function.h:82
This class is an abstract class. It supplies the interface for objective functions.
Definition: function.h:74
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