TR-mbed 1.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | Friends | List of all members
Eigen::AutoDiffScalar< DerivativeType > Class Template Reference

A scalar type replacement with automatic differentiation capability. More...

#include <AutoDiffScalar.h>

Inheritance diagram for Eigen::AutoDiffScalar< DerivativeType >:
Eigen::internal::auto_diff_special_op< DerivativeType, !internal::is_same< internal::traits< internal::remove_all< DerivativeType >::type >::Scalar, NumTraits< internal::traits< internal::remove_all< DerivativeType >::type >::Scalar >::Real >::value >

Public Types

typedef internal::auto_diff_special_op< DerivativeType, !internal::is_same< typename internal::traits< typename internal::remove_all< DerivativeType >::type >::Scalar, typename NumTraits< typename internal::traits< typename internal::remove_all< DerivativeType >::type >::Scalar >::Real >::valueBase
 
typedef internal::remove_all< DerivativeType >::type DerType
 
typedef internal::traits< DerType >::Scalar Scalar
 
typedef NumTraits< Scalar >::Real Real
 

Public Member Functions

 AutoDiffScalar ()
 
 AutoDiffScalar (const Scalar &value, int nbDer, int derNumber)
 
 AutoDiffScalar (const Real &value)
 
 AutoDiffScalar (const Scalar &value, const DerType &der)
 
template<typename OtherDerType >
 AutoDiffScalar (const AutoDiffScalar< OtherDerType > &other, typename internal::enable_if< internal::is_same< Scalar, typename internal::traits< typename internal::remove_all< OtherDerType >::type >::Scalar >::value &&internal::is_convertible< OtherDerType, DerType >::value, void * >::type=0)
 
 AutoDiffScalar (const AutoDiffScalar &other)
 
template<typename OtherDerType >
AutoDiffScalaroperator= (const AutoDiffScalar< OtherDerType > &other)
 
AutoDiffScalaroperator= (const AutoDiffScalar &other)
 
AutoDiffScalaroperator= (const Scalar &other)
 
const Scalarvalue () const
 
Scalarvalue ()
 
const DerTypederivatives () const
 
DerTypederivatives ()
 
bool operator< (const Scalar &other) const
 
bool operator<= (const Scalar &other) const
 
bool operator> (const Scalar &other) const
 
bool operator>= (const Scalar &other) const
 
bool operator== (const Scalar &other) const
 
bool operator!= (const Scalar &other) const
 
template<typename OtherDerType >
bool operator< (const AutoDiffScalar< OtherDerType > &b) const
 
template<typename OtherDerType >
bool operator<= (const AutoDiffScalar< OtherDerType > &b) const
 
template<typename OtherDerType >
bool operator> (const AutoDiffScalar< OtherDerType > &b) const
 
template<typename OtherDerType >
bool operator>= (const AutoDiffScalar< OtherDerType > &b) const
 
template<typename OtherDerType >
bool operator== (const AutoDiffScalar< OtherDerType > &b) const
 
template<typename OtherDerType >
bool operator!= (const AutoDiffScalar< OtherDerType > &b) const
 
const AutoDiffScalar< DerType & > operator+ (const Scalar &other) const
 
AutoDiffScalaroperator+= (const Scalar &other)
 
template<typename OtherDerType >
const AutoDiffScalar< CwiseBinaryOp< internal::scalar_sum_op< Scalar >, const DerType, const typename internal::remove_all< OtherDerType >::type > > operator+ (const AutoDiffScalar< OtherDerType > &other) const
 
template<typename OtherDerType >
AutoDiffScalaroperator+= (const AutoDiffScalar< OtherDerType > &other)
 
const AutoDiffScalar< DerType & > operator- (const Scalar &b) const
 
AutoDiffScalaroperator-= (const Scalar &other)
 
template<typename OtherDerType >
const AutoDiffScalar< CwiseBinaryOp< internal::scalar_difference_op< Scalar >, const DerType, const typename internal::remove_all< OtherDerType >::type > > operator- (const AutoDiffScalar< OtherDerType > &other) const
 
template<typename OtherDerType >
AutoDiffScalaroperator-= (const AutoDiffScalar< OtherDerType > &other)
 
const AutoDiffScalar< CwiseUnaryOp< internal::scalar_opposite_op< Scalar >, const DerType > > operator- () const
 
