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)
 
 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< 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
 
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< 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
 
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)
 
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< 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_opposite_op< Scalar >, const 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)
 
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 60 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 68 of file AutoDiffScalar.h.

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

Definition at line 69 of file AutoDiffScalar.h.

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

Definition at line 71 of file AutoDiffScalar.h.

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

Definition at line 70 of file AutoDiffScalar.h.

Constructor & Destructor Documentation

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

Default constructor without any initialization.

Definition at line 77 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 81 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 89 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 97 of file AutoDiffScalar.h.

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

Definition at line 102 of file AutoDiffScalar.h.

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

Definition at line 111 of file AutoDiffScalar.h.

Member Function Documentation

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

Definition at line 136 of file AutoDiffScalar.h.

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

Definition at line 137 of file AutoDiffScalar.h.

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

Definition at line 144 of file AutoDiffScalar.h.

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

Definition at line 158 of file AutoDiffScalar.h.

template<typename _DerType>
const AutoDiffScalar<CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, const DerType> > Eigen::AutoDiffScalar< _DerType >::operator* ( const Scalar other) const
inline

Definition at line 249 of file AutoDiffScalar.h.

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

Definition at line 333 of file AutoDiffScalar.h.

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

Definition at line 343 of file AutoDiffScalar.h.

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

Definition at line 350 of file AutoDiffScalar.h.

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

Definition at line 160 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 188 of file AutoDiffScalar.h.

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

Definition at line 180 of file AutoDiffScalar.h.

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

Definition at line 198 of file AutoDiffScalar.h.

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

Definition at line 204 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 224 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 241 of file AutoDiffScalar.h.

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

Definition at line 216 of file AutoDiffScalar.h.

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

Definition at line 234 of file AutoDiffScalar.h.

template<typename _DerType>
const AutoDiffScalar<CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, const DerType> > Eigen::AutoDiffScalar< _DerType >::operator/ ( const Scalar other) const
inline

Definition at line 281 of file AutoDiffScalar.h.

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

Definition at line 317 of file AutoDiffScalar.h.

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

Definition at line 356 of file AutoDiffScalar.h.

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

Definition at line 363 of file AutoDiffScalar.h.

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

Definition at line 139 of file AutoDiffScalar.h.

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

Definition at line 153 of file AutoDiffScalar.h.

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

Definition at line 140 of file AutoDiffScalar.h.

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

Definition at line 154 of file AutoDiffScalar.h.

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

Definition at line 116 of file AutoDiffScalar.h.

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

Definition at line 123 of file AutoDiffScalar.h.

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

Definition at line 143 of file AutoDiffScalar.h.

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

Definition at line 157 of file AutoDiffScalar.h.

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

Definition at line 141 of file AutoDiffScalar.h.

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

Definition at line 155 of file AutoDiffScalar.h.

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

Definition at line 142 of file AutoDiffScalar.h.

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

Definition at line 156 of file AutoDiffScalar.h.

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

Definition at line 133 of file AutoDiffScalar.h.

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

Definition at line 134 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 151 of file AutoDiffScalar.h.

template<typename _DerType>
const AutoDiffScalar<CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, const DerType> > operator* ( const Scalar other,
const AutoDiffScalar< _DerType > &  a 
)
friend

Definition at line 257 of file AutoDiffScalar.h.

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

Definition at line 165 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 210 of file AutoDiffScalar.h.

template<typename _DerType>
const AutoDiffScalar<CwiseUnaryOp<internal::scalar_multiple_op<Scalar>, const DerType> > operator/ ( const Scalar other,
const AutoDiffScalar< _DerType > &  a 
)
friend

Definition at line 289 of file AutoDiffScalar.h.

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

Definition at line 146 of file AutoDiffScalar.h.

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

Definition at line 106 of file AutoDiffScalar.h.

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

Definition at line 147 of file AutoDiffScalar.h.

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

Definition at line 150 of file AutoDiffScalar.h.

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

Definition at line 148 of file AutoDiffScalar.h.

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

Definition at line 149 of file AutoDiffScalar.h.

Member Data Documentation

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

Definition at line 371 of file AutoDiffScalar.h.

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

Definition at line 370 of file AutoDiffScalar.h.


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


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:35:28