diff options
author | Gael Guennebaud <g.gael@free.fr> | 2011-09-23 16:28:26 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2011-09-23 16:28:26 +0200 |
commit | d8ae978b65af70506f9aee2203139b9e10c93cf1 (patch) | |
tree | 7b137c42b36524f09550f21844edeccbb5975fa6 /unsupported | |
parent | 823b2105b660ad9953036eea00da61bd2822d7e0 (diff) |
fix some compilation issues
Diffstat (limited to 'unsupported')
-rw-r--r-- | unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h | 6 | ||||
-rw-r--r-- | unsupported/test/autodiff.cpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h index 0afea3b7d..ee1f16b7e 100644 --- a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h +++ b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h @@ -495,8 +495,8 @@ template<typename A_Scalar, int A_Rows, int A_Cols, int A_Options, int A_MaxRows typedef Matrix<A_Scalar, A_Rows, A_Cols, A_Options, A_MaxRows, A_MaxCols> ReturnType; }; -template<typename DerType, typename T> -struct scalar_product_traits<AutoDiffScalar<DerType>,T> +template<typename DerType> +struct scalar_product_traits<AutoDiffScalar<DerType>,typename DerType::Scalar> { typedef AutoDiffScalar<DerType> ReturnType; }; @@ -605,7 +605,7 @@ EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY(acos, template<typename DerType> struct NumTraits<AutoDiffScalar<DerType> > : NumTraits< typename NumTraits<typename DerType::Scalar>::Real > { - typedef AutoDiffScalar<Matrix<typename NumTraits<typename DerType::Scalar>::Real,DerType::ColsAtCompileTime,DerType::RowsAtCompileTime> > Real; + typedef AutoDiffScalar<Matrix<typename NumTraits<typename DerType::Scalar>::Real,DerType::RowsAtCompileTime,DerType::ColsAtCompileTime> > Real; typedef AutoDiffScalar<DerType> NonInteger; typedef AutoDiffScalar<DerType>& Nested; enum{ diff --git a/unsupported/test/autodiff.cpp b/unsupported/test/autodiff.cpp index 3bc360548..7ce4b4dee 100644 --- a/unsupported/test/autodiff.cpp +++ b/unsupported/test/autodiff.cpp @@ -40,7 +40,7 @@ template<typename Vector> EIGEN_DONT_INLINE typename Vector::Scalar foo(const Vector& p) { typedef typename Vector::Scalar Scalar; - return (p-Vector(Scalar(-1),Scalar(1.))).norm(); + return (p-Vector(Scalar(-1),Scalar(1.))).norm() + (p.array() * p.array()).sum() + p.dot(p); } template<typename _Scalar, int NX=Dynamic, int NY=Dynamic> |