NumericalDifferentiation Class Reference

#include <numerical_differentiation.h>

Public Member Functions

 NumericalDifferentiation ()
 
virtual ~NumericalDifferentiation ()
 Destructor. More...
 
const Index & get_precision_digits () const
 Enumeration of available methods for numerical differentiation. More...
 
const bool & get_display () const
 Returns the flag used by this class for displaying or not displaying warnings. More...
 
void set (const NumericalDifferentiation &)
 
void set_precision_digits (const Index &)
 
void set_display (const bool &)
 
void set_default ()
 
type calculate_eta () const
 
type calculate_h (const type &) const
 
Tensor< type, 1 > calculate_h (const Tensor< type, 1 > &) const
 
Tensor< type, 2 > calculate_h (const Tensor< type, 2 > &) const
 
Tensor< type, 4 > calculate_h (const Tensor< type, 4 > &) const
 
template<class T >
type calculate_derivatives (const T &t, type(T::*f)(const type &) const, const type &x) const
 
template<class T >
Tensor< type, 1 > calculate_derivatives (const T &t, Tensor< type, 1 >(T::*f)(const Tensor< type, 1 > &) const, const Tensor< type, 1 > &x) const
 
template<class T >
Tensor< type, 2 > calculate_derivatives (const T &t, Tensor< type, 2 >(T::*f)(const Tensor< type, 2 > &) const, const Tensor< type, 2 > &x) const
 
template<class T >
Tensor< type, 4 > calculate_derivatives (const T &t, Tensor< type, 4 >(T::*f)(const Tensor< type, 4 > &) const, const Tensor< type, 4 > &x) const
 
template<class T >
Tensor< type, 1 > calculate_derivatives (const T &t, Tensor< type, 1 >(T::*f)(const Index &, const Tensor< type, 1 > &) const, const Index &dummy, const Tensor< type, 1 > &x) const
 
template<class T >
Tensor< type, 2 > calculate_derivatives (const T &t, void(T::*f)(const Tensor< type, 2 > &, Tensor< type, 2 > &) const, const Index &dummy, const Tensor< type, 2 > &x) const
 
template<class T >
Tensor< type, 4 > calculate_derivatives (const T &t, void(T::*f)(const Tensor< type, 4 > &, Tensor< type, 4 > &) const, const Index &dummy, const Tensor< type, 4 > &x) const
 
template<class T >
type calculate_second_derivatives (const T &t, type(T::*f)(const type &) const, const type &x) const
 
template<class T >
Tensor< type, 1 > calculate_second_derivatives (const T &t, Tensor< type, 1 >(T::*f)(const Tensor< type, 1 > &) const, const Tensor< type, 1 > &x) const
 
template<class T >
Tensor< type, 1 > calculate_second_derivatives (const T &t, Tensor< type, 1 >(T::*f)(const Index &, const Tensor< type, 1 > &) const, const Index &dummy, const Tensor< type, 1 > &x) const
 
template<class T >
Tensor< type, 1 > calculate_gradient (const T &t, type(T::*f)(const Tensor< type, 1 > &) const, const Tensor< type, 1 > &x) const
 
template<class T >
Tensor< type, 1 > calculate_gradient (const T &t, type(T::*f)(const Tensor< type, 1 > &), const Tensor< type, 1 > &x) const
 
template<class T >
Tensor< type, 1 > calculate_gradient (const T &t, type(T::*f)(const Tensor< type, 1 > &, const Tensor< type, 1 > &) const, const Tensor< type, 1 > &dummy, const Tensor< type, 1 > &x) const
 
template<class T >
Tensor< type, 1 > calculate_gradient (const T &t, type(T::*f)(const Index &, const Tensor< type, 1 > &) const, const Index &dummy, const Tensor< type, 1 > &x) const
 
template<class T >
Tensor< type, 1 > calculate_gradient (const T &t, Tensor< type, 1 >(T::*f)(const Index &, const Tensor< type, 2 > &) const, const Index &dummy, const Tensor< type, 2 > &x) const
 
template<class T >
Tensor< type, 1 > calculate_gradient (const T &t, type(T::*f)(const Tensor< Index, 1 > &, const Tensor< type, 1 > &) const, const Tensor< Index, 1 > &dummy, const Tensor< type, 1 > &x) const
 
