From ce90647fa58cd81c3561170947e2a507571b2e43 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 24 Jun 2016 11:34:02 +0200 Subject: Fix NumTraits --- unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'unsupported/Eigen/src') diff --git a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h index 0abd12210..8e40569c1 100755 --- a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h +++ b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h @@ -525,6 +525,23 @@ struct ScalarBinaryOpTraits, Bi typedef AutoDiffScalar ReturnType; }; + +// The following is an attempt to let Eigen's known about expression template, but that's more tricky! + +// template +// struct ScalarBinaryOpTraits,AutoDiffScalar, BinOp> +// { +// enum { Defined = 1 }; +// typedef AutoDiffScalar ReturnType; +// }; +// +// template +// struct ScalarBinaryOpTraits,AutoDiffScalar, BinOp> +// { +// enum { Defined = 1 };//internal::is_same::value }; +// typedef AutoDiffScalar ReturnType; +// }; + #define EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY(FUNC,CODE) \ template \ inline const Eigen::AutoDiffScalar< \ @@ -645,9 +662,10 @@ template struct NumTraits > : NumTraits< typename NumTraits::Real > { typedef AutoDiffScalar::Real,DerType::RowsAtCompileTime,DerType::ColsAtCompileTime, - DerType::Options, DerType::MaxRowsAtCompileTime, DerType::MaxColsAtCompileTime> > Real; + 0, DerType::MaxRowsAtCompileTime, DerType::MaxColsAtCompileTime> > Real; typedef AutoDiffScalar NonInteger; typedef AutoDiffScalar Nested; + typedef typename NumTraits::Literal Literal; enum{ RequireInitialization = 1 }; -- cgit v1.2.3