Optimist  0.0.0
A C++ library for optimization
Loading...
Searching...
No Matches
Optimist::Function< Real, N, M, DerivedFunction, ForceEigen > Class Template Reference

Class container for the vector-valued function. More...

#include <Function.hh>

Inherits Optimist::FunctionBase< Real, N, M, DerivedFunction, false >.

Public Types

using InputVector = typename FunctionBase<Real, N, M, DerivedFunction, ForceEigen>::InputType
using OutputVector = typename FunctionBase<Real, N, M, DerivedFunction, ForceEigen>::OutputType
using Matrix = typename FunctionBase<Real, N, M, DerivedFunction, ForceEigen>::FirstDerivativeType
using Tensor = typename FunctionBase<Real, N, M, DerivedFunction, ForceEigen>::SecondDerivativeType
Public Types inherited from Optimist::FunctionBase< Real, N, M, DerivedFunction, false >
using InputType
using OutputType
using FirstDerivativeType
using SecondDerivativeType

Public Member Functions

 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, DerivedFunction, 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

Friends

class FunctionBase< Real, N, M, Function< Real, N, M, DerivedFunction, ForceEigen > >

Additional Inherited Members

Protected Attributes inherited from Optimist::FunctionBase< Real, N, M, DerivedFunction, false >
std::vector< InputTypem_solutions
std::vector< InputTypem_guesses

Detailed Description

template<typename Real, Integer N, Integer M, typename DerivedFunction, bool ForceEigen = false>
class Optimist::Function< Real, N, M, DerivedFunction, ForceEigen >
Template Parameters
NThe input dimension of the vector-valued function.
MThe output dimension of the vector-valued function.
DerivedFunctionDerived vector-valued function class.
ForceEigenForce the use of Eigen types for input and output.

Member Typedef Documentation

◆ InputVector

template<typename Real, Integer N, Integer M, typename DerivedFunction, bool ForceEigen = false>
using Optimist::Function< Real, N, M, DerivedFunction, ForceEigen >::InputVector = typename FunctionBase<Real, N, M, DerivedFunction, ForceEigen>::InputType

Input vector type.

◆ Matrix

template<typename Real, Integer N, Integer M, typename DerivedFunction, bool ForceEigen = false>
using Optimist::Function< Real, N, M, DerivedFunction, ForceEigen >::Matrix = typename FunctionBase<Real, N, M, DerivedFunction, ForceEigen>::FirstDerivativeType

Jacobian matrix type.

◆ OutputVector

template<typename Real, Integer N, Integer M, typename DerivedFunction, bool ForceEigen = false>
using Optimist::Function< Real, N, M, DerivedFunction, ForceEigen >::OutputVector = typename FunctionBase<Real, N, M, DerivedFunction, ForceEigen>::OutputType

Output vector type.

◆ Tensor

template<typename Real, Integer N, Integer M, typename DerivedFunction, bool ForceEigen = false>
using Optimist::Function< Real, N, M, DerivedFunction, ForceEigen >::Tensor = typename FunctionBase<Real, N, M, DerivedFunction, ForceEigen>::SecondDerivativeType

Hessian tensor type.

Constructor & Destructor Documentation

◆ Function()

template<typename Real, Integer N, Integer M, typename DerivedFunction, bool ForceEigen = false>
Optimist::Function< Real, N, M, DerivedFunction, ForceEigen >::Function ( )
inline

Class constructor for the vector-valued function.

Member Function Documentation

◆ evaluate()

template<typename Real, Integer N, Integer M, typename DerivedFunction, bool ForceEigen = false>
void Optimist::Function< Real, N, M, DerivedFunction, ForceEigen >::evaluate ( const InputVector & x,
OutputVector & out ) const
inline

Compute the function value at the input point.

Parameters
[in]xInput point.
[out]outThe function value.

◆ hessian()

template<typename Real, Integer N, Integer M, typename DerivedFunction, bool ForceEigen = false>
void Optimist::Function< Real, N, M, DerivedFunction, ForceEigen >::hessian ( const InputVector & x,
Tensor & out ) const
inline

Compute the function second derivative at the input point.

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

◆ jacobian()

template<typename Real, Integer N, Integer M, typename DerivedFunction, bool ForceEigen = false>
void Optimist::Function< Real, N, M, DerivedFunction, ForceEigen >::jacobian ( const InputVector & x,
Matrix & out ) const
inline

Compute the function first derivative at the input point.

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

◆ name()

template<typename Real, Integer N, Integer M, typename DerivedFunction, bool ForceEigen = false>
std::string Optimist::Function< Real, N, M, DerivedFunction, ForceEigen >::name ( ) const
inline

Get the function name.

Returns
The function name.

◆ FunctionBase< Real, N, M, Function< Real, N, M, DerivedFunction, ForceEigen > >

template<typename Real, Integer N, Integer M, typename DerivedFunction, bool ForceEigen = false>
friend class FunctionBase< Real, N, M, Function< Real, N, M, DerivedFunction, ForceEigen > >
friend

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