Wildmeshing Toolkit
DScalar2< _Scalar, _Gradient, _Hessian > Struct Template Reference

Automatic differentiation scalar with first- and second-order derivatives. More...

#include <autodiff.h>

Inheritance diagram for DScalar2< _Scalar, _Gradient, _Hessian >:
[legend]
Collaboration diagram for DScalar2< _Scalar, _Gradient, _Hessian >:
[legend]

Public Types

typedef _Scalar Scalar
 
typedef _Gradient Gradient
 
typedef _Hessian Hessian
 
typedef Eigen::Matrix< DScalar2, 2, 1 > DVector2
 
typedef Eigen::Matrix< DScalar2, 3, 1 > DVector3
 

Public Member Functions

Constructors and accessors
 DScalar2 (Scalar value_=(Scalar) 0)
 Create a new constant automatic differentiation scalar. More...
 
 DScalar2 (size_t index, const Scalar &value_)
 Construct a new scalar with the specified value and one first derivative set to 1. More...
 
 DScalar2 (Scalar value_, const Gradient &grad_, const Hessian &hess_)
 Construct a scalar associated with the given gradient and Hessian. More...
 
 DScalar2 (const DScalar2 &s)
 Copy constructor. More...
 
const ScalargetValue () const
 
const GradientgetGradient () const
 
const HessiangetHessian () const
 
Comparison and assignment
void operator= (const DScalar2 &s)
 
void operator= (const Scalar &v)
 
bool operator< (const DScalar2 &s) const
 
bool operator<= (const DScalar2 &s) const
 
bool operator> (const DScalar2 &s) const
 
bool operator>= (const DScalar2 &s) const
 
bool operator!= (const DScalar2 &s) const
 
bool operator< (const Scalar &s) const
 
bool operator<= (const Scalar &s) const
 
bool operator> (const Scalar &s) const
 
bool operator>= (const Scalar &s) const
 
bool operator== (const Scalar &s) const
 
bool operator!= (const Scalar &s) const
 

Static Public Member Functions

Vector helper functions
static DVector2 vector (const Eigen::Matrix< Scalar, 2, 1 > &v)
 Initialize a constant two-dimensional vector. More...
 
static DVector3 vector (const Eigen::Matrix< Scalar, 3, 1 > &v)
 Create a constant three-dimensional vector. More...
 
- Static Public Member Functions inherited from DiffScalarBase
static void setVariableCount (size_t value)
 Set the independent variable count used by the automatic differentiation layer. More...
 
static size_t getVariableCount ()
 Get the variable count used by the automatic differentiation layer. More...
 

Protected Attributes

Scalar value
 
Gradient grad
 
Hessian hess
 

Friends

Miscellaneous functions
DScalar2 abs (const DScalar2 &s)
 
DScalar2 sqrt (const DScalar2 &s)
 
DScalar2 pow (const DScalar2 &s, const Scalar &a)
 
DScalar2 exp (const DScalar2 &s)
 
DScalar2 log (const DScalar2 &s)
 
DScalar2 sin (const DScalar2 &s)
 
DScalar2 cos (const DScalar2 &s)
 
DScalar2 acos (const DScalar2 &s)
 
DScalar2 asin (const DScalar2 &s)
 
DScalar2 atan2 (const DScalar2 &y, const DScalar2 &x)
 

Addition

DScalar2operator+= (const DScalar2 &s)
 
DScalar2operator+= (const Scalar &v)
 
DScalar2 operator+ (const DScalar2 &lhs, const DScalar2 &rhs)
 
DScalar2 operator+ (const DScalar2 &lhs, const Scalar &rhs)
 
DScalar2 operator+ (const Scalar &lhs, const DScalar2 &rhs)
 

Subtraction

DScalar2operator-= (const DScalar2 &s)
 
DScalar2operator-= (const Scalar &v)
 
DScalar2 operator- (const DScalar2 &lhs, const DScalar2 &rhs)
 
DScalar2 operator- (const DScalar2 &lhs, const Scalar &rhs)
 
DScalar2 operator- (const Scalar &lhs, const DScalar2 &rhs)
 
DScalar2 operator- (const DScalar2 &s)
 

Division

