![]() |
|
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< internal::remove_all_t< DerivativeType > >::Scalar, typename NumTraits< typename internal::traits< internal::remove_all_t< DerivativeType > >::Scalar >::Real >::value > | Base |
typedef internal::remove_all_t< DerivativeType > | 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, std::enable_if_t< internal::is_same< Scalar, typename internal::traits< internal::remove_all_t< OtherDerType >>::Scalar >::value &&internal::is_convertible< OtherDerType, DerType >::value, void * >=0) | |
AutoDiffScalar (const AutoDiffScalar &other) | |
template<typename OtherDerType > | |
AutoDiffScalar & | operator= (const AutoDiffScalar< OtherDerType > &other) |
AutoDiffScalar & | operator= (const AutoDiffScalar &other) |
AutoDiffScalar & | operator= (const Scalar &other) |
const Scalar & | value () const |
Scalar & | value () |
const DerType & | derivatives () const |
DerType & | derivatives () |
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 |
AutoDiffScalar< DerType & > | operator+ (const Scalar &other) const |
AutoDiffScalar & | operator+= (const Scalar &other) |
template<typename OtherDerType > | |
auto | operator+ (const AutoDiffScalar< OtherDerType > &other) const |
template<typename OtherDerType > | |
AutoDiffScalar & | operator+= (const AutoDiffScalar< OtherDerType > &other) |
AutoDiffScalar< DerType & > | operator- (const Scalar &b) const |
AutoDiffScalar & | operator-= (const Scalar &other) |
template<typename OtherDerType > | |
auto | operator- (const AutoDiffScalar< OtherDerType > &other) const |
template<typename OtherDerType > | |
AutoDiffScalar & | operator-= (const AutoDiffScalar< OtherDerType > &other) |
AutoDiffScalar< CwiseUnaryOp< internal::scalar_opposite_op< Scalar >, const DerType > > | operator- () const |
auto | operator* (const Scalar &other) const |
auto | operator/ (const Scalar &other) const |
template<typename OtherDerType > | |
auto | operator/ (const AutoDiffScalar< OtherDerType > &other) const |
template<typename OtherDerType > | |
auto | operator* (const AutoDiffScalar< OtherDerType > &other) const |
AutoDiffScalar & | operator*= (const Scalar &other) |
template<typename OtherDerType > | |
AutoDiffScalar & | operator*= (const AutoDiffScalar< OtherDerType > &other) |
AutoDiffScalar & | operator/= (const Scalar &other) |
template<typename OtherDerType > | |
AutoDiffScalar & | operator/= (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) |
AutoDiffScalar< DerType & > | operator+ (const Scalar &a, const AutoDiffScalar &b) |
AutoDiffScalar< CwiseUnaryOp< internal::scalar_opposite_op< Scalar >, const DerType > > | operator- (const Scalar &a, const AutoDiffScalar &b) |
auto | operator* (const Scalar &other, const AutoDiffScalar &a) |
auto | operator/ (const Scalar &other, const AutoDiffScalar &a) |
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.
typedef internal::auto_diff_special_op< DerivativeType, !internal::is_same< typename internal::traits<internal::remove_all_t<DerivativeType> >::Scalar, typename NumTraits<typename internal::traits<internal::remove_all_t<DerivativeType> >::Scalar>::Real>::value> Eigen::AutoDiffScalar< DerivativeType >::Base |
typedef internal::remove_all_t<DerivativeType> Eigen::AutoDiffScalar< DerivativeType >::DerType |
typedef NumTraits<Scalar>::Real Eigen::AutoDiffScalar< DerivativeType >::Real |
typedef internal::traits<DerType>::Scalar Eigen::AutoDiffScalar< DerivativeType >::Scalar |
|
inline |
|
inline |
Constructs an active scalar from its value, and initializes the nbDer derivatives such that it corresponds to the derNumber -th variable
References Eigen::AutoDiffScalar< DerivativeType >::m_derivatives.
|
inline |
Conversion from a scalar constant to an active scalar. The derivatives are set to zero.
References Eigen::AutoDiffScalar< DerivativeType >::m_derivatives.
|
inline |
Constructs an active scalar from its value and derivatives der
|
inline |
|
inline |
|
inline |
|
inline |
References Eigen::AutoDiffScalar< DerivativeType >::m_derivatives.
Referenced by Eigen::AutoDiffScalar< DerivativeType >::operator*(), Eigen::AutoDiffScalar< DerivativeType >::operator+(), Eigen::AutoDiffScalar< DerivativeType >::operator-(), Eigen::AutoDiffScalar< DerivativeType >::operator/(), and Eigen::AutoDiffScalar< DerivativeType >::operator=().
|
inline |
References b, and Eigen::AutoDiffScalar< DerivativeType >::m_value.
|
inline |
References Eigen::AutoDiffScalar< DerivativeType >::m_value.
|
inline |
References Eigen::AutoDiffScalar< DerivativeType >::derivatives(), Eigen::AutoDiffScalar< DerivativeType >::m_derivatives, Eigen::AutoDiffScalar< DerivativeType >::m_value, Eigen::MakeAutoDiffScalar(), Eigen::internal::MakeCoherentCwiseBinaryOp(), and Eigen::AutoDiffScalar< DerivativeType >::value().
|
inline |
|
inline |
|
inline |
|
inline |
References Eigen::AutoDiffScalar< DerivativeType >::derivatives(), Eigen::AutoDiffScalar< DerivativeType >::m_derivatives, Eigen::AutoDiffScalar< DerivativeType >::m_value, Eigen::MakeAutoDiffScalar(), Eigen::internal::MakeCoherentCwiseBinaryOp(), and Eigen::AutoDiffScalar< DerivativeType >::value().
|
inline |
References Eigen::AutoDiffScalar< DerivativeType >::m_derivatives, and Eigen::AutoDiffScalar< DerivativeType >::m_value.
|
inline |
|
inline |
References Eigen::AutoDiffScalar< DerivativeType >::value().
|
inline |
References Eigen::AutoDiffScalar< DerivativeType >::m_derivatives, and Eigen::AutoDiffScalar< DerivativeType >::m_value.
|
inline |
References Eigen::AutoDiffScalar< DerivativeType >::derivatives(), Eigen::AutoDiffScalar< DerivativeType >::m_derivatives, Eigen::AutoDiffScalar< DerivativeType >::m_value, Eigen::MakeAutoDiffScalar(), Eigen::internal::MakeCoherentCwiseBinaryOp(), and Eigen::AutoDiffScalar< DerivativeType >::value().
|
inline |
|
inline |
|
inline |
References Eigen::AutoDiffScalar< DerivativeType >::value().
|
inline |
References Eigen::AutoDiffScalar< DerivativeType >::derivatives(), Eigen::AutoDiffScalar< DerivativeType >::m_derivatives, Eigen::AutoDiffScalar< DerivativeType >::m_value, Eigen::MakeAutoDiffScalar(), Eigen::internal::MakeCoherentCwiseBinaryOp(), and Eigen::AutoDiffScalar< DerivativeType >::value().
|
inline |
|
inline |
|
inline |
|
inline |
References b, and Eigen::AutoDiffScalar< DerivativeType >::m_value.
|
inline |
References Eigen::AutoDiffScalar< DerivativeType >::m_value.
|
inline |
References b, and Eigen::AutoDiffScalar< DerivativeType >::m_value.
|
inline |
References Eigen::AutoDiffScalar< DerivativeType >::m_value.
|
inline |
|
inline |
|
inline |
|
inline |
References b, and Eigen::AutoDiffScalar< DerivativeType >::m_value.
|
inline |
References Eigen::AutoDiffScalar< DerivativeType >::m_value.
|
inline |
References b, and Eigen::AutoDiffScalar< DerivativeType >::m_value.
|
inline |
References Eigen::AutoDiffScalar< DerivativeType >::m_value.
|
inline |
References b, and Eigen::AutoDiffScalar< DerivativeType >::m_value.
|
inline |
References Eigen::AutoDiffScalar< DerivativeType >::m_value.
|
inline |
References Eigen::AutoDiffScalar< DerivativeType >::m_value.
|
inline |
References Eigen::AutoDiffScalar< DerivativeType >::m_value.
Referenced by Eigen::AutoDiffScalar< DerivativeType >::operator*(), Eigen::AutoDiffScalar< DerivativeType >::operator+(), Eigen::AutoDiffScalar< DerivativeType >::operator+=(), Eigen::AutoDiffScalar< DerivativeType >::operator-(), Eigen::AutoDiffScalar< DerivativeType >::operator-=(), Eigen::AutoDiffScalar< DerivativeType >::operator/(), and Eigen::AutoDiffScalar< DerivativeType >::operator=().
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
protected |
Referenced by Eigen::AutoDiffScalar< DerivativeType >::AutoDiffScalar(), Eigen::AutoDiffScalar< DerivativeType >::derivatives(), Eigen::AutoDiffScalar< DerivativeType >::operator*(), Eigen::AutoDiffScalar< DerivativeType >::operator+(), Eigen::AutoDiffScalar< DerivativeType >::operator-(), Eigen::AutoDiffScalar< DerivativeType >::operator/(), and Eigen::AutoDiffScalar< DerivativeType >::operator=().
|
protected |
Referenced by Eigen::AutoDiffScalar< DerivativeType >::operator!=(), Eigen::AutoDiffScalar< DerivativeType >::operator*(), Eigen::AutoDiffScalar< DerivativeType >::operator+(), Eigen::AutoDiffScalar< DerivativeType >::operator-(), Eigen::AutoDiffScalar< DerivativeType >::operator/(), Eigen::AutoDiffScalar< DerivativeType >::operator<(), Eigen::AutoDiffScalar< DerivativeType >::operator<=(), Eigen::AutoDiffScalar< DerivativeType >::operator=(), Eigen::AutoDiffScalar< DerivativeType >::operator==(), Eigen::AutoDiffScalar< DerivativeType >::operator>(), Eigen::AutoDiffScalar< DerivativeType >::operator>=(), and Eigen::AutoDiffScalar< DerivativeType >::value().