template<class T >
Tensor< type, 2 > calculate_gradient_matrix (const T &t, Tensor< type, 1 >(T::*f)(const Index &, const Tensor< type, 2 > &) const, const Index &integer, const Tensor< type, 2 > &x) const
 
template<class T >
Tensor< type, 2 > calculate_hessian (const T &t, type(T::*f)(const Tensor< type, 1 > &) const, const Tensor< type, 1 > &x) const
 
template<class T >
Tensor< type, 2 > calculate_hessian (const T &t, type(T::*f)(const Tensor< type, 1 > &, const Tensor< type, 1 > &) const, const Tensor< type, 1 > &dummy, const Tensor< type, 1 > &x) const
 
template<class T >
Tensor< type, 2 > calculate_hessian (const T &t, type(T::*f)(const Index &, const Tensor< type, 1 > &) const, const Index &dummy, const Tensor< type, 1 > &x) const
 
template<class T >
Tensor< type, 2 > calculate_Jacobian (const T &t, Tensor< type, 1 >(T::*f)(const Tensor< type, 1 > &) const, const Tensor< type, 1 > &x) const
 
template<class T >
Tensor< type, 2 > calculate_Jacobian (const T &t, Tensor< type, 1 >(T::*f)(const Tensor< type, 1 > &, const Tensor< type, 1 > &) const, const Tensor< type, 1 > &dummy, const Tensor< type, 1 > &x) const
 
template<class T >
Tensor< type, 2 > calculate_Jacobian (const T &t, Tensor< type, 1 >(T::*f)(const Index &, const Tensor< type, 1 > &) const, const Index &dummy, const Tensor< type, 1 > &x) const
 
template<class T >
Tensor< type, 2 > calculate_Jacobian (const T &t, Tensor< type, 1 >(T::*f)(const Index &, const Tensor< type, 1 > &, const Tensor< type, 1 > &) const, const Index &dummy_int, const Tensor< type, 1 > &dummy_vector, const Tensor< type, 1 > &x) const
 
template<class T >
Tensor< type, 2 > calculate_Jacobian (const T &t, Tensor< type, 1 >(T::*f)(const Index &, const Index &, const Tensor< type, 1 > &) const, const Index &dummy_int_1, const Index &dummy_int_2, const Tensor< type, 1 > &x) const
 
template<class T >
Tensor< Tensor< type, 2 >, 1 > calculate_hessian (const T &t, Tensor< type, 1 >(T::*f)(const Tensor< type, 1 > &) const, const Tensor< type, 1 > &x) const
 
template<class T >
Tensor< Tensor< type, 2 >, 1 > calculate_hessian (const T &t, Tensor< type, 1 >(T::*f)(const Tensor< type, 1 > &, const Tensor< type, 1 > &) const, const Tensor< type, 1 > &dummy_vector, const Tensor< type, 1 > &x) const
 
template<class T >
Tensor< Tensor< type, 2 >, 1 > calculate_hessian (const T &t, Tensor< type, 1 >(T::*f)(const Index &, const Tensor< type, 1 > &) const, const Index &dummy, const Tensor< type, 1 > &x) const
 
template<class T >
Tensor< Tensor< type, 2 >, 1 > calculate_hessian (const T &t, Tensor< type, 1 >(T::*f)(const Index &, const Tensor< type, 1 > &, const Tensor< type, 1 > &) const, const Index &dummy_int, const Tensor< type, 1 > &dummy_vector, const Tensor< type, 1 > &x) const
 
template<class T >
Tensor< Tensor< type, 2 >, 2 > calculate_hessian_matrices (const T &t, Tensor< type, 1 >(T::*f)(const Index &, const Tensor< type, 1 > &, const Tensor< type, 1 > &) const, const Index &dummy_int, const Tensor< type, 1 > &dummy_vector, const Tensor< type, 1 > &x) const
 

Private Attributes

Index precision_digits
 Number of precision digits. More...
 
bool display = true
 Flag for displaying warning messages from this class. More...
 

Detailed Description

This class contains methods for numerical differentiation of functions. In particular it implements the forward and central differences methods for derivatives, Jacobians, hessians or hessian forms.

Definition at line 33 of file numerical_differentiation.h.

Constructor & Destructor Documentation

◆ NumericalDifferentiation()

Default constructor. It creates a numerical differentiation object with the default members.

Definition at line 17 of file numerical_differentiation.cpp.

