bug #100: add support for explicit scalar to Array conversion (as enable implicit conversion is much more tricky)

This commit is contained in:
Gael Guennebaud
2014-09-19 13:25:28 +02:00
parent 7b044c0ead
commit 0a18eecab3
4 changed files with 82 additions and 3 deletions

View File

@@ -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