golib  0.5
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
goMath::OptFunction< matrix_type, vector_type > Class Template Referenceabstract

Function interface for Newton type optimisation. More...

#include <goopt.h>

Public Types

typedef vector_type::value_type value_type
 Value of the matrix and vector types matrix_type and vector_type.
 

Public Member Functions

virtual value_type operator() (const vector_type &x)=0
 
virtual void grad (vector_type &x, vector_type &ret)
 Calculate the gradient of f at x. More...
 
virtual void hessian (vector_type &x, matrix_type &ret)
 Calculate the Hessian of f at x. More...
 

Protected Member Functions

 OptFunction (double eps=0.01)
 Constructor. More...
 

Detailed Description

template<class matrix_type, class vector_type>
class goMath::OptFunction< matrix_type, vector_type >

Function interface for Newton type optimisation.

See also
NewtonOpt, NewtonOptEq

Provides function evaluation, gradient, and Hessian computation.

Constructor & Destructor Documentation

◆ OptFunction()

template<class matrix_type, class vector_type>
goMath::OptFunction< matrix_type, vector_type >::OptFunction ( double  eps = 0.01)
inlineexplicitprotected

Constructor.

Parameters
epsEpsilon, used in numerically calculating the gradient and Hessian.

Member Function Documentation

◆ grad()

template<class matrix_type, class vector_type>
virtual void goMath::OptFunction< matrix_type, vector_type >::grad ( vector_type x,
vector_type ret 
)
inlinevirtual

Calculate the gradient of f at x.

Does a numerical approximation with forward differences. Re-implement for specialisations.

Note
x is modified during the call, but restored when the call returns.
Parameters
xPoint at which to calculate the gradient
retContains $\nabla f(x)$ on return

Reimplemented in goMath::BarrierOptFunctionPhase1< matrix_type, vector_type >, and goMath::BarrierOptFunction< matrix_type, vector_type >.

◆ hessian()

template<class matrix_type, class vector_type>
virtual void goMath::OptFunction< matrix_type, vector_type >::hessian ( vector_type x,
matrix_type &  ret 
)
inlinevirtual

Calculate the Hessian of f at x.

Does a numerical approximation with forward differences. Re-implement for specialisations.

Note
x is modified during the call, but restored when the call returns.
Parameters
xPoint at which to calculate the Hessian
retContains $H(f(x))$ on return

Reimplemented in goMath::BarrierOptFunctionPhase1< matrix_type, vector_type >.


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