const AutoDiffScalar< EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(DerType, Scalar, product) > operator* (const Scalar &other) const
 
const AutoDiffScalar< EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(DerType, Scalar, product) > operator/ (const Scalar &other) const
 
template<typename OtherDerType >
const AutoDiffScalar< EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(CwiseBinaryOp< internal::scalar_difference_op< Scalar > EIGEN_COMMA const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(DerType, Scalar, product) EIGEN_COMMA const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(typename internal::remove_all< OtherDerType >::type, Scalar, product) >, Scalar, product) > operator/ (const AutoDiffScalar< OtherDerType > &other) const
 
template<typename OtherDerType >
const AutoDiffScalar< CwiseBinaryOp< internal::scalar_sum_op< Scalar >, const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(DerType, Scalar, product), const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(typename internal::remove_all< OtherDerType >::type, Scalar, product) > > operator* (const AutoDiffScalar< OtherDerType > &other) const
 
AutoDiffScalaroperator*= (const Scalar &other)
 
template<typename OtherDerType >
AutoDiffScalaroperator*= (const AutoDiffScalar< OtherDerType > &other)
 
AutoDiffScalaroperator/= (const Scalar &other)
 
template<typename OtherDerType >
AutoDiffScalaroperator/= (const AutoDiffScalar< OtherDerType > &other)
 

Protected Attributes

Scalar m_value
 
DerType m_derivatives
 

Friends

std::ostream & operator<< (std::ostream &s, const AutoDiffScalar &a)
 
bool operator< (const Scalar &a, const AutoDiffScalar &b)
 
bool operator<= (const Scalar &a, const AutoDiffScalar &b)
 
bool operator> (const Scalar &a, const AutoDiffScalar &b)
 
bool operator>= (const Scalar &a, const AutoDiffScalar &b)
 
bool operator== (const Scalar &a, const AutoDiffScalar &b)
 
bool operator!= (const Scalar &a, const AutoDiffScalar &b)
 
const AutoDiffScalar< DerType & > operator+ (const Scalar &a, const AutoDiffScalar &b)
 
const AutoDiffScalar< CwiseUnaryOp< internal::scalar_opposite_op< Scalar >, const DerType > > operator- (const Scalar &a, const AutoDiffScalar &b)
 
const AutoDiffScalar< EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(DerType, Scalar, product) > operator* (const Scalar &other, const AutoDiffScalar &a)
 
const AutoDiffScalar< EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(DerType, Scalar, product) > operator/ (const Scalar &other, const AutoDiffScalar &a)
 

Detailed Description

template<typename DerivativeType>
class Eigen::AutoDiffScalar< DerivativeType >

A scalar type replacement with automatic differentiation capability.

Parameters
DerivativeTypethe vector type used to store/represent the derivatives. The base scalar type as well as the number of derivatives to compute are determined from this type. Typical choices include, e.g., Vector4f for 4 derivatives, or VectorXf if the number of derivatives is not known at compile time, and/or, the number of derivatives is large. Note that DerivativeType can also be a reference (e.g., VectorXf&) to wrap a existing vector into an AutoDiffScalar. Finally, DerivativeType can also be any Eigen compatible expression.

This class represents a scalar value while tracking its respective derivatives using Eigen's expression template mechanism.

It supports the following list of global math function:

AutoDiffScalar can be used as the scalar type of an Eigen::Matrix object. However, in that case, the expression template mechanism only occurs at the top Matrix level, while derivatives are computed right away.

Member Typedef Documentation

◆ Base

template<typename DerivativeType >
typedef internal::auto_diff_special_op<DerivativeType, !internal::is_same<typename internal::traits<typename internal::remove_all<DerivativeType>::type>::Scalar, typename NumTraits<typename internal::traits<typename internal::remove_all<DerivativeType>::type>::Scalar>::Real>::value> Eigen::AutoDiffScalar< DerivativeType >::Base

◆ DerType

template<typename DerivativeType >
typedef internal::remove_all<DerivativeType>::type Eigen::AutoDiffScalar< DerivativeType >::DerType

◆ Real

template<typename DerivativeType >
typedef NumTraits<Scalar>::Real Eigen::AutoDiffScalar< DerivativeType >::Real

◆ Scalar

