Fermat
Classes | Namespaces | Functions
diff.h File Reference

Defines classes to perform automatic differentiation. More...

#include <cugar/linalg/matrix.h>
#include <cugar/linalg/tensor.h>
#include <stdio.h>

Go to the source code of this file.

Classes

struct  cugar::static_min< O1, O2 >
 
struct  cugar::diff_var< ValType, N, O >
 
struct  cugar::diff_var< ValType, N, 0 >
 
struct  cugar::diff_var< ValType, 1, O >
 
struct  cugar::diff_var< ValType, 1, 0 >
 
struct  cugar::detail::dispatch_diff_tensor< ORDER >
 
struct  cugar::detail::dispatch_diff_tensor< 1 >
 
struct  cugar::detail::dispatch_diff_tensor< 2 >
 
struct  cugar::detail::dispatch_diff_tensor< 3 >
 
struct  cugar::detail::dispatch_sum< VT, N, O1, O2 >
 
struct  cugar::detail::dispatch_sum< VT, N, 0, 0 >
 
struct  cugar::detail::dispatch_sum< VT, N, O, 0 >
 
struct  cugar::detail::dispatch_sum< VT, N, 0, O >
 
struct  cugar::detail::dispatch_mul< VT, N, O1, O2 >
 
struct  cugar::detail::dispatch_mul< VT, N, 0, 0 >
 
struct  cugar::detail::dispatch_mul< VT, N, O, 0 >
 
struct  cugar::detail::dispatch_mul< VT, N, 0, O >
 
struct  cugar::detail::dispatch_div< VT, N, O1, O2 >
 
struct  cugar::detail::dispatch_div< VT, N, 0, 0 >
 
struct  cugar::detail::dispatch_div< VT, N, O, 0 >
 
struct  cugar::detail::dispatch_div< VT, N, 0, O >
 

Namespaces

 cugar
 Define a vector_view POD type and plain_view() for std::vector.
 

Functions

template<typename VT , uint32 O>
CUGAR_HOST_DEVICE void cugar::set_primary (diff_var< VT, 1, O > &var, const VT deriv=VT(1.0))
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE void cugar::set_primary (const uint32 i, diff_var< VT, N, O > &var, const VT deriv=VT(1.0))
 
template<typename VT , uint32 N>
CUGAR_HOST_DEVICE diff_var< VT, N, 0 > cugar::decrease_order (const diff_var< VT, N, 1 > &op)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< VT, N, O-1 > cugar::decrease_order (const diff_var< VT, N, O > &op)
 
template<typename VT , uint32 N>
CUGAR_HOST_DEVICE diff_var< VT, N, 1 > cugar::raise_order (const diff_var< VT, N, 0 > &op)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< VT, N, O+1 > cugar::raise_order (const diff_var< VT, N, O > &op)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE Vector< diff_var< VT, N, O+1 >, N > cugar::raise_order (const Vector< diff_var< VT, N, O >, N > &op)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE Tensor< diff_var< VT, N, O+1 >, 1, N > cugar::raise_order (const Tensor< diff_var< VT, N, O >, 1, N > &op)
 
template<typename VT , uint32 N, uint32 O, uint32 TO>
CUGAR_HOST_DEVICE Tensor< diff_var< VT, N, O+1 >, TO, N > cugar::raise_order (const Tensor< diff_var< VT, N, O >, TO, N > &op)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< VT, N, O >::diff_type cugar::diff (const diff_var< VT, N, O > op)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE Tensor< diff_var< VT, N, O-2 >, 2, N > cugar::diff_hessian (const diff_var< VT, N, O > op)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE Tensor< VT, 1, N > cugar::gradient (const diff_var< VT, N, O > op)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE Tensor< VT, 1, N > cugar::jacobian (const diff_var< VT, N, O > op)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE Tensor< VT, 2, N > cugar::hessian (const diff_var< VT, N, O > op)
 
template<uint32 ORDER, typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE Tensor< VT, ORDER, N > cugar::diff_tensor (const diff_var< VT, N, O > op)
 
template<typename VT , uint32 N>
CUGAR_HOST_DEVICE diff_var< VT, N, 0 > cugar::operator- (const diff_var< VT, N, 0 > a)
 
