Playa::Rosenbrock Class Reference

#include <PlayaRosenbrock.hpp>

Inheritance diagram for Playa::Rosenbrock:

Playa::ObjectiveBase Playa::ObjectWithVerbosity

List of all members.

Public Member Functions

 Rosenbrock (int N, double alpha, const VectorType< double > &vecType)
 Constructor for the Rosenbrock function object. A user can use this constructor to make a Rosenbrock function with any choice of parameters $\alpha$ and $M$ and with a user-specified low-level vector representation, indicated by the VectorType input argument.
string description () const
 Return a short description of this object.
Implementations of the ObjectiveBase pure virtual functions


void evalGrad (const Vector< double > &x, double &f, Vector< double > &grad) const
 Evaluate the function and its gradient.
void eval (const Vector< double > &x, double &f) const
 Evaluate the function.
Vector< double > getInit () const
 Return a vector to be used as the initial guess for the optimization loop.


Detailed Description

Class Rosenbrock is an example of a user implementation of an objective function by derivation from the ObjectiveBase abstract interface.

The extended Rosenbrock function is

\[ f({\bf x}) = \sum_{m=0}^{M-1} \alpha \left(x_{2m+1}-x_{2m}^2\right)^2 + \left(x_{2m}-1\right)^2 \]

This function has a curved valley with a unique minimum at $[1,1,\cdots,1,1]^T$. The parameter $\alpha$ tunes the shape of the valley, with larger values of $\alpha$ presenting greater difficulty for numerical optimization.

This class must implement the pure virtual functions from the ObjectiveBase class. These are

Additionally, it is necessary to write a constructor that creates a Rosenbrock function with the desired values of $\alpha$ and $M$.

Definition at line 41 of file PlayaRosenbrock.hpp.


Constructor & Destructor Documentation

Playa::Rosenbrock::Rosenbrock ( int  N,
double  alpha,
const VectorType< double > &  vecType 
) [inline]

Constructor for the Rosenbrock function object. A user can use this constructor to make a Rosenbrock function with any choice of parameters $\alpha$ and $M$ and with a user-specified low-level vector representation, indicated by the VectorType input argument.

Definition at line 51 of file PlayaRosenbrock.hpp.


Member Function Documentation

void Playa::Rosenbrock::evalGrad ( const Vector< double > &  x,
double &  f,
Vector< double > &  grad 
) const [virtual]

Evaluate the function and its gradient.

Parameters:
x [in] the point at which the function is to be evaluated.
f [out] the computed value of $f(x)$
grad [out] the computed value of $\nabla f(x)$

Implements Playa::ObjectiveBase.

Definition at line 21 of file PlayaRosenbrock.cpp.

void Playa::Rosenbrock::eval ( const Vector< double > &  x,
double &  f 
) const [virtual]

Evaluate the function.

Parameters:
x [in] the point at which the function is to be evalulated
f [out] the computed value of $f(x)$

Implements Playa::ObjectiveBase.

Definition at line 10 of file PlayaRosenbrock.cpp.

Vector< double > Playa::Rosenbrock::getInit (  )  const [virtual]

Return a vector to be used as the initial guess for the optimization loop.

Implements Playa::ObjectiveBase.

Definition at line 36 of file PlayaRosenbrock.cpp.

string Playa::Rosenbrock::description (  )  const [inline, virtual]

Return a short description of this object.

Reimplemented from Playa::ObjectiveBase.

Definition at line 85 of file PlayaRosenbrock.hpp.


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

doxygen