DScalar2operator/= (const Scalar &v)
 
DScalar2 operator/ (const DScalar2 &lhs, const Scalar &rhs)
 
DScalar2 operator/ (const Scalar &lhs, const DScalar2 &rhs)
 
DScalar2 operator/ (const DScalar2 &lhs, const DScalar2 &rhs)
 
DScalar2 inverse (const DScalar2 &s)
 

Multiplication

DScalar2operator*= (const Scalar &v)
 
DScalar2 operator* (const DScalar2 &lhs, const Scalar &rhs)
 
DScalar2 operator* (const Scalar &lhs, const DScalar2 &rhs)
 
DScalar2 operator* (const DScalar2 &lhs, const DScalar2 &rhs)
 

Additional Inherited Members

- Static Public Attributes inherited from DiffScalarBase
static thread_local size_t m_variableCount
 

Detailed Description

template<typename _Scalar, typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
struct DScalar2< _Scalar, _Gradient, _Hessian >

Automatic differentiation scalar with first- and second-order derivatives.

This class provides an instrumented "scalar" value, which may be dependent on a number of independent variables. The implementation keeps tracks of first and second-order drivatives with respect to these variables using a set of overloaded operations and implementations of special functions (sin, tan, exp, ..).

This is extremely useful for numerical optimization, particularly when analytic derivatives from programs like Maple or Mathematica suffer from excessively complicated expressions.

The class relies on templates, which makes it possible to fix the number of independent variables at compile-time so that instances can be allocated on the stack. Otherwise, they will be placed on the heap.

This is an extended C++ port of Jon Kaldor's implementation, which is based on a C version by Eitan Grinspun at Caltech)

See also
DScalar1
Author
Wenzel Jakob

Definition at line 500 of file autodiff.h.

Member Typedef Documentation

◆ DVector2

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
typedef Eigen::Matrix<DScalar2, 2, 1> DScalar2< _Scalar, _Gradient, _Hessian >::DVector2

Definition at line 506 of file autodiff.h.

◆ DVector3

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
typedef Eigen::Matrix<DScalar2, 3, 1> DScalar2< _Scalar, _Gradient, _Hessian >::DVector3

Definition at line 507 of file autodiff.h.

◆ Gradient

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
typedef _Gradient DScalar2< _Scalar, _Gradient, _Hessian >::Gradient

Definition at line 504 of file autodiff.h.

◆ Hessian

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
typedef _Hessian DScalar2< _Scalar, _Gradient, _Hessian >::Hessian

Definition at line 505 of file autodiff.h.

◆ Scalar

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
typedef _Scalar DScalar2< _Scalar, _Gradient, _Hessian >::Scalar

Definition at line 503 of file autodiff.h.

Constructor & Destructor Documentation

◆ DScalar2() [1/4]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2< _Scalar, _Gradient, _Hessian >::DScalar2 ( Scalar  value_ = (Scalar)0)
inlineexplicit

Create a new constant automatic differentiation scalar.

Definition at line 514 of file autodiff.h.

References DiffScalarBase::getVariableCount(), DScalar2< _Scalar, _Gradient, _Hessian >::grad, and DScalar2< _Scalar, _Gradient, _Hessian >::hess.

Referenced by DScalar2< _Scalar, _Gradient, _Hessian >::vector().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DScalar2() [2/4]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2< _Scalar, _Gradient, _Hessian >::DScalar2 ( size_t  index,
const Scalar value_ 
)
inline

Construct a new scalar with the specified value and one first derivative set to 1.

Definition at line 525 of file autodiff.h.

References DiffScalarBase::getVariableCount(), DScalar2< _Scalar, _Gradient, _Hessian >::grad, and DScalar2< _Scalar, _Gradient, _Hessian >::hess.

Here is the call graph for this function:

◆ DScalar2() [3/4]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2< _Scalar, _Gradient, _Hessian >::DScalar2 ( Scalar  value_,
const Gradient grad_,
const Hessian hess_ 
)
inline

Construct a scalar associated with the given gradient and Hessian.

Definition at line 538 of file autodiff.h.

◆ DScalar2() [4/4]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2< _Scalar, _Gradient, _Hessian >::DScalar2 ( const DScalar2< _Scalar, _Gradient, _Hessian > &  s)
inline

Copy constructor.

Definition at line 542 of file autodiff.h.

Member Function Documentation

◆ getGradient()

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
const Gradient& DScalar2< _Scalar, _Gradient, _Hessian >::getGradient ( ) const
inline

Definition at line 546 of file autodiff.h.

References DScalar2< _Scalar, _Gradient, _Hessian >::grad.

Referenced by wmtk::function::PerSimplexAutodiffFunction::get_gradient(), and operator<<().

Here is the caller graph for this function:

◆ getHessian()

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
const Hessian& DScalar2< _Scalar, _Gradient, _Hessian >::getHessian ( ) const
inline

Definition at line 547 of file autodiff.h.

References DScalar2< _Scalar, _Gradient, _Hessian >::hess.

Referenced by wmtk::function::PerSimplexAutodiffFunction::get_hessian(), and operator<<().

Here is the caller graph for this function:

◆ getValue()

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
const Scalar& DScalar2< _Scalar, _Gradient, _Hessian >::getValue ( ) const
inline

Definition at line 545 of file autodiff.h.

References DScalar2< _Scalar, _Gradient, _Hessian >::value.

Referenced by wmtk::function::PerSimplexAutodiffFunction::get_value(), and operator<<().

Here is the caller graph for this function:

◆ operator!=() [1/2]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
bool DScalar2< _Scalar, _Gradient, _Hessian >::operator!= ( const DScalar2< _Scalar, _Gradient, _Hessian > &  s) const
inline

Definition at line 921 of file autodiff.h.

References DScalar2< _Scalar, _Gradient, _Hessian >::value.

◆ operator!=() [2/2]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
bool DScalar2< _Scalar, _Gradient, _Hessian >::operator!= ( const Scalar s) const
inline

Definition at line 928 of file autodiff.h.

References DScalar2< _Scalar, _Gradient, _Hessian >::value.

◆ operator*=()

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2& DScalar2< _Scalar, _Gradient, _Hessian >::operator*= ( const Scalar v)
inline

◆ operator+=() [1/2]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2& DScalar2< _Scalar, _Gradient, _Hessian >::operator+= ( const DScalar2< _Scalar, _Gradient, _Hessian > &  s)
inline

◆ operator+=() [2/2]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2& DScalar2< _Scalar, _Gradient, _Hessian >::operator+= ( const Scalar v)
inline

Definition at line 576 of file autodiff.h.

References DScalar2< _Scalar, _Gradient, _Hessian >::value.

◆ operator-=() [1/2]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2& DScalar2< _Scalar, _Gradient, _Hessian >::operator-= ( const DScalar2< _Scalar, _Gradient, _Hessian > &  s)
inline

◆ operator-=() [2/2]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2& DScalar2< _Scalar, _Gradient, _Hessian >::operator-= ( const Scalar v)
inline

Definition at line 617 of file autodiff.h.

References DScalar2< _Scalar, _Gradient, _Hessian >::value.

◆ operator/=()

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2& DScalar2< _Scalar, _Gradient, _Hessian >::operator/= ( const Scalar v)
inline

◆ operator<() [1/2]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
bool DScalar2< _Scalar, _Gradient, _Hessian >::operator< ( const DScalar2< _Scalar, _Gradient, _Hessian > &  s) const
inline

Definition at line 917 of file autodiff.h.

References DScalar2< _Scalar, _Gradient, _Hessian >::value.

◆ operator<() [2/2]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
bool DScalar2< _Scalar, _Gradient, _Hessian >::operator< ( const Scalar s) const
inline

Definition at line 923 of file autodiff.h.

References DScalar2< _Scalar, _Gradient, _Hessian >::value.

◆ operator<=() [1/2]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
bool DScalar2< _Scalar, _Gradient, _Hessian >::operator<= ( const DScalar2< _Scalar, _Gradient, _Hessian > &  s) const
inline

Definition at line 918 of file autodiff.h.

References DScalar2< _Scalar, _Gradient, _Hessian >::value.

◆ operator<=() [2/2]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
bool DScalar2< _Scalar, _Gradient, _Hessian >::operator<= ( const Scalar s) const
inline

