Purple::ObjectiveFunction Class Reference

Inheritance diagram for Purple::ObjectiveFunction:

Purple::DeJongFunction Purple::PlaneCylinder Purple::RastriginFunction Purple::RosenbrockFunction List of all members.

Public Member Functions

 ObjectiveFunction (void)
virtual ~ObjectiveFunction (void)
int getNumberOfVariables (void)
Vector< double > getLowerBound (void)
Vector< double > getUpperBound (void)
Matrix< double > getDomain (void)
double getEpsilon (void)
int getNumberOfEvaluations (void)
void setNumberOfVariables (int)
void setLowerBound (Vector< double >)
void setUpperBound (Vector< double >)
void setDomain (Matrix< double >)
void setEpsilon (double)
void setNumberOfEvaluations (int)
virtual double getEvaluation (Vector< double >)=0
virtual Vector< double > getGradient (Vector< double >)
double getGradientNorm (Vector< double >)
virtual Matrix< double > getHessian (Vector< double >)
virtual Matrix< double > getInverseHessian (Vector< double >)
virtual void print (Vector< double >)

Protected Member Functions

double getDeterminant (Matrix< double >)

Protected Attributes

int numberOfVariables
Vector< double > lowerBound
Vector< double > upperBound
int numberOfEvaluations
double epsilon

Detailed Description

This abstract class represents the concept of objective function. Any derived class must implement the getEvaluation(Vector<double>) method.

Definition at line 26 of file ObjectiveFunction.h.


Constructor & Destructor Documentation

Purple::ObjectiveFunction::ObjectiveFunction ( void   ) 

General constructor. It creates an objective function object. It also initializes all the rest of class members to their default values:

Definition at line 34 of file ObjectiveFunction.cpp.

Purple::ObjectiveFunction::~ObjectiveFunction ( void   )  [virtual]

Destructor.

Definition at line 46 of file ObjectiveFunction.cpp.


Member Function Documentation

double Purple::ObjectiveFunction::getDeterminant ( Matrix< double >  matrix  )  [protected]

This method returns the determinant of a Matrix.

Parameters:
matrix,: Matrix.

Definition at line 681 of file ObjectiveFunction.cpp.

int Purple::ObjectiveFunction::getNumberOfVariables ( void   ) 

This method returns the number of variables in the objective function.

Definition at line 58 of file ObjectiveFunction.cpp.

Vector< double > Purple::ObjectiveFunction::getLowerBound ( void   ) 

This method returns the lower bound of the objective function domain.

See also:
getUpperBound(void)

getDomain(void)

Definition at line 71 of file ObjectiveFunction.cpp.

Vector< double > Purple::ObjectiveFunction::getUpperBound ( void   ) 

This method returns the upper bound of the objective function domain.

See also:
getLowerBound(void)

getDomain(void)

Definition at line 83 of file ObjectiveFunction.cpp.

Matrix< double > Purple::ObjectiveFunction::getDomain ( void   ) 

This method returns the objective function domain in a single Matrix. Row 0 contains the lower bound of the domain. Row 1 contains the upper bound of the domain.

See also:
getLowerBound(void)

getUpperBound(void)

Definition at line 97 of file ObjectiveFunction.cpp.

double Purple::ObjectiveFunction::getEpsilon ( void   ) 

This method returns the epsilon value to be used for numerical differentiation.

See also:
getGradient(void)

getHessian(void)

Definition at line 119 of file ObjectiveFunction.cpp.

int Purple::ObjectiveFunction::getNumberOfEvaluations ( void   ) 

This method returns the number of calls to the getEvaluation(Vector<double>) method.

See also:
getEvaluation(Vector<double>).

Definition at line 132 of file ObjectiveFunction.cpp.

void Purple::ObjectiveFunction::setNumberOfVariables ( int  newNumberOfVariables  ) 

This method sets a new number of variables in the objective function

Parameters:
newNumberOfVariables,: New number of variables in the objective function.

Definition at line 144 of file ObjectiveFunction.cpp.

void Purple::ObjectiveFunction::setLowerBound ( Vector< double >  newLowerBound  ) 

This method sets a new lower bound in the objective function domain.

Parameters:
newLowerBound,: New lower bound in the objective function domain.
See also:
setUpperBound(Vector<double>)

setDomain(Matrix<double>)

Definition at line 184 of file ObjectiveFunction.cpp.

void Purple::ObjectiveFunction::setUpperBound ( Vector< double >  newUpperBound  ) 

This method sets a new upper bound in the objective function domain.