◆ ~NumericalDifferentiation()

Destructor.

Definition at line 25 of file numerical_differentiation.cpp.

Member Function Documentation

◆ calculate_derivatives() [1/7]

Tensor< type, 1 > calculate_derivatives ( const T &  t,
Tensor< type, 1 >(T::*)(const Index &, const Tensor< type, 1 > &) const  f,
const Index &  dummy,
const Tensor< type, 1 > &  x 
) const
inline

Returns the derivatives of a vector function using the central differences method. The function to be differentiated is of the following form: Tensor<type, 1> f(const Index&, const Tensor<type, 1>&) const.

Parameters
t: Object constructor containing the member method to differentiate.
fPointer to the member method.
dummyDummy integer for the method prototype.
xInput vector.

Definition at line 153 of file numerical_differentiation.h.

◆ calculate_derivatives() [2/7]

Tensor< type, 1 > calculate_derivatives ( const T &  t,
Tensor< type, 1 >(T::*)(const Tensor< type, 1 > &) const  f,
const Tensor< type, 1 > &  x 
) const
inline

Returns the derivatives of a vector function using the central differences method.

Parameters
t: Object constructor containing the member method to differentiate.
fPointer to the member method.
xInput vector.

Definition at line 88 of file numerical_differentiation.h.

◆ calculate_derivatives() [3/7]

Tensor< type, 2 > calculate_derivatives ( const T &  t,
Tensor< type, 2 >(T::*)(const Tensor< type, 2 > &) const  f,
const Tensor< type, 2 > &  x 
) const
inline

Definition at line 108 of file numerical_differentiation.h.

◆ calculate_derivatives() [4/7]

Tensor< type, 4 > calculate_derivatives ( const T &  t,
Tensor< type, 4 >(T::*)(const Tensor< type, 4 > &) const  f,
const Tensor< type, 4 > &  x 
) const
inline

Definition at line 127 of file numerical_differentiation.h.

◆ calculate_derivatives() [5/7]

type calculate_derivatives ( const T &  t,
type(T::*)(const type &) const  f,
const type &  x 
) const
inline

Definition at line 68 of file numerical_differentiation.h.

◆ calculate_derivatives() [6/7]

Tensor< type, 2 > calculate_derivatives ( const T &  t,
void(T::*)(const Tensor< type, 2 > &, Tensor< type, 2 > &) const  f,
const Index &  dummy,
const Tensor< type, 2 > &  x 
) const
inline

Definition at line 170 of file numerical_differentiation.h.

◆ calculate_derivatives() [7/7]

Tensor< type, 4 > calculate_derivatives ( const T &  t,
void(T::*)(const Tensor< type, 4 > &, Tensor< type, 4 > &) const  f,
const Index &  dummy,
const Tensor< type, 4 > &  x 
) const
inline

Definition at line 192 of file numerical_differentiation.h.

◆ calculate_eta()

type calculate_eta ( ) const

Definition at line 78 of file numerical_differentiation.cpp.

◆ calculate_gradient() [1/6]

Tensor< type, 1 > calculate_gradient ( const T &  t,
Tensor< type, 1 >(T::*)(const Index &, const Tensor< type, 2 > &) const  f,
const Index &  dummy,
const Tensor< type, 2 > &  x 
) const
inline

Returns the gradient of a function of several dimensions using the central differences method. The function to be differentiated is of the following form: type f(const Index&, const Tensor<type, 1>&) const. The first integer argument is used for the function definition, differentiation is performed with respect to the second vector argument.

Parameters
t: Object constructor containing the member method to differentiate.
fPointer to the member method.
dummyDummy integer for the method prototype.
xInput vector.

Definition at line 483 of file numerical_differentiation.h.

◆ calculate_gradient() [2/6]

Tensor< type, 1 > calculate_gradient ( const T &  t,
type(T::*)(const Index &, const Tensor< type, 1 > &) const  f,
const Index &  dummy,
const Tensor< type, 1 > &  x 
) const
inline

Returns the gradient of a function of several dimensions using the central differences method. The function to be differentiated is of the following form: type f(const Index&, const Tensor<type, 1>&) const. The first integer argument is used for the function definition, differentiation is performed with respect to the second vector argument.

Parameters
t: Object constructor containing the member method to differentiate.
fPointer to the member method.
dummyDummy integer for the method prototype.
xInput vector.

