|
Optimist
0.0.0
A C++ library for optimization
|
#include <Trid.hh>
Inherits Optimist::TestSet::DenseCostFunction< Vector, N, Trid< Vector, N > >.
Public Types | |
| using | Base = DenseCostFunction<Vector, N, Trid<Vector, N>> |
| Public Types inherited from Optimist::TestSet::DenseCostFunction< Vector, N, Trid< 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 | |
| Trid () | |
| 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, Trid< 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 |
Static Public Member Functions | |
| static constexpr Scalar | minimum () |
| Static Public Member Functions inherited from Optimist::TestSet::DenseCostFunction< Vector, N, Trid< Vector, N > > | |
| static constexpr Integer | dimension () |
Additional Inherited Members | |
| Protected Member Functions inherited from Optimist::TestSet::DenseCostFunction< Vector, N, Trid< 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, Trid< 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} (x_i - 1)^2 - \sum_{i=2}^{N} x_i x_{i-1} \text{,} \]
a strictly convex quadratic whose minimum \( f^\star = -N(N+4)(N-1)/6 \), attained at \( x_i = i(N+1-i) \), is negative. It checks that the cost function is minimized directly and not through a least-squares reformulation.
| Vector | Eigen vector type. |
| N | Problem dimension. |
| using Optimist::TestSet::Trid< Vector, N >::Base = DenseCostFunction<Vector, N, Trid<Vector, N>> |
|
inline |
Class constructor for the Trid function.
|
inline |
|
inline |
|
inlinestaticconstexpr |
Minimum value of the function.
|
inlineconstexpr |
|
inline |