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

Class container for the Booth function. More...

#include <Booth.hh>

Inherits Optimist::VectorFunction< Real, 2, 2, Booth< Real > >.

Public Types

using Vector = typename VectorFunction<Real, 2, 2, Booth<Real>>::InputVector
 
using Matrix = typename VectorFunction<Real, 2, 2, Booth<Real>>::Matrix
 
using Tensor = typename VectorFunction<Real, 2, 2, Booth<Real>>::Tensor
 
- Public Types inherited from Optimist::VectorFunction< Real, 2, 2, Booth< Real > >
using InputVector
 
using OutputVector
 
using Matrix
 
using Tensor
 
- Public Types inherited from Optimist::Function< Real, N, M, Booth< Real > >
using InputType
 
using OutputType
 
using FirstDerivativeType
 
using SecondDerivativeType
 

Public Member Functions

 Booth ()
 
std::string name_impl () const
 
void evaluate_impl (const Vector &x, Vector &out) const
 
void first_derivative_impl (const Vector &, Matrix &out) const
 
void second_derivative_impl (const Vector &, Tensor &out) const
 
- Public Member Functions inherited from Optimist::VectorFunction< Real, 2, 2, Booth< Real > >
 VectorFunction ()
 
std::string name () const
 
void evaluate (const InputVector &x, OutputVector &out) const
 
void jacobian (const InputVector &x, Matrix &out) const
 
void hessian (const InputVector &x, Tensor &out) const
 
- Public Member Functions inherited from Optimist::Function< Real, N, M, Booth< Real > >
 Function ()
 
std::string name () const
 
void evaluate (const InputType &x, OutputType &out) const
 
void first_derivative (const InputType &x, FirstDerivativeType &out) const
 
void second_derivative (const InputType &x, SecondDerivativeType &out) const
 
constexpr Integer input_dimension () const
 
constexpr Integer output_dimension () const
 
const std::vector< InputType > & solutions () const
 
const std::vector< InputType > & guesses () const
 
const InputTypesolution (const Integer i) const
 
const InputTypeguess (const Integer i) const
 
bool is_solution (const InputType &x, const Real tol=EPSILON_LOW) const
 

Additional Inherited Members

- Public Attributes inherited from Optimist::VectorFunction< Real, 2, 2, Booth< Real > >
friend Function< Real, N, M, VectorFunction< Real, N, M, DerivedFunction > >
 
- Protected Attributes inherited from Optimist::Function< Real, N, M, Booth< Real > >
std::vector< InputTypem_solutions
 
std::vector< InputTypem_guesses
 

Detailed Description

template<typename Real>
class Optimist::TestSet::Booth< Real >

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
RealScalar number type.

Member Typedef Documentation

◆ Matrix

template<typename Real>
using Optimist::TestSet::Booth< Real >::Matrix = typename VectorFunction<Real, 2, 2, Booth<Real>>::Matrix

◆ Tensor

template<typename Real>
using Optimist::TestSet::Booth< Real >::Tensor = typename VectorFunction<Real, 2, 2, Booth<Real>>::Tensor

◆ Vector

template<typename Real>
using Optimist::TestSet::Booth< Real >::Vector = typename VectorFunction<Real, 2, 2, Booth<Real>>::InputVector

< Basic constants.

Constructor & Destructor Documentation

◆ Booth()

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

Class constructor for the Booth function.

Member Function Documentation

◆ evaluate_impl()

template<typename Real>
void Optimist::TestSet::Booth< Real >::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.

◆ first_derivative_impl()

template<typename Real>
void Optimist::TestSet::Booth< Real >::first_derivative_impl ( const Vector & ,
Matrix & out ) const
inline

Compute the first derivative value at the input point.

Parameters
[in]xInput point.
[out]outThe first derivative value.

◆ name_impl()

template<typename Real>
std::string Optimist::TestSet::Booth< Real >::name_impl ( ) const
inline

Get the function name.

Returns
The function name.

◆ second_derivative_impl()

template<typename Real>
void Optimist::TestSet::Booth< Real >::second_derivative_impl ( const Vector & ,
Tensor & out ) const
inline

Compute the second derivative value at the input point.

Parameters
[in]xInput point.
[out]outThe second derivative value.

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