Public Types | Public Member Functions | Protected Attributes | Friends | List of all members
Eigen::AutoDiffScalar< _DerType > Class Template Reference

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

#include <AutoDiffScalar.h>

Inheritance diagram for Eigen::AutoDiffScalar< _DerType >:
Inheritance graph
[legend]

Public Types

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

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)
 
const DerTypederivatives () const
 
DerTypederivatives ()
 
bool operator!= (const Scalar &other) const
 
template<typename OtherDerType >
bool operator!= (const AutoDiffScalar< OtherDerType > &b) const
 
const AutoDiffScalar< EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(DerType, Scalar, product) > operator* (const Scalar &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)
 
const AutoDiffScalar< DerType & > operator+ (const Scalar &other) const
 
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
 
AutoDiffScalaroperator+= (const Scalar &other)
 
template<typename OtherDerType >
AutoDiffScalaroperator+= (const AutoDiffScalar< OtherDerType > &other)
 
const AutoDiffScalar< DerType & > operator- (const Scalar &b) const
 
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
 
const AutoDiffScalar< CwiseUnaryOp< internal::scalar_opposite_op< Scalar >, const DerType > > operator- () const
 
AutoDiffScalaroperator-= (const Scalar &other)
 
template<typename OtherDerType >
AutoDiffScalaroperator-= (const AutoDiffScalar< OtherDerType > &other)
 
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
 
AutoDiffScalaroperator/= (const Scalar &other)
 
template<typename OtherDerType >
AutoDiffScalaroperator/= (const AutoDiffScalar< OtherDerType > &other)
 
bool operator< (const Scalar &other) const
 
template<typename OtherDerType >
bool operator< (const AutoDiffScalar< OtherDerType > &b) const
 
bool operator<= (const Scalar &other) const
 
template<typename OtherDerType >
bool operator<= (const AutoDiffScalar< OtherDerType > &b) const
 
template<typename OtherDerType >
AutoDiffScalaroperator= (const AutoDiffScalar< OtherDerType > &other)
 
AutoDiffScalaroperator= (const AutoDiffScalar &other)
 
AutoDiffScalaroperator= (const Scalar &other)
 
bool operator== (const Scalar &other) const
 
template<typename OtherDerType >
bool operator== (const AutoDiffScalar< OtherDerType > &b) const
 
bool operator> (const Scalar &other) const
 
template<typename OtherDerType >
bool operator> (const AutoDiffScalar< OtherDerType > &b) const
 
bool operator>= (const Scalar &other) const
 
template<typename OtherDerType >
bool operator>= (const AutoDiffScalar< OtherDerType > &b) const
 
const Scalarvalue () const
 
Scalarvalue ()
 

Protected Attributes

DerType m_derivatives
 
Scalar m_value
 

Friends

bool 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< 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)
 
bool operator< (const Scalar &a, const AutoDiffScalar &b)
 
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)
 

Detailed Description

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

A scalar type replacement with automatic differentation capability.

Parameters
_DerTypethe 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 _DerType can also be a reference (e.g., VectorXf&) to wrap a existing vector into an AutoDiffScalar. Finally, _DerType 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.

Definition at line 33 of file AutoDiffScalar.h.

Member Typedef Documentation

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

Definition at line 75 of file AutoDiffScalar.h.

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

Definition at line 76 of file AutoDiffScalar.h.

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

Definition at line 78 of file AutoDiffScalar.h.

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

Definition at line 77 of file AutoDiffScalar.h.

Constructor & Destructor Documentation

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

Default constructor without any initialization.

Definition at line 84 of file AutoDiffScalar.h.

template<typename _DerType>
Eigen::AutoDiffScalar< _DerType >::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

Definition at line 88 of file AutoDiffScalar.h.

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

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

Definition at line 96 of file AutoDiffScalar.h.

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

Constructs an active scalar from its value and derivatives der

Definition at line 104 of file AutoDiffScalar.h.

template<typename _DerType>
template<typename OtherDerType >
Eigen::AutoDiffScalar< _DerType >::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

Definition at line 109 of file AutoDiffScalar.h.

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

Definition at line 124 of file AutoDiffScalar.h.

Member Function Documentation

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

Definition at line 157 of file AutoDiffScalar.h.

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

Definition at line 158 of file AutoDiffScalar.h.

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

Definition at line 165 of file AutoDiffScalar.h.

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

Definition at line 179 of file AutoDiffScalar.h.

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

Definition at line 270 of file AutoDiffScalar.h.

template<typename _DerType>
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< _DerType >::operator* ( const AutoDiffScalar< OtherDerType > &  other) const
inline

Definition at line 343 of file AutoDiffScalar.h.

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

Definition at line 351 of file AutoDiffScalar.h.

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

Definition at line 358 of file AutoDiffScalar.h.

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

Definition at line 181 of file AutoDiffScalar.h.

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

Definition at line 209 of file AutoDiffScalar.h.

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

Definition at line 201 of file AutoDiffScalar.h.

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

Definition at line 219 of file AutoDiffScalar.h.

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

Definition at line 225 of file AutoDiffScalar.h.

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

Definition at line 245 of file AutoDiffScalar.h.

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

Definition at line 262 of file AutoDiffScalar.h.

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

Definition at line 237 of file AutoDiffScalar.h.

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

Definition at line 255 of file AutoDiffScalar.h.

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

Definition at line 298 of file AutoDiffScalar.h.

template<typename _DerType>
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< _DerType >::operator/ ( const AutoDiffScalar< OtherDerType > &  other) const
inline

Definition at line 330 of file AutoDiffScalar.h.

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

Definition at line 364 of file AutoDiffScalar.h.

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

Definition at line 371 of file AutoDiffScalar.h.

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

Definition at line 160 of file AutoDiffScalar.h.

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

Definition at line 174 of file AutoDiffScalar.h.

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

Definition at line 161 of file AutoDiffScalar.h.

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

Definition at line 175 of file AutoDiffScalar.h.

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

Definition at line 129 of file AutoDiffScalar.h.

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

Definition at line 136 of file AutoDiffScalar.h.

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

Definition at line 143 of file AutoDiffScalar.h.

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

Definition at line 164 of file AutoDiffScalar.h.

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

Definition at line 178 of file AutoDiffScalar.h.

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

Definition at line 162 of file AutoDiffScalar.h.

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

Definition at line 176 of file AutoDiffScalar.h.

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

Definition at line 163 of file AutoDiffScalar.h.

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

Definition at line 177 of file AutoDiffScalar.h.

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

Definition at line 154 of file AutoDiffScalar.h.

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

Definition at line 155 of file AutoDiffScalar.h.

Friends And Related Function Documentation

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

Definition at line 172 of file AutoDiffScalar.h.

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

Definition at line 276 of file AutoDiffScalar.h.

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

Definition at line 186 of file AutoDiffScalar.h.

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

Definition at line 231 of file AutoDiffScalar.h.

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

Definition at line 304 of file AutoDiffScalar.h.

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

Definition at line 167 of file AutoDiffScalar.h.

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

Definition at line 119 of file AutoDiffScalar.h.

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

Definition at line 168 of file AutoDiffScalar.h.

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

Definition at line 171 of file AutoDiffScalar.h.

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

Definition at line 169 of file AutoDiffScalar.h.

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

Definition at line 170 of file AutoDiffScalar.h.

Member Data Documentation

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

Definition at line 379 of file AutoDiffScalar.h.

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

Definition at line 378 of file AutoDiffScalar.h.


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


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:52:07