diff options
author | Gael Guennebaud <g.gael@free.fr> | 2013-03-20 21:20:13 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2013-03-20 21:20:13 +0100 |
commit | 225fd0f57924daaafc0024a40201f68556984384 (patch) | |
tree | e80a6a8ab2aa9497b874079be9468146bae84f66 /unsupported/Eigen/src/AutoDiff | |
parent | c519be2bac43aa8ccaa8d568c3bfafd311286a9f (diff) |
adapt AutoDiff to scalar_product_traits
Diffstat (limited to 'unsupported/Eigen/src/AutoDiff')
-rw-r--r-- | unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h index 2be920532..bb49191b7 100644 --- a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h +++ b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h @@ -489,20 +489,32 @@ struct make_coherent_impl<Matrix<A_Scalar, A_Rows, A_Cols, A_Options, A_MaxRows, } }; -template<typename A_Scalar, int A_Rows, int A_Cols, int A_Options, int A_MaxRows, int A_MaxCols> struct scalar_product_traits<Matrix<A_Scalar, A_Rows, A_Cols, A_Options, A_MaxRows, A_MaxCols>,A_Scalar> +template<typename A_Scalar, int A_Rows, int A_Cols, int A_Options, int A_MaxRows, int A_MaxCols> +struct scalar_product_traits<Matrix<A_Scalar, A_Rows, A_Cols, A_Options, A_MaxRows, A_MaxCols>,A_Scalar> { - typedef Matrix<A_Scalar, A_Rows, A_Cols, A_Options, A_MaxRows, A_MaxCols> ReturnType; + enum { Defined = 1 }; + typedef Matrix<A_Scalar, A_Rows, A_Cols, A_Options, A_MaxRows, A_MaxCols> ReturnType; }; -template<typename A_Scalar, int A_Rows, int A_Cols, int A_Options, int A_MaxRows, int A_MaxCols> struct scalar_product_traits<A_Scalar, Matrix<A_Scalar, A_Rows, A_Cols, A_Options, A_MaxRows, A_MaxCols> > +template<typename A_Scalar, int A_Rows, int A_Cols, int A_Options, int A_MaxRows, int A_MaxCols> +struct scalar_product_traits<A_Scalar, Matrix<A_Scalar, A_Rows, A_Cols, A_Options, A_MaxRows, A_MaxCols> > { - typedef Matrix<A_Scalar, A_Rows, A_Cols, A_Options, A_MaxRows, A_MaxCols> ReturnType; + enum { Defined = 1 }; + typedef Matrix<A_Scalar, A_Rows, A_Cols, A_Options, A_MaxRows, A_MaxCols> ReturnType; }; template<typename DerType> struct scalar_product_traits<AutoDiffScalar<DerType>,typename DerType::Scalar> { - typedef AutoDiffScalar<DerType> ReturnType; + enum { Defined = 1 }; + typedef AutoDiffScalar<DerType> ReturnType; +}; + +template<typename DerType> +struct scalar_product_traits<typename DerType::Scalar,AutoDiffScalar<DerType> > +{ + enum { Defined = 1 }; + typedef AutoDiffScalar<DerType> ReturnType; }; } // end namespace internal |