Definition at line 441 of file numerical_differentiation.h.

◆ calculate_gradient() [3/6]

Tensor< type, 1 > calculate_gradient ( const T &  t,
type(T::*)(const Tensor< Index, 1 > &, const Tensor< type, 1 > &) const  f,
const Tensor< Index, 1 > &  dummy,
const Tensor< type, 1 > &  x 
) const
inline

Returns the gradient of a function of several dimensions using the central differences method. The function to be differentiated is of the following form: type f(const Index&, const Tensor<type, 1>&) const. The first integer argument is used for the function definition, differentiation is performed with respect to the second vector argument.

Parameters
t: Object constructor containing the member method to differentiate.
fPointer to the member method.
dummyDummy integer for the method prototype.
xInput vector.

Definition at line 525 of file numerical_differentiation.h.

◆ calculate_gradient() [4/6]

Tensor< type, 1 > calculate_gradient ( const T &  t,
type(T::*)(const Tensor< type, 1 > &) const  f,
const Tensor< type, 1 > &  x 
) const
inline

Returns the gradient of a function of several dimensions using the central differences method. The function to be differentiated is of the following form: type f(const Tensor<type, 1>&) const.

Parameters
t: Object constructor containing the member method to differentiate.
fPointer to the member method.
xInput vector.

Definition at line 316 of file numerical_differentiation.h.

◆ calculate_gradient() [5/6]

Tensor< type, 1 > calculate_gradient ( const T &  t,
type(T::*)(const Tensor< type, 1 > &)  f,
const Tensor< type, 1 > &  x 
) const
inline

Returns the gradient of a function of several dimensions using the central differences method. The function to be differentiated is of the following form: type f(const Tensor<type, 1>&) const.

Parameters
t: Object constructor containing the member method to differentiate.
fPointer to the member method.
xInput vector.

Definition at line 359 of file numerical_differentiation.h.

◆ calculate_gradient() [6/6]

Tensor< type, 1 > calculate_gradient ( const T &  t,
type(T::*)(const Tensor< type, 1 > &, const Tensor< type, 1 > &) const  f,
const Tensor< type, 1 > &  dummy,
const Tensor< type, 1 > &  x 
) const
inline

Returns the gradient of a function of several dimensions using the central differences method. The function to be differentiated is of the following form: type f(const Tensor<type, 1>&, const Tensor<type, 1>&) const. The first vector argument is dummy, differentiation is performed with respect to the second vector argument.

Parameters
t: Object constructor containing the member method to differentiate.
fPointer to the member method.
dummyDummy vector for the method prototype.
xInput vector.

Definition at line 400 of file numerical_differentiation.h.

◆ calculate_gradient_matrix()

Tensor< type, 2 > calculate_gradient_matrix ( const T &  t,
Tensor< type, 1 >(T::*)(const Index &, const Tensor< type, 2 > &) const  f,
const Index &  integer,
const Tensor< type, 2 > &  x 
) const
inline

Definition at line 558 of file numerical_differentiation.h.

◆ calculate_h() [1/4]

Tensor< type, 1 > calculate_h ( const Tensor< type, 1 > &  x) const

Calculates a vector of step sizes for computing the derivatives, as a function of a vector of inputs.

Parameters
xInput vector.

Definition at line 98 of file numerical_differentiation.cpp.

◆ calculate_h() [2/4]

Tensor< type, 2 > calculate_h ( const Tensor< type, 2 > &  x) const

Calculates a tensor of step sizes for computing the derivatives, as a function of a vector of inputs.

Parameters
xInput tensor.

Definition at line 118 of file numerical_differentiation.cpp.

◆ calculate_h() [3/4]

Tensor< type, 4 > calculate_h ( const Tensor< type, 4 > &  x) const

Definition at line 139 of file numerical_differentiation.cpp.

◆ calculate_h() [4/4]

type calculate_h ( const type &  x) const

Calculates a proper step size for computing the derivatives, as a function of the inputs point value.

Parameters
xInput value.

Definition at line 87 of file numerical_differentiation.cpp.

◆ calculate_hessian() [1/7]

Tensor< Tensor< type, 2 >, 1 > calculate_hessian ( const T &  t,
Tensor< type, 1 >(T::*)(const Index &, const Tensor< type, 1 > &) const  f,
const Index &  dummy,
const Tensor< type, 1 > &  x 
) const
inline

