Go to the documentation of this file.
10 #ifndef EIGEN_AUTODIFF_SCALAR_H
11 #define EIGEN_AUTODIFF_SCALAR_H
17 template<
typename A,
typename B>
23 template<
typename A,
typename B>
35 template<
typename NewDerType>
66 template<
typename DerivativeType>
68 :
public internal::auto_diff_special_op
69 <DerivativeType, !internal::is_same<typename internal::traits<typename internal::remove_all<DerivativeType>::type>::Scalar,
70 typename NumTraits<typename internal::traits<typename internal::remove_all<DerivativeType>::type>::Scalar>::Real>::value>
73 typedef internal::auto_diff_special_op
80 using Base::operator+;
81 using Base::operator*;
108 template<
typename OtherDerType>
110 #ifndef EIGEN_PARSED_BY_DOXYGEN
121 return s <<
a.value();
128 template<
typename OtherDerType>
207 template<
typename OtherDerType>
217 template<
typename OtherDerType>
221 (*this) = (*this) +
other;
234 (
a -
b.value(), -
b.derivatives());
243 template<
typename OtherDerType>
253 template<
typename OtherDerType>
257 *
this = *
this -
other;
325 template<
typename OtherDerType>
339 template<
typename OtherDerType>
353 *
this = *
this *
other;
357 template<
typename OtherDerType>
360 *
this = *
this *
other;
366 *
this = *
this /
other;
370 template<
typename OtherDerType>
373 *
this = *
this /
other;
385 template<
typename DerivativeType>
420 derived().value() +=
other;
429 derived().value() *
other,
430 derived().derivatives() *
other);
443 *
this = *
this *
other;
448 template<
typename DerivativeType>
456 template<
typename BinOp,
typename A,
typename B,
typename RefType>
463 template<
typename UnaryOp,
typename A,
typename RefType>
470 template<
typename UnaryOp,
typename A,
typename RefType>
474 template<
typename A_Scalar,
int A_Rows,
int A_Cols,
int A_Options,
int A_MaxRows,
int A_MaxCols,
typename B>
483 else if (B::SizeAtCompileTime==
Dynamic &&
a.size()!=0 &&
b.size()==0)
490 template<
typename A,
typename B_Scalar,
int B_Rows,
int B_Cols,
int B_Options,
int B_MaxRows,
int B_MaxCols>
499 else if (A::SizeAtCompileTime==
Dynamic &&
b.size()!=0 &&
a.size()==0)
506 template<
typename A_Scalar,
int A_Rows,
int A_Cols,
int A_Options,
int A_MaxRows,
int A_MaxCols,
507 typename B_Scalar,
int B_Rows,
int B_Cols,
int B_Options,
int B_MaxRows,
int B_MaxCols>
509 Matrix<B_Scalar, B_Rows, B_Cols, B_Options, B_MaxRows, B_MaxCols> > {
528 template<
typename DerType,
typename BinOp>
534 template<
typename DerType,
typename BinOp>
557 #define EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY(FUNC,CODE) \
558 template<typename DerType> \
559 inline const Eigen::AutoDiffScalar< \
560 EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(typename Eigen::internal::remove_all<DerType>::type, typename Eigen::internal::traits<typename Eigen::internal::remove_all<DerType>::type>::Scalar, product) > \
561 FUNC(const Eigen::AutoDiffScalar<DerType>& x) { \
562 using namespace Eigen; \
563 typedef typename Eigen::internal::traits<typename Eigen::internal::remove_all<DerType>::type>::Scalar Scalar; \
564 EIGEN_UNUSED_VARIABLE(sizeof(Scalar)); \
568 template<
typename DerType>
573 template<
typename DerType>
575 template<
typename DerType>
577 template<
typename DerType>
579 template<
typename DerType,
typename T>
582 return (
x <=
y ? ADS(
x) : ADS(
y));
584 template<
typename DerType,
typename T>
587 return (
x >=
y ? ADS(
x) : ADS(
y));
589 template<
typename DerType,
typename T>
592 return (
x <
y ? ADS(
x) : ADS(
y));
594 template<
typename DerType,
typename T>
597 return (
x >
y ? ADS(
x) : ADS(
y));
599 template<
typename DerType>
601 return (
x.value() <
y.value() ?
x :
y);
603 template<
typename DerType>
605 return (
x.value() >=
y.value() ?
x :
y);
641 template<typename DerType>
646 using namespace Eigen;
652 template<
typename DerTypeA,
typename DerTypeB>
662 Scalar squared_hypot =
a.value() *
a.value() +
b.value() *
b.value();
665 ret.derivatives() = (
a.derivatives() *
b.value() -
a.value() *
b.derivatives()) / squared_hypot;
707 0, DerTypeCleaned::MaxRowsAtCompileTime, DerTypeCleaned::MaxColsAtCompileTime> >
Real;
712 RequireInitialization = 1
720 template <
typename T>
722 :
public numeric_limits<typename T::Scalar> {};
724 template <
typename T>
726 :
public numeric_limits<typename T::Scalar> {};
730 #endif // EIGEN_AUTODIFF_SCALAR_H
const AutoDiffScalar< DerType > & conj(const AutoDiffScalar< DerType > &x)
const AutoDiffScalar< CwiseUnaryOp< internal::scalar_opposite_op< Scalar >, const DerType > > operator-() const
Namespace containing all symbols from the Eigen library.
NumTraits< Scalar >::Real Real
AutoDiffScalar< DerivativeType > & derived()
CleanedUpDerType< DerType >::type() max(const AutoDiffScalar< DerType > &x, const T &y)
const AutoDiffScalar< Matrix< typename internal::traits< typename internal::remove_all< DerTypeA >::type >::Scalar, Dynamic, 1 > > atan2(const AutoDiffScalar< DerTypeA > &a, const AutoDiffScalar< DerTypeB > &b)
A scalar type replacement with automatic differentiation capability.
Generic expression where a coefficient-wise binary operator is applied to two expressions.
const AutoDiffScalar< DerivativeType > & derived() const
Matrix< A_Scalar, A_Rows, A_Cols, A_Options, A_MaxRows, A_MaxCols > A
Jet< T, N > sin(const Jet< T, N > &f)
AutoDiffScalar< DerivativeType > & operator*=(const Scalar &other)
Eigen::internal::make_coherent_impl< Matrix< A_Scalar, A_Rows, A_Cols, A_Options, A_MaxRows, A_MaxCols >, Matrix< B_Scalar, B_Rows, B_Cols, B_Options, B_MaxRows, B_MaxCols > >::run static void run(A &a, B &b)
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)
bool operator!=(const Scalar &other) const
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
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
AutoDiffScalar & operator/=(const Scalar &other)
bool operator<=(const Scalar &other) const
AutoDiffScalar< Matrix< typename NumTraits< typename DerTypeCleaned::Scalar >::Real, DerTypeCleaned::RowsAtCompileTime, DerTypeCleaned::ColsAtCompileTime, 0, DerTypeCleaned::MaxRowsAtCompileTime, DerTypeCleaned::MaxColsAtCompileTime > > Real
const AutoDiffScalar< CwiseBinaryOp< internal::scalar_difference_op< Scalar >, const DerType, const typename internal::remove_all< OtherDerType >::type > > operator-(const AutoDiffScalar< OtherDerType > &other) const
const DerType & derivatives() const
AutoDiffScalar & operator+=(const Scalar &other)
internal::traits< DerType >::Scalar Scalar
const EIGEN_DEVICE_FUNC LogReturnType log() const
Determines whether the given binary operation of two numeric types is allowed and what the scalar ret...
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Abs2ReturnType abs2() const
bool operator>=(const AutoDiffScalar< OtherDerType > &b) const
const AutoDiffScalar< CwiseBinaryOp< internal::scalar_sum_op< Scalar >, const DerType, const typename internal::remove_all< OtherDerType >::type > > operator+(const AutoDiffScalar< OtherDerType > &other) const
friend std::ostream & operator<<(std::ostream &s, const AutoDiffScalar &a)
AutoDiffScalar< DerType > NonInteger
const EIGEN_DEVICE_FUNC AsinReturnType asin() const
const EIGEN_DEVICE_FUNC ExpReturnType exp() const
internal::remove_all< DerType >::type DerTypeCleaned
Eigen::internal::make_coherent_impl< Matrix< A_Scalar, A_Rows, A_Cols, A_Options, A_MaxRows, A_MaxCols >, Matrix< B_Scalar, B_Rows, B_Cols, B_Options, B_MaxRows, B_MaxCols > >::A Matrix< A_Scalar, A_Rows, A_Cols, A_Options, A_MaxRows, A_MaxCols > A
AutoDiffScalar & operator+=(const AutoDiffScalar< OtherDerType > &other)
Jet< T, N > acos(const Jet< T, N > &f)
AutoDiffScalar< NewDerType > MakeAutoDiffScalar(const typename NewDerType::Scalar &value, const NewDerType &der)
const AutoDiffScalar< DerType & > operator-(const Scalar &b) const
friend bool operator!=(const Scalar &a, const AutoDiffScalar &b)
Jet< T, N > cos(const Jet< T, N > &f)
bool operator>(const Scalar &other) const
bool operator<=(const AutoDiffScalar< OtherDerType > &b) const
Generic expression of a matrix where all coefficients are defined by a functor.
AutoDiffScalar & operator=(const Scalar &other)
const EIGEN_DEVICE_FUNC CoshReturnType cosh() const
const AutoDiffScalar< DerType & > operator+(const Scalar &other) const
const friend AutoDiffScalar< EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(DerType, Scalar, product) > operator/(const Scalar &other, const AutoDiffScalar &a)
bool operator==(const AutoDiffScalar< OtherDerType > &b) const
AutoDiffScalar & operator-=(const AutoDiffScalar< OtherDerType > &other)
remove_all< DerivativeType >::type DerType
void make_coherent_expression(CwiseBinaryOp< BinOp, A, B > xpr, const RefType &ref)
const friend AutoDiffScalar< DerType & > operator+(const Real &a, const AutoDiffScalar< DerivativeType > &b)
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE internal::remove_all< XprTypeNested >::type & nestedExpression() const
const Scalar & value() const
AutoDiffScalar(const Real &value)
AutoDiffScalar(const Scalar &value, const DerType &der)
const friend AutoDiffScalar< CwiseUnaryOp< internal::scalar_opposite_op< Scalar >, const DerType > > operator-(const Scalar &a, const AutoDiffScalar &b)
AutoDiffScalar< typename Eigen::internal::remove_all< DerType >::type::PlainObject > type
AutoDiffScalar & operator-=(const Scalar &other)
NumTraits< typename DerTypeCleaned::Scalar >::Literal Literal
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
bool operator<(const Scalar &other) const
const EIGEN_DEVICE_FUNC TanReturnType tan() const
Jet< T, N > pow(const Jet< T, N > &f, double g)
#define EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(EXPR, SCALAR, OPNAME)
const friend AutoDiffScalar< EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(DerType, Scalar, product) > operator*(const Scalar &other, const AutoDiffScalar &a)
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorUInt128< uint64_t, uint64_t > operator*(const TensorUInt128< HL, LL > &lhs, const TensorUInt128< HR, LR > &rhs)
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE _RhsNested & rhs() const
bool operator!=(const AutoDiffScalar< OtherDerType > &b) const
friend bool operator==(const Scalar &a, const AutoDiffScalar &b)
AnnoyingScalar atan2(const AnnoyingScalar &y, const AnnoyingScalar &x)
EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY(abs, using std::abs;return Eigen::MakeAutoDiffScalar(abs(x.value()), x.derivatives() *(x.value()< 0 ? -1 :1));) EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY(abs2
const AutoDiffScalar< EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(DerType, Scalar, product) > operator*(const Scalar &other) const
bool operator>=(const Scalar &other) const
AutoDiffScalar & operator*=(const Scalar &other)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE TensorUInt128< uint64_t, uint64_t > operator-(const TensorUInt128< HL, LL > &lhs, const TensorUInt128< HR, LR > &rhs)
const AutoDiffScalar< DerType > & real(const AutoDiffScalar< DerType > &x)
internal::remove_all< DerivativeType >::type DerType
const AutoDiffScalar< typename CwiseUnaryOp< bind2nd_op< scalar_product_op< Scalar, Real > >, DerType >::Type > operator*(const Real &other) const
const friend AutoDiffScalar< DerType & > operator+(const Scalar &a, const AutoDiffScalar &b)
EIGEN_DEVICE_FUNC bool abs2(bool x)
AutoDiffScalar(const Scalar &value, int nbDer, int derNumber)
const EIGEN_DEVICE_FUNC TanhReturnType tanh() const
DerType::Scalar imag(const AutoDiffScalar< DerType > &)
AutoDiffScalar & operator=(const AutoDiffScalar &other)
friend bool operator<=(const Scalar &a, const AutoDiffScalar &b)
Generic expression where a coefficient-wise unary operator is applied to an expression.
NumTraits< Scalar >::Real Real
traits< DerType >::Scalar Scalar
void make_coherent(const A &a, const B &b)
const AutoDiffScalar< DerType & > operator+(const Real &other) const
Reference counting helper.
AutoDiffScalar< DerType > ReturnType
AutoDiffScalar & operator*=(const AutoDiffScalar< OtherDerType > &other)
AutoDiffScalar(const AutoDiffScalar &other)
void product(const MatrixType &m)
AutoDiffScalar< DerType > Nested
bool operator==(const Scalar &other) const
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE TensorUInt128< uint64_t, uint64_t > operator+(const TensorUInt128< HL, LL > &lhs, const TensorUInt128< HR, LR > &rhs)
The matrix class, also used for vectors and row-vectors.
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
CleanedUpDerType< DerType >::type() min(const AutoDiffScalar< DerType > &x, const T &y)
const AutoDiffScalar< EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(DerType, Scalar, product) > operator/(const Scalar &other) const
static void run(A &, B &)
const EIGEN_DEVICE_FUNC SinhReturnType sinh() const
Eigen::internal::make_coherent_impl< Matrix< A_Scalar, A_Rows, A_Cols, A_Options, A_MaxRows, A_MaxCols >, Matrix< B_Scalar, B_Rows, B_Cols, B_Options, B_MaxRows, B_MaxCols > >::B Matrix< B_Scalar, B_Rows, B_Cols, B_Options, B_MaxRows, B_MaxCols > B
AutoDiffScalar & operator/=(const AutoDiffScalar< OtherDerType > &other)
Matrix< B_Scalar, B_Rows, B_Cols, B_Options, B_MaxRows, B_MaxCols > B
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Jet< T, N > sqrt(const Jet< T, N > &f)
AutoDiffScalar< DerType > ReturnType
const friend AutoDiffScalar< typename CwiseUnaryOp< bind1st_op< scalar_product_op< Real, Scalar > >, DerType >::Type > operator*(const Real &other, const AutoDiffScalar< DerivativeType > &a)
static void run(A &a, B &b)
AutoDiffScalar< DerivativeType > & operator+=(const Real &other)
friend bool operator>=(const Scalar &a, const AutoDiffScalar &b)
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE _LhsNested & lhs() const
static void run(A &a, B &b)
AutoDiffScalar & operator=(const AutoDiffScalar< OtherDerType > &other)
gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:31:58