From 551bf5c66a3f29c8ac1f24f8439a6b85d0da79ac Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 18 Feb 2014 10:52:26 +0100 Subject: [PATCH] Get rid of DiagonalProduct --- Eigen/src/Core/DiagonalProduct.h | 12 ++++++++++++ Eigen/src/Core/MatrixBase.h | 7 +++++++ 2 files changed, 19 insertions(+) diff --git a/Eigen/src/Core/DiagonalProduct.h b/Eigen/src/Core/DiagonalProduct.h index c03a0c2e1..f5539df13 100644 --- a/Eigen/src/Core/DiagonalProduct.h +++ b/Eigen/src/Core/DiagonalProduct.h @@ -13,6 +13,7 @@ namespace Eigen { +#ifndef EIGEN_TEST_EVALUATORS namespace internal { template struct traits > @@ -124,6 +125,17 @@ MatrixBase::operator*(const DiagonalBase &a_diagonal) { return DiagonalProduct(derived(), a_diagonal.derived()); } +#else // EIGEN_TEST_EVALUATORS +/** \returns the diagonal matrix product of \c *this by the diagonal matrix \a diagonal. + */ +template +template +inline const Product +MatrixBase::operator*(const DiagonalBase &a_diagonal) const +{ + return Product(derived(),a_diagonal.derived()); +} +#endif // EIGEN_TEST_EVALUATORS } // end namespace Eigen diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h index 37e7408a4..6453145d0 100644 --- a/Eigen/src/Core/MatrixBase.h +++ b/Eigen/src/Core/MatrixBase.h @@ -215,10 +215,17 @@ template class MatrixBase template void applyOnTheRight(const EigenBase& other); +#ifndef EIGEN_TEST_EVALUATORS template EIGEN_DEVICE_FUNC const DiagonalProduct operator*(const DiagonalBase &diagonal) const; +#else // EIGEN_TEST_EVALUATORS + template + EIGEN_DEVICE_FUNC + const Product + operator*(const DiagonalBase &diagonal) const; +#endif // EIGEN_TEST_EVALUATORS template EIGEN_DEVICE_FUNC