diff options
author | Hauke Heibel <hauke.heibel@gmail.com> | 2011-02-11 09:41:48 +0100 |
---|---|---|
committer | Hauke Heibel <hauke.heibel@gmail.com> | 2011-02-11 09:41:48 +0100 |
commit | bf79a3199c87ccfa254b3e4a4111888c010f2c52 (patch) | |
tree | 582734ec10a9f4072b3cd947d0608bb1b99081cb /Eigen | |
parent | fe70113fabd60533a38a25d743e30afb153709a6 (diff) |
Reduced error traces when mixing matrices with different scalar types.
Diffstat (limited to 'Eigen')
-rw-r--r-- | Eigen/src/Core/Matrix.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Eigen/src/Core/Matrix.h b/Eigen/src/Core/Matrix.h index d304fad60..2b7202c62 100644 --- a/Eigen/src/Core/Matrix.h +++ b/Eigen/src/Core/Matrix.h @@ -285,6 +285,11 @@ class Matrix EIGEN_STRONG_INLINE Matrix(const MatrixBase<OtherDerived>& other) : Base(other.rows() * other.cols(), other.rows(), other.cols()) { + // This test resides here, to bring the error messages closer to the user. Normally, these checks + // are performed deeply within the library, thus causing long and scary error traces. + EIGEN_STATIC_ASSERT((internal::is_same<Scalar, typename OtherDerived::Scalar>::value), + YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) + Base::_check_template_params(); Base::_set_noalias(other); } |