Definition at line 924 of file autodiff.h.

References DScalar2< _Scalar, _Gradient, _Hessian >::value.

◆ operator=() [1/2]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
void DScalar2< _Scalar, _Gradient, _Hessian >::operator= ( const DScalar2< _Scalar, _Gradient, _Hessian > &  s)
inline

◆ operator=() [2/2]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
void DScalar2< _Scalar, _Gradient, _Hessian >::operator= ( const Scalar v)
inline

Definition at line 911 of file autodiff.h.

References DiffScalarBase::getVariableCount(), DScalar2< _Scalar, _Gradient, _Hessian >::grad, DScalar2< _Scalar, _Gradient, _Hessian >::hess, and DScalar2< _Scalar, _Gradient, _Hessian >::value.

Here is the call graph for this function:

◆ operator==()

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
bool DScalar2< _Scalar, _Gradient, _Hessian >::operator== ( const Scalar s) const
inline

Definition at line 927 of file autodiff.h.

References DScalar2< _Scalar, _Gradient, _Hessian >::value.

◆ operator>() [1/2]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
bool DScalar2< _Scalar, _Gradient, _Hessian >::operator> ( const DScalar2< _Scalar, _Gradient, _Hessian > &  s) const
inline

Definition at line 919 of file autodiff.h.

References DScalar2< _Scalar, _Gradient, _Hessian >::value.

◆ operator>() [2/2]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
bool DScalar2< _Scalar, _Gradient, _Hessian >::operator> ( const Scalar s) const
inline

Definition at line 925 of file autodiff.h.

References DScalar2< _Scalar, _Gradient, _Hessian >::value.

◆ operator>=() [1/2]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
bool DScalar2< _Scalar, _Gradient, _Hessian >::operator>= ( const DScalar2< _Scalar, _Gradient, _Hessian > &  s) const
inline

Definition at line 920 of file autodiff.h.

References DScalar2< _Scalar, _Gradient, _Hessian >::value.

◆ operator>=() [2/2]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
bool DScalar2< _Scalar, _Gradient, _Hessian >::operator>= ( const Scalar s) const
inline

Definition at line 926 of file autodiff.h.

References DScalar2< _Scalar, _Gradient, _Hessian >::value.

◆ vector() [1/2]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
static DVector2 DScalar2< _Scalar, _Gradient, _Hessian >::vector ( const Eigen::Matrix< Scalar, 2, 1 > &  v)
inlinestatic

Initialize a constant two-dimensional vector.

Definition at line 964 of file autodiff.h.

References DScalar2< _Scalar, _Gradient, _Hessian >::DScalar2().

Here is the call graph for this function:

◆ vector() [2/2]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
static DVector3 DScalar2< _Scalar, _Gradient, _Hessian >::vector ( const Eigen::Matrix< Scalar, 3, 1 > &  v)
inlinestatic

Create a constant three-dimensional vector.

Definition at line 970 of file autodiff.h.

References DScalar2< _Scalar, _Gradient, _Hessian >::DScalar2().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ abs

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2 abs ( const DScalar2< _Scalar, _Gradient, _Hessian > &  s)
friend

Definition at line 720 of file autodiff.h.

◆ acos

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2 acos ( const DScalar2< _Scalar, _Gradient, _Hessian > &  s)
friend

Definition at line 831 of file autodiff.h.

◆ asin

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2 asin ( const DScalar2< _Scalar, _Gradient, _Hessian > &  s)
friend

Definition at line 852 of file autodiff.h.

◆ atan2

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2 atan2 ( const DScalar2< _Scalar, _Gradient, _Hessian > &  y,
const DScalar2< _Scalar, _Gradient, _Hessian > &  x 
)
friend

Definition at line 873 of file autodiff.h.

◆ cos

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2 cos ( const DScalar2< _Scalar, _Gradient, _Hessian > &  s)
friend

Definition at line 814 of file autodiff.h.

◆ exp

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2 exp ( const DScalar2< _Scalar, _Gradient, _Hessian > &  s)
friend

Definition at line 762 of file autodiff.h.

◆ inverse

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2 inverse ( const DScalar2< _Scalar, _Gradient, _Hessian > &  s)
friend

