Optimist  0.0.0
A C++ library for optimization
Loading...
Searching...
No Matches
Optimist::TestSet::Brown< Input, Output > Class Template Reference

Class container for the Brown badly scaled function. More...

#include <Brown.hh>

Inherits Optimist::Function< Input, Output, Brown< Input, Output > >.

Public Member Functions

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

Private Types

using Scalar = typename Input::Scalar

Private Attributes

Scalar m_a

Additional Inherited Members

Public Types inherited from Optimist::FunctionBase< Input, Output, Brown< Input, Output > >
using InputTrait
using OutputTrait
using Scalar
using FirstDerivative
using SecondDerivative
Protected Attributes inherited from Optimist::FunctionBase< Input, Output, Brown< Input, Output > >
std::vector< Input > m_solutions
std::vector< Input > m_guesses

Detailed Description

template<typename Input, typename Output>
requires TypeTrait<Input>::IsEigen && TypeTrait<Output>::IsEigen && (!TypeTrait<Input>::IsFixed || TypeTrait<Input>::Dimension == 2) && (!TypeTrait<Output>::IsFixed || TypeTrait<Output>::Dimension == 3)
class Optimist::TestSet::Brown< Input, Output >

Class container for the Brown badly scaled function, which is defined as:

\[\mathbf{f}(\mathbf{x}) = \begin{bmatrix} x_1 - a \\ x_2 - 2a \\ x_1x_2 - 2 \end{bmatrix} \text{,} \]

where \(a = 10^{-6}\). The function has one solution at \(\mathbf{x} = [a, 2a]^\top\), with \(f(\mathbf{x}) = 0\). The initial guess is generated at \(\mathbf{x} = [1, 1]^\top\).

Template Parameters
InputInput vector type.
OutputOutput vector type.

Member Typedef Documentation

◆ Scalar

template<typename Input, typename Output>
using Optimist::TestSet::Brown< Input, Output >::Scalar = typename Input::Scalar
private

Constructor & Destructor Documentation

◆ Brown()

template<typename Input, typename Output>
Optimist::TestSet::Brown< Input, Output >::Brown ( )
inline

Class constructor for the Brown function.

Member Function Documentation

◆ evaluate_impl()

template<typename Input, typename Output>
bool Optimist::TestSet::Brown< Input, Output >::evaluate_impl ( const Input & x,
Output & 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 Input, typename Output>
bool Optimist::TestSet::Brown< Input, Output >::first_derivative_impl ( const Input & 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 Input, typename Output>
std::string Optimist::TestSet::Brown< Input, Output >::name_impl ( ) const
inlineconstexpr

Get the function name.

Returns
The function name.

◆ second_derivative_impl()

template<typename Input, typename Output>
bool Optimist::TestSet::Brown< Input, Output >::second_derivative_impl ( const Input & ,
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.

Member Data Documentation

◆ m_a

template<typename Input, typename Output>
Scalar Optimist::TestSet::Brown< Input, Output >::m_a
private
Initial value:
{
1.0e-6}

Scaling value (keep it low to guarantee bad scaling).


The documentation for this class was generated from the following file:
  • core/include/Optimist/TestSet/Brown.hh