Optimist  0.0.0
A C++ library for optimization
Loading...
Searching...
No Matches
Optimist::TestSet::DenseSystemFunction< Vector, N, Derived, OutVector, M > Class Template Reference

Helper base class for nonlinear systems \( \mathbf{F} : \mathbb{R}^N \to \mathbb{R}^M \) written once in terms of dense vectors (square by default). More...

#include <DenseFunction.hh>

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

Public Types

using VectorTrait = TypeTrait<Vector>
using Scalar = typename Vector::Scalar
using Dense = Utils::DenseVector<Vector>
using DenseMatrix = Utils::DenseMatrix<Vector>
Public Types inherited from Optimist::FunctionBase< Vector, Vector, Derived >
using InputTrait
using OutputTrait
using Scalar
using FirstDerivative
using SecondDerivative

Public Member Functions

bool evaluate_impl (const Vector &x, OutVector &out) const
bool first_derivative_impl (const Vector &x, FirstDerivative &out) const
bool second_derivative_impl (const Vector &x, SecondDerivative &out) const
Public Member Functions inherited from Optimist::Function< Vector, Vector, Derived >
 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, Derived >
 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

Static Public Member Functions

static constexpr Integer dimension ()
static constexpr Integer equations ()

Protected Member Functions

void add_solution (const Dense &x)
void add_guess (const Dense &x)

Static Protected Member Functions

static Dense make (std::initializer_list< Scalar > values)

Private Member Functions

const Derived & derived () const

Additional Inherited Members

Protected Attributes inherited from Optimist::FunctionBase< Vector, Vector, Derived >
std::vector< Vector > m_solutions
std::vector< Vector > m_guesses

Detailed Description

template<typename Vector, Integer N, typename Derived, typename OutVector = Vector, Integer M = N>
requires TypeTrait<Vector>::IsEigen && TypeTrait<OutVector>::IsEigen && (!TypeTrait<Vector>::IsFixed || TypeTrait<Vector>::Dimension == N) && (!TypeTrait<OutVector>::IsFixed || TypeTrait<OutVector>::Dimension == M)
class Optimist::TestSet::DenseSystemFunction< Vector, N, Derived, OutVector, M >

The derived class implements

  • void residual(const Dense &x, Dense &F) const,
  • void jacobian(const Dense &x, DenseMatrix &J) const,
  • void hessian(const Dense &x, Integer i, DenseMatrix &H) const, the Hessian of the \( i \)-th component.
Template Parameters
VectorEigen input vector type.
NNumber of unknowns.
DerivedDerived function class.
OutVectorEigen output vector type.
MNumber of equations.

Member Typedef Documentation

◆ Dense

template<typename Vector, Integer N, typename Derived, typename OutVector = Vector, Integer M = N>
using Optimist::TestSet::DenseSystemFunction< Vector, N, Derived, OutVector, M >::Dense = Utils::DenseVector<Vector>

◆ DenseMatrix

template<typename Vector, Integer N, typename Derived, typename OutVector = Vector, Integer M = N>
using Optimist::TestSet::DenseSystemFunction< Vector, N, Derived, OutVector, M >::DenseMatrix = Utils::DenseMatrix<Vector>

◆ Scalar

template<typename Vector, Integer N, typename Derived, typename OutVector = Vector, Integer M = N>
using Optimist::TestSet::DenseSystemFunction< Vector, N, Derived, OutVector, M >::Scalar = typename Vector::Scalar

◆ VectorTrait

template<typename Vector, Integer N, typename Derived, typename OutVector = Vector, Integer M = N>
using Optimist::TestSet::DenseSystemFunction< Vector, N, Derived, OutVector, M >::VectorTrait = TypeTrait<Vector>

Member Function Documentation

◆ add_guess()

template<typename Vector, Integer N, typename Derived, typename OutVector = Vector, Integer M = N>
void Optimist::TestSet::DenseSystemFunction< Vector, N, Derived, OutVector, M >::add_guess ( const Dense & x)
inlineprotected

Add a suggested initial guess given its dense coefficients.

◆ add_solution()

template<typename Vector, Integer N, typename Derived, typename OutVector = Vector, Integer M = N>
void Optimist::TestSet::DenseSystemFunction< Vector, N, Derived, OutVector, M >::add_solution ( const Dense & x)
inlineprotected

Add a known solution given its dense coefficients.

◆ derived()

template<typename Vector, Integer N, typename Derived, typename OutVector = Vector, Integer M = N>
const Derived & Optimist::TestSet::DenseSystemFunction< Vector, N, Derived, OutVector, M >::derived ( ) const
inlineprivate

◆ dimension()

template<typename Vector, Integer N, typename Derived, typename OutVector = Vector, Integer M = N>
constexpr Integer Optimist::TestSet::DenseSystemFunction< Vector, N, Derived, OutVector, M >::dimension ( )
inlinestaticconstexpr

Number of unknowns.

◆ equations()

template<typename Vector, Integer N, typename Derived, typename OutVector = Vector, Integer M = N>
constexpr Integer Optimist::TestSet::DenseSystemFunction< Vector, N, Derived, OutVector, M >::equations ( )
inlinestaticconstexpr

Number of equations.

◆ evaluate_impl()

template<typename Vector, Integer N, typename Derived, typename OutVector = Vector, Integer M = N>
bool Optimist::TestSet::DenseSystemFunction< Vector, N, Derived, OutVector, M >::evaluate_impl ( const Vector & x,
OutVector & out ) const
inline

Evaluate the system residual.

◆ first_derivative_impl()

template<typename Vector, Integer N, typename Derived, typename OutVector = Vector, Integer M = N>
bool Optimist::TestSet::DenseSystemFunction< Vector, N, Derived, OutVector, M >::first_derivative_impl ( const Vector & x,
FirstDerivative & out ) const
inline

Evaluate the system Jacobian.

◆ make()

template<typename Vector, Integer N, typename Derived, typename OutVector = Vector, Integer M = N>
Dense Optimist::TestSet::DenseSystemFunction< Vector, N, Derived, OutVector, M >::make ( std::initializer_list< Scalar > values)
inlinestaticprotected

Build a dense vector from a list of coefficients.

◆ second_derivative_impl()

template<typename Vector, Integer N, typename Derived, typename OutVector = Vector, Integer M = N>
bool Optimist::TestSet::DenseSystemFunction< Vector, N, Derived, OutVector, M >::second_derivative_impl ( const Vector & x,
SecondDerivative & out ) const
inline

Evaluate the Hessians of the system components.


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