Parameters:
newUpperBound,: New upper bound in the objective function domain.
See also:
setLowerBound(Vector<double>)

setDomain(Matrix<double>)

Definition at line 233 of file ObjectiveFunction.cpp.

void Purple::ObjectiveFunction::setDomain ( Matrix< double >  newDomain  ) 

This method sets a new objective function domain from a single Matrix. Row 0 must contain the lower bound of the domain. Row 1 must contain the upper bound of the domain.

Parameters:
newDomain,: New objective function domain.
See also:
setLowerBound(Vector<double>)

setUpperBound(Vector<double>)

Definition at line 283 of file ObjectiveFunction.cpp.

void Purple::ObjectiveFunction::setEpsilon ( double  newEpsilon  ) 

This method sets a new epsilon value to be used for numerical differentiation.

Parameters:
newEpsilon,: New value for epsilon.
See also:
getGradient(Vector<double>)

getHessian(Vector<double>)

Definition at line 349 of file ObjectiveFunction.cpp.

void Purple::ObjectiveFunction::setNumberOfEvaluations ( int  newNumberOfEvaluations  ) 

This method sets the number of calls to the getEvaluation(Vector<double>) method to a new value.

Parameters:
newNumberOfEvaluations,: New number of calls to the getEvaluation(Vector<double>) method.
See also:
getEvaluation(Vector<double>).

Definition at line 381 of file ObjectiveFunction.cpp.

virtual double Purple::ObjectiveFunction::getEvaluation ( Vector< double >   )  [pure virtual]

This method returns the evaluation value of an objective function for a given argument.

See also:
getGradient(Vector<double>).

getHessian(Vector<double>).

Implemented in Purple::DeJongFunction, Purple::PlaneCylinder, Purple::RastriginFunction, and Purple::RosenbrockFunction.

Vector< double > Purple::ObjectiveFunction::getGradient ( Vector< double >   )  [virtual]

This method returns the objective function gradient vector for a given argument.

See also:
getEvaluation(Vector<double>).

getHessian(Vector<double>).

Reimplemented in Purple::DeJongFunction, and Purple::RastriginFunction.

Definition at line 397 of file ObjectiveFunction.cpp.

double Purple::ObjectiveFunction::getGradientNorm ( Vector< double >  gradient  ) 

This method returns the norm of the objective function gradient.

Parameters:
gradient,: Objective function gradient Vector.
See also:
getGradient(Vector<double>).

Definition at line 446 of file ObjectiveFunction.cpp.

Matrix< double > Purple::ObjectiveFunction::getHessian ( Vector< double >   )  [virtual]

This method returns the objective function Hessian matrix for a given argument.

See also:
getEvaluation(Vector<double>).

getGradient(Vector<double>).

Reimplemented in Purple::DeJongFunction, and Purple::RastriginFunction.

Definition at line 475 of file ObjectiveFunction.cpp.

Matrix< double > Purple::ObjectiveFunction::getInverseHessian ( Vector< double >   )  [virtual]

This method returns the inverse of the Hessian matrix for a given argument.

See also:
getEvaluation(Vector<double>).

getGradient(Vector<double>).

getHessian(Vector<double>).

Reimplemented in Purple::DeJongFunction, and Purple::RastriginFunction.

Definition at line 577 of file ObjectiveFunction.cpp.

void Purple::ObjectiveFunction::print ( Vector< double >   )  [virtual]

This prints to the screen any useful information of the objective function for a given argument during the optimization process.

Reimplemented in Purple::PlaneCylinder.

Definition at line 669 of file ObjectiveFunction.cpp.


Member Data Documentation

int Purple::ObjectiveFunction::numberOfVariables [protected]

Number of variables in the objective function.

Definition at line 33 of file ObjectiveFunction.h.

Vector<double> Purple::ObjectiveFunction::lowerBound [protected]

Lower bound of objective function domain.

Definition at line 37 of file ObjectiveFunction.h.

Vector<double> Purple::ObjectiveFunction::upperBound [protected]

Upper bound of objective function domain.

Definition at line 41 of file ObjectiveFunction.h.

int Purple::ObjectiveFunction::numberOfEvaluations [protected]

Number of calls to the getEvaluation(Vector<double>) method.

See also:
getEvaluation(Vector<double>).

Definition at line 47 of file ObjectiveFunction.h.

double Purple::ObjectiveFunction::epsilon [protected]

Epsilon value for numerical differentiation.

Definition at line 51 of file ObjectiveFunction.h.


Generated on Wed Jun 21 13:10:38 2006 for Purple by  doxygen 1.4.7