highprecisionpso::SingleDifferentDirection Class Reference

This class implements a function with a special direction. More...

#include <single_different_direction.h>

Inheritance diagram for highprecisionpso::SingleDifferentDirection:

Public Member Functions

 SingleDifferentDirection (double single_dimension_exponent=2.0, double remaining_dimension_exponent=2.0, SingleDifferentDirectionMode mode=SINGLE_DIFFERENT_DIRECTION_MODE_FIRST, std::vector< std::string > rng_description=std::vector< std::string >(0))
 The constructor. More...
 
 ~SingleDifferentDirection ()
 The destructor. More...
 
mpf_t * Eval (const std::vector< mpf_t * > &pos)
 Returns the evaluation of the SingleDifferentDirection at the given position. More...
 
std::string GetName ()
 Returns a string representation of this object. More...
 
- Public Member Functions inherited from highprecisionpso::Function
 Function ()
 A constructor. More...
 
 Function (double search_space_lower_bound, double search_space_upper_bound)
 A constructor, specifying the lower and upper search space bounds. More...
 
 Function (std::vector< double > search_space_lower_bound, std::vector< double > search_space_upper_bound)
 A constructor specifying the lower and upper search space bounds. More...
 
virtual ~Function ()
 The destructor. More...
 
virtual 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 the specified dimension is varied and returns the distance to it. More...
 
virtual mpf_t * DistanceTo1DLocalOptimumTernarySearch (const std::vector< mpf_t * > &pos, int d, mpf_t *start_distance)
 Calculates for a position and a dimension the next local optimum if only the value of the position in the specified dimension is varied and returns the distance to it. More...
 
mpf_t * Evaluate (const std::vector< mpf_t * > &pos)
 This is the initial function for evaluation of a position. More...
 
virtual std::vector< mpf_t * > GetLowerSearchSpaceBound ()
 Returns the lower search space bound of the search space for this objective function. More...
 
virtual std::vector< mpf_t * > GetUpperSearchSpaceBound ()
 Returns the upper search space bound of the search space for this objective function. More...
 
void InitSearchSpaceBounds ()
 Initializes the search space bounds. More...
 
void SetFunctionBound (SearchSpaceBound *search_space_bound)
 Updates the bound of the search space according to the given data. More...
 

Detailed Description

This class implements a function with a special direction.

Constructor & Destructor Documentation

highprecisionpso::SingleDifferentDirection::SingleDifferentDirection ( double  single_dimension_exponent = 2.0,
double  remaining_dimension_exponent = 2.0,
SingleDifferentDirectionMode  mode = SINGLE_DIFFERENT_DIRECTION_MODE_FIRST,
std::vector< std::string >  rng_description = std::vector< std::string >(0) 
)

The constructor.

Parameters
single_dimension_exponentThe exponent for the length in the special direction.
remaining_dimension_exponentThe exponent for the length in the remaining direction.
modeThe specification, which direction performs special.
rng_descriptionThe description of the random number generator. If the mode is not random then this vector can be empty.
highprecisionpso::SingleDifferentDirection::~SingleDifferentDirection ( )

The destructor.

Member Function Documentation

mpf_t* highprecisionpso::SingleDifferentDirection::Eval ( const std::vector< mpf_t * > &  pos)
virtual

Returns the evaluation of the SingleDifferentDirection at the given position.

Let sd be the special direction vector. See the enumeration about the single different direction mode for details on this vector. Let orth be the orthogonal projection of the position vector to the special direction vector:
orth:=( ( pos . sd ) / ( sd . sd ) ) · sd.
Let rem be the remaining part:
rem:=pos-orth.
Then the result is
( orth . orth )single_dimension_exponent + ( rem . rem )remaining_dimension_exponent.
Here ( a . b ) represents the dot product (scalar product) of the two vectors a and b.

Parameters
posThe position.
Returns
The result of the evaluation of the single different direction function.

Implements highprecisionpso::Function.

std::string highprecisionpso::SingleDifferentDirection::GetName ( )
virtual

Returns a string representation of this object.

Returns
The name of the object.

Implements highprecisionpso::Function.


The documentation for this class was generated from the following file: