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

Class container for the cosine function. More...

#include <Cos.hh>

Inherits Optimist::Function< Real, 1, 1, Cos< Real > >.

Public Member Functions

 Cos ()
std::string name_impl () const
void evaluate_impl (Real x, Real &out) const
void first_derivative_impl (Real x, Real &out) const
void second_derivative_impl (Real x, Real &out) const
Public Member Functions inherited from Optimist::Function< Real, 1, 1, Cos< Real > >
 Function ()
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::FunctionBase< Real, N, M, Cos< Real >, false >
 FunctionBase ()
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 Types inherited from Optimist::Function< Real, 1, 1, Cos< Real > >
using InputVector
using OutputVector
using Matrix
using Tensor
Public Types inherited from Optimist::FunctionBase< Real, N, M, Cos< Real >, false >
using InputType
using OutputType
using FirstDerivativeType
using SecondDerivativeType
Protected Attributes inherited from Optimist::FunctionBase< Real, N, M, Cos< Real >, false >
std::vector< InputTypem_solutions
std::vector< InputTypem_guesses

Detailed Description

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

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

\[f(x) = \cos(x) \text{.} \]

The function has roots at \(x = i\pi\), with \(f(x) = 0\), and minima at \(x = -\pi + 2i\pi\), with \(f(x) = -1\) and \(i = 0, 1, \ldots, n\). The initial guesses are generated on the range \(x \in \left[-\pi, \pi\right]\).

Template Parameters
RealScalar number type.

Constructor & Destructor Documentation

◆ Cos()

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

< Basic constants. Class constructor for the cosine function.

Member Function Documentation

◆ evaluate_impl()

template<typename Real>
void Optimist::TestSet::Cos< Real >::evaluate_impl ( Real x,
Real & 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::Cos< Real >::first_derivative_impl ( Real x,
Real & 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::Cos< Real >::name_impl ( ) const
inline

Get the function name.

Returns
The function name.

◆ second_derivative_impl()

template<typename Real>
void Optimist::TestSet::Cos< Real >::second_derivative_impl ( Real x,
Real & 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:
  • include/Optimist/TestSet/Cos.hh