OSVR-Core
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 >:
Eigen::internal::auto_diff_special_op< _DerType, !internal::is_same< internal::traits< internal::remove_all< _DerType >::type >::Scalar, NumTraits< internal::traits< internal::remove_all< _DerType >::type >::Scalar >::Real >::value >

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 internal::traits< DerType >::Scalar Scalar
 
typedef NumTraits< Scalar >::Real Real
 

Public Member Functions

 AutoDiffScalar ()
 Default constructor without any initialization. More...
 
 AutoDiffScalar (const Scalar &value, int nbDer, int derNumber)
 Constructs an active scalar from its value, and initializes the nbDer derivatives such that it corresponds to the derNumber -th variable.
 
 AutoDiffScalar (const Real &value)
 Conversion from a scalar constant to an active scalar. More...
 
 AutoDiffScalar (const Scalar &value, const DerType &der)
 Constructs an active scalar from its value and derivatives der.
 
template<typename OtherDerType >
 AutoDiffScalar (const AutoDiffScalar< OtherDerType > &other)
 
 AutoDiffScalar (const AutoDiffScalar &other)
 
template<typename OtherDerType >
AutoDiffScalaroperator= (const AutoDiffScalar< OtherDerType > &other)
 
AutoDiffScalaroperator= (const AutoDiffScalar &other)
 
const Scalar & value () const
 
Scalar & value ()
 
const DerTypederivatives () const
 
DerTypederivatives ()
 
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
 
const AutoDiffScalar< DerType & > operator+ (const Scalar &other) const
 
AutoDiffScalaroperator+= (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
 
template<typename OtherDerType >
AutoDiffScalaroperator+= (const AutoDiffScalar< OtherDerType > &other)
 
const AutoDiffScalar< DerType & > operator- (const Scalar &b) const
 
AutoDiffScalaroperator-= (const Scalar &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 >
AutoDiffScalaroperator-= (const AutoDiffScalar< OtherDerType > &other)
 
const AutoDiffScalar< CwiseUnaryOp< internal::scalar_opposite_op< Scalar >, const DerType > > operator- () const
 
const AutoDiffScalar< CwiseUnaryOp< internal::scalar_multiple_op< Scalar >, const DerType > > operator* (const Scalar &other) const
 
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 >
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)
 
AutoDiffScalaroperator/= (const Scalar &other)
 
template<typename OtherDerType >
AutoDiffScalaroperator/= (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)
 
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)
 
const AutoDiffScalar< CwiseUnaryOp< internal::scalar_multiple_op< Scalar >, const DerType > > operator/ (const Scalar &other, const AutoDiffScalar &a)
 

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.

Constructor & Destructor Documentation

§ AutoDiffScalar() [1/2]

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

Default constructor without any initialization.

§ AutoDiffScalar() [2/2]

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.


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