diff options
author | Gael Guennebaud <g.gael@free.fr> | 2014-09-19 13:25:28 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2014-09-19 13:25:28 +0200 |
commit | 0a18eecab332d0dd87154b9eef7ff993a4bb625c (patch) | |
tree | 0dcda46bd8ab946b28792627b8b628e6e976f902 /Eigen/src/Core/Array.h | |
parent | 7b044c0eadd1e71ece88da150958326b1a9ac273 (diff) |
bug #100: add support for explicit scalar to Array conversion (as enable implicit conversion is much more tricky)
Diffstat (limited to 'Eigen/src/Core/Array.h')
-rw-r--r-- | Eigen/src/Core/Array.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/Eigen/src/Core/Array.h b/Eigen/src/Core/Array.h index 28d6f1443..eaee8847b 100644 --- a/Eigen/src/Core/Array.h +++ b/Eigen/src/Core/Array.h @@ -74,6 +74,21 @@ class Array { return Base::operator=(other); } + + /** Set all the entries to \a value. + * \sa DenseBase::setConstant(), DenseBase::fill() + */ + /* This overload is needed because the usage of + * using Base::operator=; + * fails on MSVC. Since the code below is working with GCC and MSVC, we skipped + * the usage of 'using'. This should be done only for operator=. + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Array& operator=(const Scalar &value) + { + Base::setConstant(value); + return *this; + } /** Copies the value of the expression \a other into \c *this with automatic resizing. * @@ -99,7 +114,7 @@ class Array { return Base::_set(other); } - + /** Default constructor. * * For fixed-size matrices, does nothing. @@ -144,7 +159,6 @@ class Array } #endif - #ifndef EIGEN_PARSED_BY_DOXYGEN template<typename T> EIGEN_DEVICE_FUNC |