Definition at line 646 of file autodiff.h.

◆ log

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2 log ( const DScalar2< _Scalar, _Gradient, _Hessian > &  s)
friend

Definition at line 780 of file autodiff.h.

◆ operator* [1/3]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2 operator* ( const DScalar2< _Scalar, _Gradient, _Hessian > &  lhs,
const DScalar2< _Scalar, _Gradient, _Hessian > &  rhs 
)
friend

Product rule

Definition at line 689 of file autodiff.h.

◆ operator* [2/3]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2 operator* ( const DScalar2< _Scalar, _Gradient, _Hessian > &  lhs,
const Scalar rhs 
)
friend

Definition at line 679 of file autodiff.h.

◆ operator* [3/3]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2 operator* ( const Scalar lhs,
const DScalar2< _Scalar, _Gradient, _Hessian > &  rhs 
)
friend

Definition at line 684 of file autodiff.h.

◆ operator+ [1/3]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2 operator+ ( const DScalar2< _Scalar, _Gradient, _Hessian > &  lhs,
const DScalar2< _Scalar, _Gradient, _Hessian > &  rhs 
)
friend

Definition at line 552 of file autodiff.h.

◆ operator+ [2/3]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2 operator+ ( const DScalar2< _Scalar, _Gradient, _Hessian > &  lhs,
const Scalar rhs 
)
friend

Definition at line 558 of file autodiff.h.

◆ operator+ [3/3]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2 operator+ ( const Scalar lhs,
const DScalar2< _Scalar, _Gradient, _Hessian > &  rhs 
)
friend

Definition at line 563 of file autodiff.h.

◆ operator- [1/4]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2 operator- ( const DScalar2< _Scalar, _Gradient, _Hessian > &  lhs,
const DScalar2< _Scalar, _Gradient, _Hessian > &  rhs 
)
friend

Definition at line 589 of file autodiff.h.

◆ operator- [2/4]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2 operator- ( const DScalar2< _Scalar, _Gradient, _Hessian > &  lhs,
const Scalar rhs 
)
friend

Definition at line 594 of file autodiff.h.

◆ operator- [3/4]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2 operator- ( const DScalar2< _Scalar, _Gradient, _Hessian > &  s)
friend

Definition at line 604 of file autodiff.h.

◆ operator- [4/4]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2 operator- ( const Scalar lhs,
const DScalar2< _Scalar, _Gradient, _Hessian > &  rhs 
)
friend

Definition at line 599 of file autodiff.h.

◆ operator/ [1/3]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2 operator/ ( const DScalar2< _Scalar, _Gradient, _Hessian > &  lhs,
const DScalar2< _Scalar, _Gradient, _Hessian > &  rhs 
)
friend

Definition at line 641 of file autodiff.h.

◆ operator/ [2/3]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2 operator/ ( const DScalar2< _Scalar, _Gradient, _Hessian > &  lhs,
const Scalar rhs 
)
friend

Definition at line 628 of file autodiff.h.

◆ operator/ [3/3]

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2 operator/ ( const Scalar lhs,
const DScalar2< _Scalar, _Gradient, _Hessian > &  rhs 
)
friend

Definition at line 636 of file autodiff.h.

◆ pow

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2 pow ( const DScalar2< _Scalar, _Gradient, _Hessian > &  s,
const Scalar a 
)
friend

Definition at line 744 of file autodiff.h.

◆ sin

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2 sin ( const DScalar2< _Scalar, _Gradient, _Hessian > &  s)
friend

Definition at line 796 of file autodiff.h.

◆ sqrt

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
DScalar2 sqrt ( const DScalar2< _Scalar, _Gradient, _Hessian > &  s)
friend

Definition at line 725 of file autodiff.h.

Member Data Documentation

◆ grad

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
Gradient DScalar2< _Scalar, _Gradient, _Hessian >::grad
protected

◆ hess

template<typename _Scalar , typename _Gradient = Eigen::Matrix<_Scalar, Eigen::Dynamic, 1>, typename _Hessian = Eigen::Matrix<_Scalar, Eigen::Dynamic, Eigen::Dynamic>>
Hessian DScalar2< _Scalar, _Gradient, _Hessian >::hess
protected

◆ value


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