Returns the hessian form, as a vector of matrices, of a function of many inputs and many outputs using the central differences method. The function to be differentiated is of the following form: Tensor<type, 1> f(const Index&, const Tensor<type, 1>&) const. The first argument is dummy, differentiation is performed with respect to the second argument.

Parameters
t: Object constructor containing the member method to differentiate.
fPointer to the member method.
dummyDummy integer for the method prototype.
xInput vector.

Definition at line 1397 of file numerical_differentiation.h.

◆ calculate_hessian() [2/7]

Tensor< Tensor< type, 2 >, 1 > calculate_hessian ( const T &  t,
Tensor< type, 1 >(T::*)(const Index &, const Tensor< type, 1 > &, const Tensor< type, 1 > &) const  f,
const Index &  dummy_int,
const Tensor< type, 1 > &  dummy_vector,
const Tensor< type, 1 > &  x 
) const
inline

Returns the hessian form, as a vector of matrices, of a function of many inputs and many outputs using the central differences method. The function to be differentiated is of the following form: Tensor<type, 1> f(const Index&, const Tensor<type, 1>&, const Tensor<type, 1>&) const. The first and second arguments are dummy, differentiation is performed with respect to the third argument.

Parameters
t: Object constructor containing the member method to differentiate.
fPointer to the member method.
dummy_intDummy integer for the method prototype.
dummy_vectorDummy vector for the method prototype.
xInput vector.

Definition at line 1513 of file numerical_differentiation.h.

◆ calculate_hessian() [3/7]

Tensor< Tensor< type, 2 >, 1 > calculate_hessian ( const T &  t,
Tensor< type, 1 >(T::*)(const Tensor< type, 1 > &) const  f,
const Tensor< type, 1 > &  x 
) const
inline

Returns the hessian form, as a vector of matrices, of a function of many inputs and many outputs using the central differences method. The function to be differentiated is of the following form: Tensor<type, 1> f(const Tensor<type, 1>&) const.

Parameters
t: Object constructor containing the member method to differentiate.
fPointer to the member method.
xInput vector.

Definition at line 1164 of file numerical_differentiation.h.

◆ calculate_hessian() [4/7]

Tensor< Tensor< type, 2 >, 1 > calculate_hessian ( const T &  t,
Tensor< type, 1 >(T::*)(const Tensor< type, 1 > &, const Tensor< type, 1 > &) const  f,
const Tensor< type, 1 > &  dummy_vector,
const Tensor< type, 1 > &  x 
) const
inline

Returns the hessian form, as a vector of matrices, of a function of many inputs and many outputs using the central differences method. The function to be differentiated is of the following form: Tensor<type, 1> f(const Index&, const Tensor<type, 1>&, const Tensor<type, 1>&) const. The first and second arguments are dummy, differentiation is performed with respect to the third argument.

Parameters
t: Object constructor containing the member method to differentiate.
fPointer to the member method.
dummy_vectorDummy vector for the method prototype.
xInput vector.

Definition at line 1280 of file numerical_differentiation.h.

◆ calculate_hessian() [5/7]

Tensor< type, 2 > calculate_hessian ( const T &  t,
type(T::*)(const Index &, const Tensor< type, 1 > &) const  f,
const Index &  dummy,
const Tensor< type, 1 > &  x 
) const
inline

Returns the hessian matrix of a function of several dimensions using the central differences method. The function to be differentiated is of the following form: type f(const Index&, const Tensor<type, 1>&) const. The first integer argument is dummy, differentiation is performed with respect to the second vector argument.

Parameters
t: Object constructor containing the member method to differentiate.
fPointer to the member method.
dummyDummy integer for the method prototype.
xInput vector.

Definition at line 820 of file numerical_differentiation.h.

◆ calculate_hessian() [6/7]

Tensor< type, 2 > calculate_hessian ( const T &  t,
type(T::*)(const Tensor< type, 1 > &) const  f,
const Tensor< type, 1 > &  x 
) const
inline

Returns the hessian matrix of a function of several dimensions using the central differences method. The function to be differentiated is of the following form: type f(const Tensor<type, 1>&) const.

Parameters
t: Object constructor containing the member method to differentiate.
fPointer to the member method.
xInput vector.

Definition at line 601 of file numerical_differentiation.h.

◆ calculate_hessian() [7/7]

