Fermat
Public Types | Public Methods | Public Members | List of all members
cugar::diff_var< ValType, N, O > Struct Template Reference

Detailed description

template<typename ValType, uint32 N, uint32 O>
struct cugar::diff_var< ValType, N, O >

This class allows to represent variables that carry associated differentials up to a specified compile-time order with respect to a predefined set of variables

Template Parameters
ValTypethe value type of the expression
Nthe number of variables the expression is differentiated against
Othe maximum order of differentiation, i.e: 0 = no derivatives, 1 = first order derivatives / gradient, 2 = second-order derivatives / Hessian, 3 = third-order derivatives, ...

#include <diff.h>

Public Types

typedef ValType value_type
 
typedef diff_var< ValType, N, O-1 > diff_component_type
 
typedef Vector< diff_component_type, N > diff_type
 

Public Methods

CUGAR_HOST_DEVICE diff_var ()
 
CUGAR_HOST_DEVICE diff_var (const diff_var< ValType, N, O > &_other)
 
CUGAR_HOST_DEVICE diff_var (const value_type _u, const diff_type _du)
 
CUGAR_HOST_DEVICE diff_var (value_type _u)
 
CUGAR_HOST_DEVICE operator value_type () const
 
CUGAR_HOST_DEVICE diff_varoperator= (const value_type &_u)
 
CUGAR_HOST_DEVICE diff_type diff () const
 

Public Members

value_type u
 
diff_type du
 

Constructor & Destructor Documentation

◆ diff_var() [1/4]

template<typename ValType, uint32 N, uint32 O>
CUGAR_HOST_DEVICE cugar::diff_var< ValType, N, O >::diff_var ( )
inline

default constructor

◆ diff_var() [2/4]

template<typename ValType, uint32 N, uint32 O>
CUGAR_HOST_DEVICE cugar::diff_var< ValType, N, O >::diff_var ( const diff_var< ValType, N, O > &  _other)
inline

copy constructor

◆ diff_var() [3/4]

template<typename ValType, uint32 N, uint32 O>
CUGAR_HOST_DEVICE cugar::diff_var< ValType, N, O >::diff_var ( const value_type  _u,
const diff_type  _du 
)
inline

constructor

Parameters
_uscalar value
_dudifferential

◆ diff_var() [4/4]

template<typename ValType, uint32 N, uint32 O>
CUGAR_HOST_DEVICE cugar::diff_var< ValType, N, O >::diff_var ( value_type  _u)
inlineexplicit

constructor from scalar

Parameters
_uscalar value

Member Function Documentation

◆ diff()

template<typename ValType, uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_type cugar::diff_var< ValType, N, O >::diff ( ) const
inline

return the first-order differential

◆ operator value_type()

template<typename ValType, uint32 N, uint32 O>
CUGAR_HOST_DEVICE cugar::diff_var< ValType, N, O >::operator value_type ( ) const
inline

conversion to scalar

◆ operator=()

template<typename ValType, uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var& cugar::diff_var< ValType, N, O >::operator= ( const value_type &  _u)
inline

assignment to scalar


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