template<typename VT , uint32 N>
CUGAR_HOST_DEVICE diff_var< VT, N, 0 > cugar::operator- (const diff_var< VT, N, 0 > a, const diff_var< VT, N, 0 > b)
 
template<typename VT , uint32 N>
CUGAR_HOST_DEVICE diff_var< VT, N, 0 > cugar::operator- (const diff_var< VT, N, 0 > a, const VT b)
 
template<typename VT , uint32 N>
CUGAR_HOST_DEVICE diff_var< VT, N, 0 > cugar::operator- (const VT a, const diff_var< VT, N, 0 > b)
 
template<typename VT , uint32 N>
CUGAR_HOST_DEVICE diff_var< VT, N, 0 > cugar::operator+ (const diff_var< VT, N, 0 > a, const diff_var< VT, N, 0 > b)
 
template<typename VT , uint32 N>
CUGAR_HOST_DEVICE diff_var< VT, N, 0 > cugar::operator+ (const diff_var< VT, N, 0 > a, const VT b)
 
template<typename VT , uint32 N>
CUGAR_HOST_DEVICE diff_var< VT, N, 0 > cugar::operator+ (const VT a, const diff_var< VT, N, 0 > b)
 
template<typename VT , uint32 N>
CUGAR_HOST_DEVICE diff_var< VT, N, 0 > cugar::operator* (const diff_var< VT, N, 0 > a, const diff_var< VT, N, 0 > b)
 
template<typename VT , uint32 N>
CUGAR_HOST_DEVICE diff_var< VT, N, 0 > cugar::operator* (const diff_var< VT, N, 0 > a, const VT b)
 
template<typename VT , uint32 N>
CUGAR_HOST_DEVICE diff_var< VT, N, 0 > cugar::operator* (const VT a, const diff_var< VT, N, 0 > b)
 
template<typename VT , uint32 N>
CUGAR_HOST_DEVICE diff_var< VT, N, 0 > cugar::operator/ (const diff_var< VT, N, 0 > a, const diff_var< VT, N, 0 > b)
 
template<typename VT , uint32 N>
CUGAR_HOST_DEVICE diff_var< VT, N, 0 > cugar::operator/ (const diff_var< VT, N, 0 > a, const VT b)
 
template<typename VT , uint32 N, uint32 O1, uint32 O2>
CUGAR_HOST_DEVICE diff_var< VT, N, detail::dispatch_sum< VT, N, O1, O2 >::RO > cugar::operator+ (const diff_var< VT, N, O1 > a, const diff_var< VT, N, O2 > b)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< VT, N, O > cugar::operator+ (const diff_var< VT, N, O > a, const VT b)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< VT, N, O > cugar::operator+ (const VT a, const diff_var< VT, N, O > b)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< VT, N, O > cugar::operator- (const diff_var< VT, N, O > a)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< VT, N, O > cugar::operator- (const diff_var< VT, N, O > a, const VT b)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< VT, N, O > cugar::operator- (const VT a, const diff_var< VT, N, O > b)
 
template<typename VT , uint32 N, uint32 O1, uint32 O2>
CUGAR_HOST_DEVICE diff_var< VT, N, detail::dispatch_sum< VT, N, O1, O2 >::RO > cugar::operator- (const diff_var< VT, N, O1 > a, const diff_var< VT, N, O2 > b)
 
template<typename VT , uint32 N, uint32 O1, uint32 O2>
CUGAR_HOST_DEVICE diff_var< VT, N, detail::dispatch_mul< VT, N, O1, O2 >::RO > cugar::operator* (const diff_var< VT, N, O1 > a, const diff_var< VT, N, O2 > b)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< VT, N, O > cugar::operator* (const diff_var< VT, N, O > a, const VT b)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< VT, N, O > cugar::operator* (const VT a, const diff_var< VT, N, O > b)
 
template<typename VT , uint32 N, uint32 O1, uint32 O2>
CUGAR_HOST_DEVICE diff_var< VT, N, detail::dispatch_div< VT, N, O1, O2 >::RO > cugar::operator/ (const diff_var< VT, N, O1 > a, const diff_var< VT, N, O2 > b)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< VT, N, O > cugar::operator/ (const diff_var< VT, N, O > a, const VT b)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< VT, N, O > cugar::operator/ (const VT a, const diff_var< VT, N, O > b)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< VT, N, O > & cugar::operator+= (diff_var< VT, N, O > &a, const diff_var< VT, N, O > b)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< VT, N, O > & cugar::operator-= (diff_var< VT, N, O > &a, const diff_var< VT, N, O > b)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< VT, N, O > & cugar::operator*= (diff_var< VT, N, O > &a, const diff_var< VT, N, O > b)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< VT, N, O > & cugar::operator/= (diff_var< VT, N, O > &a, const diff_var< VT, N, O > b)
 
