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

Class container for the Booth function. More...

#include <Booth.hh>

Inherits Optimist::Function< Vector, Vector, Booth< Vector > >.

Public Types

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

Public Member Functions

 Booth ()
constexpr std::string name_impl () const
bool evaluate_impl (const Vector &x, Vector &out) const
bool first_derivative_impl (const Vector &, FirstDerivative &out) const
bool second_derivative_impl (const Vector &, SecondDerivative &out) const
Public Member Functions inherited from Optimist::Function< Vector, Vector, Booth< Vector > >
 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, Booth< Vector > >
 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, Booth< Vector > >
std::vector< Vector > m_solutions
std::vector< Vector > m_guesses

Detailed Description

template<typename Vector>
requires TypeTrait<Vector>::IsEigen && (!TypeTrait<Vector>::IsFixed || TypeTrait<Vector>::Dimension == 2)
class Optimist::TestSet::Booth< Vector >

Class container for the Booth function, which is defined as:

\[\mathbf{f}(\mathbf{x}) = \begin{bmatrix} x_1 + 2x_2 - 7 \\ 2x_1 + x_2 - 5 \end{bmatrix} \text{.} \]

The function has one solution at \(\mathbf{x} = [1, 3]^\top\), with \(f(\mathbf{x}) = 0\). The initial guesses are generated on the square \(x_i \in [-10, 10]\), for all \(x_i = 1, 2\).

Template Parameters
ScalarFloating-point number type.

Member Typedef Documentation

◆ Scalar

template<typename Vector>
using Optimist::TestSet::Booth< Vector >::Scalar = typename Vector::Scalar

◆ VectorTrait

template<typename Vector>
using Optimist::TestSet::Booth< Vector >::VectorTrait = TypeTrait<Vector>

Constructor & Destructor Documentation

◆ Booth()

template<typename Vector>
Optimist::TestSet::Booth< Vector >::Booth ( )
inline

Class constructor for the Booth function.

Member Function Documentation

◆ evaluate_impl()

template<typename Vector>
bool Optimist::TestSet::Booth< Vector >::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>
bool Optimist::TestSet::Booth< Vector >::first_derivative_impl ( const Vector & ,
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>
std::string Optimist::TestSet::Booth< Vector >::name_impl ( ) const
inlineconstexpr

Get the function name.

Returns
The function name.

◆ second_derivative_impl()

template<typename Vector>
bool Optimist::TestSet::Booth< Vector >::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:
  • core/include/Optimist/TestSet/Booth.hh