From 582b5e39bf5515a0277b8ecf9c40e09748dc7d98 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 17 Feb 2017 14:10:57 +0100 Subject: bug #1393: enable Matrix/Array explicit ctor from types with conversion operators (was ok with 3.2) --- Eigen/src/Core/PlainObjectBase.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Eigen/src/Core/PlainObjectBase.h') diff --git a/Eigen/src/Core/PlainObjectBase.h b/Eigen/src/Core/PlainObjectBase.h index 639fb92bf..77f4f6066 100644 --- a/Eigen/src/Core/PlainObjectBase.h +++ b/Eigen/src/Core/PlainObjectBase.h @@ -812,6 +812,13 @@ class PlainObjectBase : public internal::dense_xpr_base::type this->_set_noalias(other); } + // Initialize an arbitrary matrix from an object convertible to the Derived type. + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init1(const Derived& other){ + this->_set_noalias(other); + } + // Initialize an arbitrary matrix from a generic Eigen expression template EIGEN_DEVICE_FUNC @@ -834,7 +841,7 @@ class PlainObjectBase : public internal::dense_xpr_base::type this->derived() = r; } - // For fixed -size arrays: + // For fixed-size Array template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1(const Scalar& val0, @@ -846,6 +853,7 @@ class PlainObjectBase : public internal::dense_xpr_base::type Base::setConstant(val0); } + // For fixed-size Array template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _init1(const Index& val0, -- cgit v1.2.3