Optimist  0.0.0
A C++ library for optimization
Loading...
Searching...
No Matches
Optimist::TestSet::Rosenbrock< Vector, N > Class Template Reference

Class container for the extended Rosenbrock function. More...

#include <Rosenbrock.hh>

Inherits Optimist::Function< Vector, Vector, Rosenbrock< Vector, N > >.

Public Types

using VectorTrait = TypeTrait<Vector>
using Scalar = typename Vector::Scalar
Public Types inherited from Optimist::FunctionBase< Vector, Vector, Rosenbrock< Vector, N > >
using InputTrait
using OutputTrait
using Scalar
using FirstDerivative
using SecondDerivative

Public Member Functions

 Rosenbrock ()
constexpr std::string name_impl () const
bool evaluate_impl (const Vector &x, Vector &out) const
bool first_derivative_impl (const Vector &x, FirstDerivative &out) const
bool second_derivative_impl (const Vector &, SecondDerivative &out) const
Public Member Functions inherited from Optimist::Function< Vector, Vector, Rosenbrock< Vector, N > >
 Function ()
constexpr std::string name () const
bool evaluate (const Vector &x, Vector &out) const
bool jacobian (const Vector &x, FirstDerivative &out) const
bool hessian (const Vector &x, SecondDerivative &out) const
Public Member Functions inherited from Optimist::FunctionBase< Vector, Vector, Rosenbrock< Vector, N > >
 FunctionBase ()
constexpr std::string name () const
bool evaluate (const Vector &x, Vector &out) const
bool first_derivative (const Vector &x, FirstDerivative &out) const
bool second_derivative (const Vector &x, SecondDerivative &out) const
constexpr Integer input_dimension () const
constexpr Integer output_dimension () const
const std::vector< Vector > & solutions () const
const std::vector< Vector > & guesses () const
const Vector & solution (const Integer i) const
const Vector & guess (const Integer i) const
bool is_solution (const Vector &x, const Scalar tol=FunctionBase::SQRT_EPSILON) const

Additional Inherited Members

Protected Attributes inherited from Optimist::FunctionBase< Vector, Vector, Rosenbrock< Vector, N > >
std::vector< Vector > m_solutions
std::vector< Vector > m_guesses

Detailed Description

template<typename Vector, Integer N>
requires (N % 2 == 0) && TypeTrait<Vector>::IsEigen && (!TypeTrait<Vector>::IsFixed || TypeTrait<Vector>::Dimension == N)
class Optimist::TestSet::Rosenbrock< Vector, N >

Class container for the extended Rosenbrock function, which defined as:

\[\mathbf{f}(\mathbf{x}) = \begin{bmatrix} 10(x_2 - x_1^2) \\ 1 - x_1 \\ 10(x_4 - x_3^2) \\ 1 - x_3 \\ \vdots \\ 10(x_N - x_{N-1}^2) \\ 1 - x_{N-1} \end{bmatrix} \text{.} \]

The function has one solution at \(\mathbf{x} = [1, \dots 1]^\top\), with \(f(\mathbf{x}) = 0\). The initial guess is \(x_i = [-1.2, 1, -1.2, 1, \dots, -1.2, 1]^\top\).

Template Parameters
VectorEigen vector type.
NInput dimension (must be even).

Member Typedef Documentation

◆ Scalar

template<typename Vector, Integer N>
using Optimist::TestSet::Rosenbrock< Vector, N >::Scalar = typename Vector::Scalar

◆ VectorTrait

template<typename Vector, Integer N>
using Optimist::TestSet::Rosenbrock< Vector, N >::VectorTrait = TypeTrait<Vector>

Constructor & Destructor Documentation

◆ Rosenbrock()

template<typename Vector, Integer N>
Optimist::TestSet::Rosenbrock< Vector, N >::Rosenbrock ( )
inline

Class constructor for the extended Rosenbrock function.

Member Function Documentation

◆ evaluate_impl()

template<typename Vector, Integer N>
bool Optimist::TestSet::Rosenbrock< Vector, N >::evaluate_impl ( const Vector & x,
Vector & out ) const
inline

Compute the function value at the input point.

Parameters
[in]xInput point.
[out]outThe function value.
Returns
The boolean flag for successful evaluation.

◆ first_derivative_impl()

template<typename Vector, Integer N>
bool Optimist::TestSet::Rosenbrock< Vector, N >::first_derivative_impl ( const Vector & x,
FirstDerivative & out ) const
inline

Compute the first derivative value at the input point.

Parameters
[in]xInput point.
[out]outThe first derivative value.
Returns
The boolean flag for successful evaluation.

◆ name_impl()

template<typename Vector, Integer N>
std::string Optimist::TestSet::Rosenbrock< Vector, N >::name_impl ( ) const
inlineconstexpr

Get the function name.

Returns
The function name.

◆ second_derivative_impl()

template<typename Vector, Integer N>
bool Optimist::TestSet::Rosenbrock< Vector, N >::second_derivative_impl ( const Vector & ,
SecondDerivative & out ) const
inline

Compute the second derivative value at the input point.

Parameters
[in]xInput point.
[out]outThe second derivative value.
Returns
The boolean flag for successful evaluation.

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