template<typename DerivativeType >
typedef internal::traits<DerType>::Scalar Eigen::AutoDiffScalar< DerivativeType >::Scalar

Constructor & Destructor Documentation

◆ AutoDiffScalar() [1/6]

template<typename DerivativeType >
Eigen::AutoDiffScalar< DerivativeType >::AutoDiffScalar ( )
inline

Default constructor without any initialization.

◆ AutoDiffScalar() [2/6]

template<typename DerivativeType >
Eigen::AutoDiffScalar< DerivativeType >::AutoDiffScalar ( const Scalar value,
int  nbDer,
int  derNumber 
)
inline

Constructs an active scalar from its value, and initializes the nbDer derivatives such that it corresponds to the derNumber -th variable

◆ AutoDiffScalar() [3/6]

template<typename DerivativeType >
Eigen::AutoDiffScalar< DerivativeType >::AutoDiffScalar ( const Real value)
inline

Conversion from a scalar constant to an active scalar. The derivatives are set to zero.

◆ AutoDiffScalar() [4/6]

template<typename DerivativeType >
Eigen::AutoDiffScalar< DerivativeType >::AutoDiffScalar ( const Scalar value,
const DerType der 
)
inline

Constructs an active scalar from its value and derivatives der

◆ AutoDiffScalar() [5/6]

template<typename DerivativeType >
template<typename OtherDerType >
Eigen::AutoDiffScalar< DerivativeType >::AutoDiffScalar ( const AutoDiffScalar< OtherDerType > &  other,
typename internal::enable_if< internal::is_same< Scalar, typename internal::traits< typename internal::remove_all< OtherDerType >::type >::Scalar >::value &&internal::is_convertible< OtherDerType, DerType >::value, void * >::type  = 0 
)
inline

◆ AutoDiffScalar() [6/6]

template<typename DerivativeType >
Eigen::AutoDiffScalar< DerivativeType >::AutoDiffScalar ( const AutoDiffScalar< DerivativeType > &  other)
inline

Member Function Documentation

◆ derivatives() [1/2]

template<typename DerivativeType >
DerType & Eigen::AutoDiffScalar< DerivativeType >::derivatives ( )
inline

◆ derivatives() [2/2]

template<typename DerivativeType >
const DerType & Eigen::AutoDiffScalar< DerivativeType >::derivatives ( ) const
inline

◆ operator!=() [1/2]

template<typename DerivativeType >
template<typename OtherDerType >
bool Eigen::AutoDiffScalar< DerivativeType >::operator!= ( const AutoDiffScalar< OtherDerType > &  b) const
inline

◆ operator!=() [2/2]

template<typename DerivativeType >
bool Eigen::AutoDiffScalar< DerivativeType >::operator!= ( const Scalar other) const
inline

◆ operator*() [1/2]

template<typename DerivativeType >
template<typename OtherDerType >
const AutoDiffScalar< CwiseBinaryOp< internal::scalar_sum_op< Scalar >, const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(DerType, Scalar, product), const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(typename internal::remove_all< OtherDerType >::type, Scalar, product) > > Eigen::AutoDiffScalar< DerivativeType >::operator* ( const AutoDiffScalar< OtherDerType > &  other) const
inline

◆ operator*() [2/2]

template<typename DerivativeType >
const AutoDiffScalar< EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(DerType, Scalar, product) > Eigen::AutoDiffScalar< DerivativeType >::operator* ( const Scalar other) const
inline

◆ operator*=() [1/2]

template<typename DerivativeType >
template<typename OtherDerType >
AutoDiffScalar & Eigen::AutoDiffScalar< DerivativeType >::operator*= ( const AutoDiffScalar< OtherDerType > &  other)
inline

◆ operator*=() [2/2]

template<typename DerivativeType >
AutoDiffScalar & Eigen::AutoDiffScalar< DerivativeType >::operator*= ( const Scalar other)
inline

◆ operator+() [1/2]

template<typename DerivativeType >
template<typename OtherDerType >
const AutoDiffScalar< CwiseBinaryOp< internal::scalar_sum_op< Scalar >, const DerType, const typename internal::remove_all< OtherDerType >::type > > Eigen::AutoDiffScalar< DerivativeType >::operator+ ( const AutoDiffScalar< OtherDerType > &  other) const
inline