Tensor< type, 2 > calculate_hessian ( const T &  t,
type(T::*)(const Tensor< type, 1 > &, const Tensor< type, 1 > &) const  f,
const Tensor< type, 1 > &  dummy,
const Tensor< type, 1 > &  x 
) const
inline

Returns the hessian matrix of a function of several dimensions using the central differences method. The function to be differentiated is of the following form: type f(const Tensor<type, 1>&, const Tensor<type, 1>&) const. The first vector argument is dummy, differentiation is performed with respect to the second vector argument.

Parameters
t: Object constructor containing the member method to differentiate.
fPointer to the member method.
dummyDummy vector for the method prototype.
xInput vector.

Definition at line 711 of file numerical_differentiation.h.

◆ calculate_hessian_matrices()

Tensor< Tensor< type, 2 >, 2 > calculate_hessian_matrices ( const T &  t,
Tensor< type, 1 >(T::*)(const Index &, const Tensor< type, 1 > &, const Tensor< type, 1 > &) const  f,
const Index &  dummy_int,
const Tensor< type, 1 > &  dummy_vector,
const Tensor< type, 1 > &  x 
) const
inline

Returns the hessian matrices, as a matrix of matrices, of a function of many inputs and many outputs using the central differences method. The function to be differentiated is of the following form: Tensor<type, 1> f(const Index&, const Tensor<type, 1>&, const Tensor<type, 1>&) const. The first and second arguments are dummy, differentiation is performed with respect to the third argument.

Parameters
t: Object constructor containing the member method to differentiate.
fPointer to the member method.
dummy_intDummy integer for the method prototype.
dummy_vectorDummy vector for the method prototype.
xInput vector.

Definition at line 1630 of file numerical_differentiation.h.

◆ calculate_Jacobian() [1/5]

Tensor< type, 2 > calculate_Jacobian ( const T &  t,
Tensor< type, 1 >(T::*)(const Index &, const Index &, const Tensor< type, 1 > &) const  f,
const Index &  dummy_int_1,
const Index &  dummy_int_2,
const Tensor< type, 1 > &  x 
) const
inline

Returns the Jacobian matrix of a function of many inputs and many outputs using the central differences method. The function to be differentiated is of the following form: type f(const Index&, const Tensor<type, 1>&, const Tensor<type, 1>&) const. The first and second arguments are dummy, differentiation is performed with respect to the third argument.

Parameters
t: Object constructor containing the member method to differentiate.
fPointer to the member method.
dummy_int_1Dummy integer for the method prototype.
dummy_int_2Dummy integer for the method prototype.
xInput vector.

Definition at line 1118 of file numerical_differentiation.h.

◆ calculate_Jacobian() [2/5]

Tensor< type, 2 > calculate_Jacobian ( const T &  t,
Tensor< type, 1 >(T::*)(const Index &, const Tensor< type, 1 > &) const  f,
const Index &  dummy,
const Tensor< type, 1 > &  x 
) const
inline

Returns the Jacobian matrix of a function of many inputs and many outputs using the central differences method. The function to be differentiated is of the following form: type f(const Index&, const Tensor<type, 1>&) const. The first integer argument is dummy, differentiation is performed with respect to the second vector argument.

Parameters
t: Object constructor containing the member method to differentiate.
fPointer to the member method.
dummyDummy integer for the method prototype.
xInput vector.

Definition at line 1021 of file numerical_differentiation.h.

◆ calculate_Jacobian() [3/5]

Tensor< type, 2 > calculate_Jacobian ( const T &  t,
Tensor< type, 1 >(T::*)(const Index &, const Tensor< type, 1 > &, const Tensor< type, 1 > &) const  f,
const Index &  dummy_int,
const Tensor< type, 1 > &  dummy_vector,
const Tensor< type, 1 > &  x 
) const
inline

Returns the Jacobian matrix of a function of many inputs and many outputs using the central differences method. The function to be differentiated is of the following form: type f(const Index&, const Tensor<type, 1>&, const Tensor<type, 1>&) const. The first and second arguments are dummy, differentiation is performed with respect to the third argument.

Parameters
t: Object constructor containing the member method to differentiate.
fPointer to the member method.
dummy_intDummy integer for the method prototype.
dummy_vectorDummy vector for the method prototype.
xInput vector.

Definition at line 1069 of file numerical_differentiation.h.

