norm.h
Go to the documentation of this file.
1 
40 #ifndef HIGH_PRECISION_PSO_FUNCTION_NORM_H_
41 #define HIGH_PRECISION_PSO_FUNCTION_NORM_H_
42 
43 #include "function/function.h"
44 
45 namespace highprecisionpso {
46 
50 class Norm1: public Function {
51 public:
59  mpf_t* Eval(const std::vector<mpf_t*> & pos);
60  std::string GetName();
69  mpf_t* DistanceTo1DLocalOptimum(const std::vector<mpf_t*> & pos, int d);
70 };
71 
75 class NormInfinity: public Function {
76 public:
84  mpf_t* Eval(const std::vector<mpf_t*> & pos);
85  std::string GetName();
94  mpf_t* DistanceTo1DLocalOptimum(const std::vector<mpf_t*> & pos, int d);
95 };
96 
100 class Norm2PowerK: public Function {
101 public:
107  Norm2PowerK(int exponent);
115  mpf_t* Eval(const std::vector<mpf_t*> & pos);
116  std::string GetName();
125  mpf_t* DistanceTo1DLocalOptimum(const std::vector<mpf_t*> & pos, int d);
126 
127 private:
128  const int exponent_;
129 };
130 
134 class Norm2 : public Norm2PowerK {
135 public:
141  Norm2();
142 };
146 class Norm4 : public Norm2PowerK {
147 public:
153  Norm4();
154 };
158 class Norm8 : public Norm2PowerK {
159 public:
165  Norm8();
166 };
167 
173 class Sphere : public Norm2PowerK {
174 public:
180  Sphere();
181 };
182 
187 public:
193  Norm1Plus2PowerMinusK(int exponent);
201  mpf_t* Eval(const std::vector<mpf_t*> & pos);
202  std::string GetName();
211  mpf_t* DistanceTo1DLocalOptimum(const std::vector<mpf_t*> & pos, int d);
212 
213 private:
214  const int exponent_;
215 };
216 
217 } // namespace highprecisionpso
218 
219 #endif /* HIGH_PRECISION_PSO_FUNCTION_NORM_H_ */
This class represents a function, which calculates the 2-norm.
Definition: norm.h:134
This file contains abstract classes for function generation.
mpf_t * DistanceTo1DLocalOptimum(const std::vector< mpf_t * > &pos, int d)
Calculates for a position and a dimension the next local optimum if only the value of the position in...
This class represents a function which calculates the 2-norm (which is equivalent to the sphere funct...
Definition: norm.h:173
This class represents a function, which calculates the p-norm for all p=1+1/2exponent.
Definition: norm.h:186
This class represents a function which calculates the p-norm for all p which are powers of 2...
Definition: norm.h:100
This class represents a function, which calculates the 8-norm.
Definition: norm.h:158
This class represents a function which calculates the Manhattan norm of a vector. ...
Definition: norm.h:50
mpf_t * Eval(const std::vector< mpf_t * > &pos)
Returns the Manhattan norm of the given position.
This class represents a function which calculates the infinity norm of a vector.
Definition: norm.h:75
This class represents a function, which calculates the 4-norm.
Definition: norm.h:146
This class is an abstract class. It supplies the interface for objective functions.
Definition: function.h:74
base namespace for this project.
Definition: absorption.h:45
std::string GetName()
Returns a string representation of this object.