◆ operator+() [2/2]

template<typename DerivativeType >
const AutoDiffScalar< DerType & > Eigen::AutoDiffScalar< DerivativeType >::operator+ ( const Scalar other) const
inline

◆ operator+=() [1/2]

template<typename DerivativeType >
template<typename OtherDerType >
AutoDiffScalar & Eigen::AutoDiffScalar< DerivativeType >::operator+= ( const AutoDiffScalar< OtherDerType > &  other)
inline

◆ operator+=() [2/2]

template<typename DerivativeType >
AutoDiffScalar & Eigen::AutoDiffScalar< DerivativeType >::operator+= ( const Scalar other)
inline

◆ operator-() [1/3]

template<typename DerivativeType >
const AutoDiffScalar< CwiseUnaryOp< internal::scalar_opposite_op< Scalar >, const DerType > > Eigen::AutoDiffScalar< DerivativeType >::operator- ( ) const
inline

◆ operator-() [2/3]

template<typename DerivativeType >
template<typename OtherDerType >
const AutoDiffScalar< CwiseBinaryOp< internal::scalar_difference_op< Scalar >, const DerType, const typename internal::remove_all< OtherDerType >::type > > Eigen::AutoDiffScalar< DerivativeType >::operator- ( const AutoDiffScalar< OtherDerType > &  other) const
inline

◆ operator-() [3/3]

template<typename DerivativeType >
const AutoDiffScalar< DerType & > Eigen::AutoDiffScalar< DerivativeType >::operator- ( const Scalar b) const
inline

◆ operator-=() [1/2]

template<typename DerivativeType >
template<typename OtherDerType >
AutoDiffScalar & Eigen::AutoDiffScalar< DerivativeType >::operator-= ( const AutoDiffScalar< OtherDerType > &  other)
inline

◆ operator-=() [2/2]

template<typename DerivativeType >
AutoDiffScalar & Eigen::AutoDiffScalar< DerivativeType >::operator-= ( const Scalar other)
inline

◆ operator/() [1/2]

template<typename DerivativeType >
template<typename OtherDerType >
const AutoDiffScalar< EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE( CwiseBinaryOp< internal::scalar_difference_op< Scalar > EIGEN_COMMA const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(DerType, Scalar, product) EIGEN_COMMA const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(typename internal::remove_all< OtherDerType >::type, Scalar, product) >, Scalar, product) > Eigen::AutoDiffScalar< DerivativeType >::operator/ ( const AutoDiffScalar< OtherDerType > &  other) const
inline

◆ operator/() [2/2]

template<typename DerivativeType >
const AutoDiffScalar< EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(DerType, Scalar, product) > Eigen::AutoDiffScalar< DerivativeType >::operator/ ( const Scalar other) const
inline

◆ operator/=() [1/2]

template<typename DerivativeType >
template<typename OtherDerType >
AutoDiffScalar & Eigen::AutoDiffScalar< DerivativeType >::operator/= ( const AutoDiffScalar< OtherDerType > &  other)
inline

◆ operator/=() [2/2]

template<typename DerivativeType >
AutoDiffScalar & Eigen::AutoDiffScalar< DerivativeType >::operator/= ( const Scalar other)
inline

◆ operator<() [1/2]

template<typename DerivativeType >
template<typename OtherDerType >
bool Eigen::AutoDiffScalar< DerivativeType >::operator< ( const AutoDiffScalar< OtherDerType > &  b) const
inline

◆ operator<() [2/2]

template<typename DerivativeType >
bool Eigen::AutoDiffScalar< DerivativeType >::operator< ( const Scalar other) const
inline

◆ operator<=() [1/2]

template<typename DerivativeType >
template<typename OtherDerType >
bool Eigen::AutoDiffScalar< DerivativeType >::operator<= ( const AutoDiffScalar< OtherDerType > &  b) const
inline

◆ operator<=() [2/2]

template<typename DerivativeType >
bool Eigen::AutoDiffScalar< DerivativeType >::operator<= ( const Scalar other) const
inline

◆ operator=() [1/3]

template<typename DerivativeType >
AutoDiffScalar & Eigen::AutoDiffScalar< DerivativeType >::operator= ( const AutoDiffScalar< DerivativeType > &  other)
inline

◆ operator=() [2/3]