◆ calculate_Jacobian() [4/5]

Tensor< type, 2 > calculate_Jacobian ( const T &  t,
Tensor< type, 1 >(T::*)(const Tensor< type, 1 > &) const  f,
const Tensor< type, 1 > &  x 
) const
inline

Returns the Jacobian matrix of a function of many inputs and many outputs using the central differences method. The function to be differentiated is of the following form: Tensor<type, 1> f(const Tensor<type, 1>&, const Tensor<type, 1>&) const.

Parameters
t: Object constructor containing the member method to differentiate.
fPointer to the member method.
xInput vector.

Definition at line 927 of file numerical_differentiation.h.

◆ calculate_Jacobian() [5/5]

Tensor< type, 2 > calculate_Jacobian ( const T &  t,
Tensor< type, 1 >(T::*)(const Tensor< type, 1 > &, const Tensor< type, 1 > &) const  f,
const Tensor< type, 1 > &  dummy,
const Tensor< type, 1 > &  x 
) const
inline

Returns the Jacobian matrix of a function of many inputs and many outputs using the central differences method. The function to be differentiated is of the following form: Tensor<type, 1> f(const Tensor<type, 1>&, const Tensor<type, 1>&) const.

Parameters
t: Object constructor containing the member method to differentiate.
fPointer to the member method.
dummyDummy vector for the method prototype.
xInput vector.

Definition at line 974 of file numerical_differentiation.h.

◆ calculate_second_derivatives() [1/3]

Tensor< type, 1 > calculate_second_derivatives ( const T &  t,
Tensor< type, 1 >(T::*)(const Index &, const Tensor< type, 1 > &) const  f,
const Index &  dummy,
const Tensor< type, 1 > &  x 
) const
inline

Returns the second derivatives of a vector function using the central differences method. The function to be differentiated is of the following form: Tensor<type, 1> f(const Index&, const Tensor<type, 1>&) const.

Parameters
t: Object constructor containing the member method to differentiate.
fPointer to the member method.
dummyDummy integer for the method prototype.
xInput vector.

Definition at line 285 of file numerical_differentiation.h.

◆ calculate_second_derivatives() [2/3]

Tensor< type, 1 > calculate_second_derivatives ( const T &  t,
Tensor< type, 1 >(T::*)(const Tensor< type, 1 > &) const  f,
const Tensor< type, 1 > &  x 
) const
inline

Returns the second derivative of a vector function using the central differences method.

Parameters
t: Object constructor containing the member method to differentiate.
fPointer to the member method.
xInput vector.

Definition at line 255 of file numerical_differentiation.h.

◆ calculate_second_derivatives() [3/3]

type calculate_second_derivatives ( const T &  t,
type(T::*)(const type &) const  f,
const type &  x 
) const
inline

Returns the second derivative of a function using the central differences method.

Parameters
t: Object constructor containing the member method to differentiate.
fPointer to the member method.
xDifferentiation point.

Definition at line 221 of file numerical_differentiation.h.

◆ get_display()

const bool & get_display ( ) const

Returns the flag used by this class for displaying or not displaying warnings.

Definition at line 40 of file numerical_differentiation.cpp.

◆ get_precision_digits()

const Index & get_precision_digits ( ) const

Enumeration of available methods for numerical differentiation.

Returns the number of precision digits required for the derivatives.

Definition at line 32 of file numerical_differentiation.cpp.

◆ set_default()

void set_default ( )

Sets default values for the members of this object:

  • Numerical differentiation method: Central differences.
  • Precision digits: 6.
  • Display: true.

Definition at line 70 of file numerical_differentiation.cpp.

◆ set_display()

void set_display ( const bool &  new_display)

Sets a new flag for displaying warnings from this class or not.

Parameters
new_displayDisplay flag.

Definition at line 48 of file numerical_differentiation.cpp.

◆ set_precision_digits()

void set_precision_digits ( const Index &  new_precision_digits)

Sets a new number of precision digits required for the derivatives.

Parameters
new_precision_digitsNumber of precision digits.

Definition at line 57 of file numerical_differentiation.cpp.

Member Data Documentation

◆ display

bool display = true
private

Flag for displaying warning messages from this class.

Definition at line 1750 of file numerical_differentiation.h.

◆ precision_digits

Index precision_digits
private

Number of precision digits.

Definition at line 1746 of file numerical_differentiation.h.


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