|
Optimist
0.0.0
A C++ library for optimization
|
Rosenbrock's cost function in \( N \) dimensions (chained form). More...
#include <RosenbrockCost.hh>
Inherits Optimist::TestSet::DenseCostFunction< Vector, N, RosenbrockCost< Vector, N > >.
Public Types | |
| using | Base = DenseCostFunction<Vector, N, RosenbrockCost<Vector, N>> |
| Public Types inherited from Optimist::TestSet::DenseCostFunction< Vector, N, RosenbrockCost< Vector, N > > | |
| using | VectorTrait |
| using | Scalar |
| using | Dense |
| using | DenseMatrix |
| Public Types inherited from Optimist::FunctionBase< Input, Output, DerivedFunction > | |
| using | InputTrait = TypeTrait<Input> |
| using | OutputTrait = TypeTrait<Output> |
| using | Scalar = typename InputTrait::Scalar |
| using | FirstDerivative |
| using | SecondDerivative |
Public Member Functions | |
| RosenbrockCost () | |
| constexpr std::string | name_impl () const |
| Scalar | value (const Dense &x) const |
| void | gradient (const Dense &x, Dense &g) const |
| void | hessian (const Dense &x, DenseMatrix &H) const |
| Public Member Functions inherited from Optimist::TestSet::DenseCostFunction< Vector, N, RosenbrockCost< Vector, N > > | |
| bool | evaluate_impl (const Vector &x, Scalar &out) const |
| bool | first_derivative_impl (const Vector &x, FirstDerivative &out) const |
| bool | second_derivative_impl (const Vector &x, SecondDerivative &out) const |
| Public Member Functions inherited from Optimist::Function< Input, Output, DerivedFunction > | |
| Function () | |
| constexpr std::string | name () const |
| bool | evaluate (const Input &x, Output &out) const |
| bool | jacobian (const Input &x, FirstDerivative &out) const |
| bool | hessian (const Input &x, SecondDerivative &out) const |
| Public Member Functions inherited from Optimist::FunctionBase< Input, Output, DerivedFunction > | |
| FunctionBase () | |
| constexpr std::string | name () const |
| bool | evaluate (const Input &x, Output &out) const |
| bool | first_derivative (const Input &x, FirstDerivative &out) const |
| bool | second_derivative (const Input &x, SecondDerivative &out) const |
| constexpr Integer | input_dimension () const |
| constexpr Integer | output_dimension () const |
| const std::vector< Input > & | solutions () const |
| const std::vector< Input > & | guesses () const |
| const Input & | solution (const Integer i) const |
| const Input & | guess (const Integer i) const |
| bool | is_solution (const Input &x, const Scalar tol=FunctionBase::SQRT_EPSILON) const |
Additional Inherited Members | |
| Static Public Member Functions inherited from Optimist::TestSet::DenseCostFunction< Vector, N, RosenbrockCost< Vector, N > > | |
| static constexpr Integer | dimension () |
| Protected Member Functions inherited from Optimist::TestSet::DenseCostFunction< Vector, N, RosenbrockCost< Vector, N > > | |
| void | add_solution (const Dense &x) |
| void | add_guess (const Dense &x) |
| Static Protected Member Functions inherited from Optimist::TestSet::DenseCostFunction< Vector, N, RosenbrockCost< Vector, N > > | |
| static Dense | make (std::initializer_list< Scalar > values) |
| Protected Attributes inherited from Optimist::FunctionBase< Input, Output, DerivedFunction > | |
| std::vector< Input > | m_solutions |
| std::vector< Input > | m_guesses |
\[ f(\mathbf{x}) = \sum_{i=1}^{N-1} 100(x_{i+1} - x_i^2)^2 + (1 - x_i)^2 \text{,} \]
with global minimum \( f(1, \dots, 1) = 0 \) at the end of a long, narrow, curved valley. Unlike Rosenbrock, which exposes the residuals of the decoupled variant to root finders, this is the scalar cost function used to benchmark optimizers.
| Vector | Eigen vector type. |
| N | Problem dimension. |
| using Optimist::TestSet::RosenbrockCost< Vector, N >::Base = DenseCostFunction<Vector, N, RosenbrockCost<Vector, N>> |
|
inline |
Class constructor for Rosenbrock's cost function.
|
inline |
|
inline |
|
inlineconstexpr |
|
inline |