template<typename DerivativeType >
template<typename OtherDerType >
AutoDiffScalar & Eigen::AutoDiffScalar< DerivativeType >::operator= ( const AutoDiffScalar< OtherDerType > &  other)
inline

◆ operator=() [3/3]

template<typename DerivativeType >
AutoDiffScalar & Eigen::AutoDiffScalar< DerivativeType >::operator= ( const Scalar other)
inline

◆ operator==() [1/2]

template<typename DerivativeType >
template<typename OtherDerType >
bool Eigen::AutoDiffScalar< DerivativeType >::operator== ( const AutoDiffScalar< OtherDerType > &  b) const
inline

◆ operator==() [2/2]

template<typename DerivativeType >
bool Eigen::AutoDiffScalar< DerivativeType >::operator== ( const Scalar other) const
inline

◆ operator>() [1/2]

template<typename DerivativeType >
template<typename OtherDerType >
bool Eigen::AutoDiffScalar< DerivativeType >::operator> ( const AutoDiffScalar< OtherDerType > &  b) const
inline

◆ operator>() [2/2]

template<typename DerivativeType >
bool Eigen::AutoDiffScalar< DerivativeType >::operator> ( const Scalar other) const
inline

◆ operator>=() [1/2]

template<typename DerivativeType >
template<typename OtherDerType >
bool Eigen::AutoDiffScalar< DerivativeType >::operator>= ( const AutoDiffScalar< OtherDerType > &  b) const
inline

◆ operator>=() [2/2]

template<typename DerivativeType >
bool Eigen::AutoDiffScalar< DerivativeType >::operator>= ( const Scalar other) const
inline

◆ value() [1/2]

template<typename DerivativeType >
Scalar & Eigen::AutoDiffScalar< DerivativeType >::value ( )
inline

◆ value() [2/2]

template<typename DerivativeType >
const Scalar & Eigen::AutoDiffScalar< DerivativeType >::value ( ) const
inline

Friends And Related Symbol Documentation

◆ operator!=

template<typename DerivativeType >
bool operator!= ( const Scalar a,
const AutoDiffScalar< DerivativeType > &  b 
)
friend

◆ operator*

template<typename DerivativeType >
const AutoDiffScalar< EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(DerType, Scalar, product) > operator* ( const Scalar other,
const AutoDiffScalar< DerivativeType > &  a 
)
friend

◆ operator+

template<typename DerivativeType >
const AutoDiffScalar< DerType & > operator+ ( const Scalar a,
const AutoDiffScalar< DerivativeType > &  b 
)
friend

◆ operator-

template<typename DerivativeType >
const AutoDiffScalar< CwiseUnaryOp< internal::scalar_opposite_op< Scalar >, const DerType > > operator- ( const Scalar a,
const AutoDiffScalar< DerivativeType > &  b 
)
friend

◆ operator/

template<typename DerivativeType >
const AutoDiffScalar< EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(DerType, Scalar, product) > operator/ ( const Scalar other,
const AutoDiffScalar< DerivativeType > &  a 
)
friend

◆ operator<

template<typename DerivativeType >
bool operator< ( const Scalar a,
const AutoDiffScalar< DerivativeType > &  b 
)
friend

◆ operator<<

template<typename DerivativeType >
std::ostream & operator<< ( std::ostream &  s,
const AutoDiffScalar< DerivativeType > &  a 
)
friend

◆ operator<=

template<typename DerivativeType >
bool operator<= ( const Scalar a,
const AutoDiffScalar< DerivativeType > &  b 
)
friend

◆ operator==

template<typename DerivativeType >
bool operator== ( const Scalar a,
const AutoDiffScalar< DerivativeType > &  b 
)
friend

◆ operator>

template<typename DerivativeType >
bool operator> ( const Scalar a,
const AutoDiffScalar< DerivativeType > &  b 
)
friend

◆ operator>=

template<typename DerivativeType >
bool operator>= ( const Scalar a,
const AutoDiffScalar< DerivativeType > &  b 
)
friend

Member Data Documentation

◆ m_derivatives

template<typename DerivativeType >
DerType Eigen::AutoDiffScalar< DerivativeType >::m_derivatives
protected

◆ m_value

template<typename DerivativeType >
Scalar Eigen::AutoDiffScalar< DerivativeType >::m_value
protected

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