function.h
Go to the documentation of this file.
1 
40 #ifndef HIGH_PRECISION_PSO_FUNCTION_FUNCTION_H_
41 #define HIGH_PRECISION_PSO_FUNCTION_FUNCTION_H_
42 
43 #include <gmp.h>
44 #include <vector>
45 
46 namespace highprecisionpso {
47 
52 public:
69 };
70 
74 class Function{
75 public:
79  virtual ~Function(){};
83  Function();
90  Function(double search_space_lower_bound, double search_space_upper_bound);
97  Function(std::vector<double> search_space_lower_bound, std::vector<double> search_space_upper_bound);
109  mpf_t* Evaluate(const std::vector<mpf_t*> & pos);
115  virtual std::vector<mpf_t*> GetLowerSearchSpaceBound();
121  virtual std::vector<mpf_t*> GetUpperSearchSpaceBound();
127  virtual std::string GetName() = 0;
140  virtual mpf_t* DistanceTo1DLocalOptimum(const std::vector<mpf_t*> & pos, int d);
152  virtual mpf_t* Eval(const std::vector<mpf_t*> & pos) = 0;
166  virtual mpf_t* DistanceTo1DLocalOptimumTernarySearch(const std::vector<mpf_t*> & pos, int d, mpf_t* start_distance);
172  void SetFunctionBound(SearchSpaceBound* search_space_bound);
176  void InitSearchSpaceBounds();
177 private:
181  std::vector<double> search_space_lower_bound_;
185  std::vector<double> search_space_upper_bound_;
186 };
187 
192 public:
196  virtual ~SpecificFunction(){};
204  virtual std::vector<mpf_t*> Eval(const std::vector<mpf_t*> & pos) = 0;
210  virtual std::string GetName() = 0;
211 };
212 
213 } // namespace highprecisionpso
214 
215 #endif /* HIGH_PRECISION_PSO_FUNCTION_FUNCTION_H_ */
int dimension_to
Highest affected dimension id.
Definition: function.h:68
This class is an abstract class. It supplies an interface for operations on vectors.
Definition: function.h:191
double upper_search_space_bound
Upper bound of the search space.
Definition: function.h:60
virtual ~Function()
The destructor.
Definition: function.h:79
double lower_search_space_bound
Lower bound of the search space.
Definition: function.h:56
This class can store information about where the bounds of the objective function are...
Definition: function.h:51
virtual ~SpecificFunction()
The destructor.
Definition: function.h:196
This class is an abstract class. It supplies the interface for objective functions.
Definition: function.h:74
int dimension_from
Lowest affected dimension id.
Definition: function.h:64
base namespace for this project.
Definition: absorption.h:45