template<uint32 N>
CUGAR_HOST_DEVICE diff_var< float, N, 0 > cugar::sin (const diff_var< float, N, 0 > a)
 
template<uint32 N>
CUGAR_HOST_DEVICE diff_var< float, N, 0 > cugar::cos (const diff_var< float, N, 0 > a)
 
template<uint32 N>
CUGAR_HOST_DEVICE diff_var< float, N, 0 > cugar::log (const diff_var< float, N, 0 > a)
 
template<uint32 N>
CUGAR_HOST_DEVICE diff_var< float, N, 0 > cugar::exp (const diff_var< float, N, 0 > a)
 
template<uint32 N>
CUGAR_HOST_DEVICE diff_var< float, N, 0 > cugar::sqrt (const diff_var< float, N, 0 > a)
 
template<uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< float, N, O > cugar::sin (const diff_var< float, N, O > a)
 
template<uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< float, N, O > cugar::cos (const diff_var< float, N, O > a)
 
template<uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< float, N, O > cugar::log (const diff_var< float, N, O > a)
 
template<uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< float, N, O > cugar::exp (const diff_var< float, N, O > a)
 
template<uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< float, N, O > cugar::sqrt (const diff_var< float, N, O > a)
 
template<uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< float, N, O > cugar::sinf (const diff_var< float, N, O > a)
 
template<uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< float, N, O > cugar::cosf (const diff_var< float, N, O > a)
 
template<uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< float, N, O > cugar::logf (const diff_var< float, N, O > a)
 
template<uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< float, N, O > cugar::expf (const diff_var< float, N, O > a)
 
template<uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< float, N, O > cugar::sqrtf (const diff_var< float, N, O > a)
 
template<typename VT , uint32 N>
CUGAR_HOST_DEVICE diff_var< VT, N, 0 > cugar::sin (const diff_var< VT, N, 0 > a)
 
template<typename VT , uint32 N>
CUGAR_HOST_DEVICE diff_var< VT, N, 0 > cugar::cos (const diff_var< VT, N, 0 > a)
 
template<typename VT , uint32 N>
CUGAR_HOST_DEVICE diff_var< VT, N, 0 > cugar::log (const diff_var< VT, N, 0 > a)
 
template<typename VT , uint32 N>
CUGAR_HOST_DEVICE diff_var< VT, N, 0 > cugar::exp (const diff_var< VT, N, 0 > a)
 
template<typename VT , uint32 N>
CUGAR_HOST_DEVICE diff_var< VT, N, 0 > cugar::sqrt (const diff_var< VT, N, 0 > a)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< VT, N, O > cugar::sin (const diff_var< VT, N, O > a)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< VT, N, O > cugar::cos (const diff_var< VT, N, O > a)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< VT, N, O > cugar::log (const diff_var< VT, N, O > a)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< VT, N, O > cugar::exp (const diff_var< VT, N, O > a)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< VT, N, O > cugar::sqrt (const diff_var< VT, N, O > a)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< VT, N, O > cugar::max (const diff_var< VT, N, O > a, const diff_var< VT, N, O > b)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE diff_var< VT, N, O > cugar::min (const diff_var< VT, N, O > a, const diff_var< VT, N, O > b)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE bool cugar::operator< (const diff_var< VT, N, O > a, const diff_var< VT, N, O > b)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE bool cugar::operator<= (const diff_var< VT, N, O > a, const diff_var< VT, N, O > b)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE bool cugar::operator> (const diff_var< VT, N, O > a, const diff_var< VT, N, O > b)
 
template<typename VT , uint32 N, uint32 O>
CUGAR_HOST_DEVICE bool cugar::operator>= (const diff_var< VT, N, O > a, const diff_var< VT, N, O > b)
 

Detailed Description

Defines classes to perform automatic differentiation.