#include <PlayaRosenbrock.hpp>
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 ![]() ![]() | |
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. |
The extended Rosenbrock function is
This function has a curved valley with a unique minimum at . The parameter
tunes the shape of the valley, with larger values of
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 ofDefinition at line 41 of file PlayaRosenbrock.hpp.
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 and
and with a user-specified low-level vector representation, indicated by the VectorType input argument.
Definition at line 51 of file PlayaRosenbrock.hpp.
void Playa::Rosenbrock::evalGrad | ( | const Vector< double > & | x, | |
double & | f, | |||
Vector< double > & | grad | |||
) | const [virtual] |
Evaluate the function and its gradient.
x | [in] the point at which the function is to be evaluated. | |
f | [out] the computed value of ![]() | |
grad | [out] the computed value of ![]() |
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.
x | [in] the point at which the function is to be evalulated | |
f | [out] the computed value of ![]() |
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.