A scalar type replacement with automatic differentiation capability. More...
#include <AutoDiffScalar.h>
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 >::value > | Base |
typedef internal::remove_all< DerivativeType >::type | DerType |
typedef NumTraits< Scalar >::Real | Real |
typedef internal::traits< DerType >::Scalar | Scalar |
Public Member Functions | |
AutoDiffScalar () | |
AutoDiffScalar (const AutoDiffScalar &other) | |
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 Real &value) | |
AutoDiffScalar (const Scalar &value, const DerType &der) | |
AutoDiffScalar (const Scalar &value, int nbDer, int derNumber) | |
DerType & | derivatives () |
const DerType & | derivatives () const |
template<typename OtherDerType > | |
bool | operator!= (const AutoDiffScalar< OtherDerType > &b) const |
bool | 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 |
const AutoDiffScalar< EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(DerType, Scalar, product) > | operator* (const Scalar &other) const |
template<typename OtherDerType > | |
AutoDiffScalar & | operator*= (const AutoDiffScalar< OtherDerType > &other) |
AutoDiffScalar & | operator*= (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 |
const AutoDiffScalar< DerType & > | operator+ (const Scalar &other) const |
template<typename OtherDerType > | |
AutoDiffScalar & | operator+= (const AutoDiffScalar< OtherDerType > &other) |
AutoDiffScalar & | operator+= (const Scalar &other) |
const AutoDiffScalar< CwiseUnaryOp< internal::scalar_opposite_op< Scalar >, const DerType > > | operator- () 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< DerType & > | operator- (const Scalar &b) const |
template<typename OtherDerType > | |
AutoDiffScalar & | operator-= (const AutoDiffScalar< OtherDerType > &other) |
AutoDiffScalar & | operator-= (const Scalar &other) |
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 |
const AutoDiffScalar< EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(DerType, Scalar, product) > | operator/ (const Scalar &other) const |
template<typename OtherDerType > | |
AutoDiffScalar & | operator/= (const AutoDiffScalar< OtherDerType > &other) |
AutoDiffScalar & | operator/= (const Scalar &other) |
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 |
AutoDiffScalar & | operator= (const AutoDiffScalar &other) |
template<typename OtherDerType > | |
AutoDiffScalar & | operator= (const AutoDiffScalar< OtherDerType > &other) |
AutoDiffScalar & | operator= (const Scalar &other) |
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 |
bool | operator>= (const Scalar &other) const |
Scalar & | value () |
const Scalar & | value () const |
Protected Attributes | |
DerType | m_derivatives |
Scalar | m_value |
Friends | |
bool | operator!= (const Scalar &a, const AutoDiffScalar &b) |
const friend AutoDiffScalar< EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(DerType, Scalar, product) > | operator* (const Scalar &other, const AutoDiffScalar &a) |
const friend AutoDiffScalar< DerType & > | operator+ (const Scalar &a, const AutoDiffScalar &b) |
const friend AutoDiffScalar< CwiseUnaryOp< internal::scalar_opposite_op< Scalar >, const DerType > > | operator- (const Scalar &a, const AutoDiffScalar &b) |
const friend 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) |
A scalar type replacement with automatic differentiation capability.
DerivativeType | 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 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.
Definition at line 33 of file AutoDiffScalar.h.
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::Base |
Definition at line 75 of file AutoDiffScalar.h.
typedef internal::remove_all<DerivativeType>::type Eigen::AutoDiffScalar::DerType |
Definition at line 76 of file AutoDiffScalar.h.
typedef NumTraits<Scalar>::Real Eigen::AutoDiffScalar::Real |
Definition at line 78 of file AutoDiffScalar.h.
Definition at line 77 of file AutoDiffScalar.h.
|
inline |
Default constructor without any initialization.
Definition at line 84 of file AutoDiffScalar.h.
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.
|
inline |
Conversion from a scalar constant to an active scalar. The derivatives are set to zero.
Definition at line 96 of file AutoDiffScalar.h.
Constructs an active scalar from its value and derivatives der
Definition at line 104 of file AutoDiffScalar.h.
|
inline |
Definition at line 109 of file AutoDiffScalar.h.
|
inline |
Definition at line 124 of file AutoDiffScalar.h.
|
inline |
Definition at line 158 of file AutoDiffScalar.h.
|
inline |
Definition at line 157 of file AutoDiffScalar.h.
|
inline |
Definition at line 179 of file AutoDiffScalar.h.
|
inline |
Definition at line 165 of file AutoDiffScalar.h.
|
inline |
Definition at line 343 of file AutoDiffScalar.h.
|
inline |
Definition at line 270 of file AutoDiffScalar.h.
|
inline |
Definition at line 358 of file AutoDiffScalar.h.
|
inline |
Definition at line 351 of file AutoDiffScalar.h.
|
inline |
Definition at line 209 of file AutoDiffScalar.h.
|
inline |
Definition at line 181 of file AutoDiffScalar.h.
|
inline |
Definition at line 219 of file AutoDiffScalar.h.
|
inline |
Definition at line 201 of file AutoDiffScalar.h.
|
inline |
Definition at line 262 of file AutoDiffScalar.h.
|
inline |
Definition at line 245 of file AutoDiffScalar.h.
|
inline |
Definition at line 225 of file AutoDiffScalar.h.
|
inline |
Definition at line 255 of file AutoDiffScalar.h.
|
inline |
Definition at line 237 of file AutoDiffScalar.h.
|
inline |
Definition at line 330 of file AutoDiffScalar.h.
|
inline |
Definition at line 298 of file AutoDiffScalar.h.
|
inline |
Definition at line 371 of file AutoDiffScalar.h.
|
inline |
Definition at line 364 of file AutoDiffScalar.h.
|
inline |
Definition at line 174 of file AutoDiffScalar.h.
|
inline |
Definition at line 160 of file AutoDiffScalar.h.
|
inline |
Definition at line 175 of file AutoDiffScalar.h.
|
inline |
Definition at line 161 of file AutoDiffScalar.h.
|
inline |
Definition at line 136 of file AutoDiffScalar.h.
|
inline |
Definition at line 129 of file AutoDiffScalar.h.
|
inline |
Definition at line 143 of file AutoDiffScalar.h.
|
inline |
Definition at line 178 of file AutoDiffScalar.h.
|
inline |
Definition at line 164 of file AutoDiffScalar.h.
|
inline |
Definition at line 176 of file AutoDiffScalar.h.
|
inline |
Definition at line 162 of file AutoDiffScalar.h.
|
inline |
Definition at line 177 of file AutoDiffScalar.h.
|
inline |
Definition at line 163 of file AutoDiffScalar.h.
|
inline |
Definition at line 155 of file AutoDiffScalar.h.
|
inline |
Definition at line 154 of file AutoDiffScalar.h.
|
friend |
Definition at line 172 of file AutoDiffScalar.h.
|
friend |
Definition at line 276 of file AutoDiffScalar.h.
|
friend |
Definition at line 186 of file AutoDiffScalar.h.
|
friend |
Definition at line 231 of file AutoDiffScalar.h.
|
friend |
Definition at line 304 of file AutoDiffScalar.h.
|
friend |
Definition at line 167 of file AutoDiffScalar.h.
|
friend |
Definition at line 119 of file AutoDiffScalar.h.
|
friend |
Definition at line 168 of file AutoDiffScalar.h.
|
friend |
Definition at line 171 of file AutoDiffScalar.h.
|
friend |
Definition at line 169 of file AutoDiffScalar.h.
|
friend |
Definition at line 170 of file AutoDiffScalar.h.
|
protected |
Definition at line 379 of file AutoDiffScalar.h.
|
protected |
Definition at line 378 of file AutoDiffScalar.h.