A scalar type replacement with automatic differentation capability. More...
#include <AutoDiffScalar.h>
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 > ::value > | Base |
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) | |
AutoDiffScalar (const AutoDiffScalar &other) | |
const DerType & | derivatives () const |
DerType & | derivatives () |
const AutoDiffScalar < CwiseUnaryOp < internal::scalar_multiple_op < Scalar >, const DerType > > | operator* (const Scalar &other) const |
template<typename OtherDerType > | |
const AutoDiffScalar < CwiseBinaryOp < internal::scalar_sum_op < Scalar >, const CwiseUnaryOp < internal::scalar_multiple_op < Scalar >, const DerType > , const CwiseUnaryOp < internal::scalar_multiple_op < Scalar >, const typename internal::remove_all < OtherDerType >::type > > > | operator* (const AutoDiffScalar< OtherDerType > &other) const |
AutoDiffScalar & | operator*= (const Scalar &other) |
template<typename OtherDerType > | |
AutoDiffScalar & | operator*= (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 |
AutoDiffScalar & | operator+= (const Scalar &other) |
template<typename OtherDerType > | |
AutoDiffScalar & | operator+= (const AutoDiffScalar< OtherDerType > &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 > | |
const AutoDiffScalar < CwiseUnaryOp < internal::scalar_opposite_op < Scalar >, const DerType > > | operator- () const |
template<typename OtherDerType > | |
AutoDiffScalar & | operator-= (const AutoDiffScalar< OtherDerType > &other) |
const AutoDiffScalar < CwiseUnaryOp < internal::scalar_multiple_op < Scalar >, const DerType > > | operator/ (const Scalar &other) const |
template<typename OtherDerType > | |
const AutoDiffScalar < CwiseUnaryOp < internal::scalar_multiple_op < Scalar >, const CwiseBinaryOp < internal::scalar_difference_op < Scalar >, const CwiseUnaryOp < internal::scalar_multiple_op < Scalar >, const DerType > , const CwiseUnaryOp < internal::scalar_multiple_op < Scalar >, const typename internal::remove_all < OtherDerType >::type > > > > | operator/ (const AutoDiffScalar< OtherDerType > &other) const |
template<typename OtherDerType > | |
AutoDiffScalar & | operator= (const AutoDiffScalar< OtherDerType > &other) |
AutoDiffScalar & | operator= (const AutoDiffScalar &other) |
const Scalar & | value () const |
Scalar & | value () |
Protected Attributes | |
DerType | m_derivatives |
Scalar | m_value |
Friends | |
const AutoDiffScalar < CwiseUnaryOp < internal::scalar_multiple_op < Scalar >, const DerType > > | operator* (const Scalar &other, const AutoDiffScalar &a) |
const AutoDiffScalar< DerType & > | operator+ (const Scalar &a, const AutoDiffScalar &b) |
const AutoDiffScalar < CwiseUnaryOp < internal::scalar_multiple_op < Scalar >, const DerType > > | operator/ (const Scalar &other, const AutoDiffScalar &a) |
std::ostream & | operator<< (std::ostream &s, const AutoDiffScalar &a) |
A scalar type replacement with automatic differentation capability.
_DerType | the 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 75 of file AutoDiffScalar.h.
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 83 of file AutoDiffScalar.h.
typedef internal::remove_all<_DerType>::type Eigen::AutoDiffScalar< _DerType >::DerType |
Definition at line 84 of file AutoDiffScalar.h.
typedef NumTraits<Scalar>::Real Eigen::AutoDiffScalar< _DerType >::Real |
Definition at line 86 of file AutoDiffScalar.h.
typedef internal::traits<DerType>::Scalar Eigen::AutoDiffScalar< _DerType >::Scalar |
Definition at line 85 of file AutoDiffScalar.h.
Eigen::AutoDiffScalar< _DerType >::AutoDiffScalar | ( | ) | [inline] |
Default constructor without any initialization.
Definition at line 92 of file AutoDiffScalar.h.
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 96 of file AutoDiffScalar.h.
Eigen::AutoDiffScalar< _DerType >::AutoDiffScalar | ( | const Real & | value | ) | [inline, explicit] |
Conversion from a scalar constant to an active scalar. The derivatives are set to zero.
Definition at line 104 of file AutoDiffScalar.h.
Eigen::AutoDiffScalar< _DerType >::AutoDiffScalar | ( | const Scalar & | value, |
const DerType & | der | ||
) | [inline] |
Constructs an active scalar from its value and derivatives der
Definition at line 112 of file AutoDiffScalar.h.
Eigen::AutoDiffScalar< _DerType >::AutoDiffScalar | ( | const AutoDiffScalar< OtherDerType > & | other | ) | [inline] |
Definition at line 117 of file AutoDiffScalar.h.
Eigen::AutoDiffScalar< _DerType >::AutoDiffScalar | ( | const AutoDiffScalar< _DerType > & | other | ) | [inline] |
Definition at line 126 of file AutoDiffScalar.h.
const DerType& Eigen::AutoDiffScalar< _DerType >::derivatives | ( | ) | const [inline] |
Definition at line 151 of file AutoDiffScalar.h.
DerType& Eigen::AutoDiffScalar< _DerType >::derivatives | ( | ) | [inline] |
Definition at line 152 of file AutoDiffScalar.h.
const AutoDiffScalar<CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, const DerType> > Eigen::AutoDiffScalar< _DerType >::operator* | ( | const Scalar & | other | ) | const [inline] |
Definition at line 226 of file AutoDiffScalar.h.
const AutoDiffScalar<CwiseBinaryOp<internal::scalar_sum_op<Scalar>, const CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, const DerType>, const CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, const typename internal::remove_all<OtherDerType>::type> > > Eigen::AutoDiffScalar< _DerType >::operator* | ( | const AutoDiffScalar< OtherDerType > & | other | ) | const [inline] |
Definition at line 310 of file AutoDiffScalar.h.
AutoDiffScalar& Eigen::AutoDiffScalar< _DerType >::operator*= | ( | const Scalar & | other | ) | [inline] |
Definition at line 320 of file AutoDiffScalar.h.
AutoDiffScalar& Eigen::AutoDiffScalar< _DerType >::operator*= | ( | const AutoDiffScalar< OtherDerType > & | other | ) | [inline] |
Definition at line 327 of file AutoDiffScalar.h.
const AutoDiffScalar<DerType&> Eigen::AutoDiffScalar< _DerType >::operator+ | ( | const Scalar & | other | ) | const [inline] |
Definition at line 154 of file AutoDiffScalar.h.
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 182 of file AutoDiffScalar.h.
AutoDiffScalar& Eigen::AutoDiffScalar< _DerType >::operator+= | ( | const Scalar & | other | ) | [inline] |
Definition at line 174 of file AutoDiffScalar.h.
AutoDiffScalar& Eigen::AutoDiffScalar< _DerType >::operator+= | ( | const AutoDiffScalar< OtherDerType > & | other | ) | [inline] |
Definition at line 192 of file AutoDiffScalar.h.
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 200 of file AutoDiffScalar.h.
const AutoDiffScalar<CwiseUnaryOp<internal::scalar_opposite_op<Scalar>, const DerType> > Eigen::AutoDiffScalar< _DerType >::operator- | ( | ) | const [inline] |
Definition at line 218 of file AutoDiffScalar.h.
AutoDiffScalar& Eigen::AutoDiffScalar< _DerType >::operator-= | ( | const AutoDiffScalar< OtherDerType > & | other | ) | [inline] |
Definition at line 210 of file AutoDiffScalar.h.
const AutoDiffScalar<CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, const DerType> > Eigen::AutoDiffScalar< _DerType >::operator/ | ( | const Scalar & | other | ) | const [inline] |
Definition at line 258 of file AutoDiffScalar.h.
const AutoDiffScalar<CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, const CwiseBinaryOp<internal::scalar_difference_op<Scalar>, const CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, const DerType>, const CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, const typename internal::remove_all<OtherDerType>::type > > > > Eigen::AutoDiffScalar< _DerType >::operator/ | ( | const AutoDiffScalar< OtherDerType > & | other | ) | const [inline] |
Definition at line 294 of file AutoDiffScalar.h.
AutoDiffScalar& Eigen::AutoDiffScalar< _DerType >::operator= | ( | const AutoDiffScalar< OtherDerType > & | other | ) | [inline] |
Definition at line 131 of file AutoDiffScalar.h.
AutoDiffScalar& Eigen::AutoDiffScalar< _DerType >::operator= | ( | const AutoDiffScalar< _DerType > & | other | ) | [inline] |
Definition at line 138 of file AutoDiffScalar.h.
const Scalar& Eigen::AutoDiffScalar< _DerType >::value | ( | ) | const [inline] |
Definition at line 148 of file AutoDiffScalar.h.
Scalar& Eigen::AutoDiffScalar< _DerType >::value | ( | ) | [inline] |
Definition at line 149 of file AutoDiffScalar.h.
const AutoDiffScalar<CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, const DerType> > operator* | ( | const Scalar & | other, |
const AutoDiffScalar< _DerType > & | a | ||
) | [friend] |
Definition at line 234 of file AutoDiffScalar.h.
const AutoDiffScalar<DerType&> operator+ | ( | const Scalar & | a, |
const AutoDiffScalar< _DerType > & | b | ||
) | [friend] |
Definition at line 159 of file AutoDiffScalar.h.
const AutoDiffScalar<CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, const DerType> > operator/ | ( | const Scalar & | other, |
const AutoDiffScalar< _DerType > & | a | ||
) | [friend] |
Definition at line 266 of file AutoDiffScalar.h.
std::ostream& operator<< | ( | std::ostream & | s, |
const AutoDiffScalar< _DerType > & | a | ||
) | [friend] |
Definition at line 121 of file AutoDiffScalar.h.
DerType Eigen::AutoDiffScalar< _DerType >::m_derivatives [protected] |
Definition at line 335 of file AutoDiffScalar.h.
Scalar Eigen::AutoDiffScalar< _DerType >::m_value [protected] |
Definition at line 334 of file AutoDiffScalar.h.