diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2008-12-22 19:17:44 +0000 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2008-12-22 19:17:44 +0000 |
commit | 4336cf3833d87bc1c8b4c9ef6f884547c80e31f0 (patch) | |
tree | 67fac7b672e66246d2d8d52642615d1c004b2636 /Eigen/src/Core/Dot.h | |
parent | f5a05e7ed159d771545767c430d12263e205ec87 (diff) |
* add unit-tests to check allowed and forbiddent mixing of different scalar types
* fix issues in Product revealed by this test
* in Dot.h forbid mixing of different types (at least for now, might allow real.dot(complex) in the future).
Diffstat (limited to 'Eigen/src/Core/Dot.h')
-rw-r--r-- | Eigen/src/Core/Dot.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Eigen/src/Core/Dot.h b/Eigen/src/Core/Dot.h index 86bebe246..18e81ac1c 100644 --- a/Eigen/src/Core/Dot.h +++ b/Eigen/src/Core/Dot.h @@ -266,6 +266,9 @@ MatrixBase<Derived>::dot(const MatrixBase<OtherDerived>& other) const EIGEN_STATIC_ASSERT_VECTOR_ONLY(_Nested) EIGEN_STATIC_ASSERT_VECTOR_ONLY(_OtherNested) EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(_Nested,_OtherNested) + EIGEN_STATIC_ASSERT((ei_is_same_type<Scalar, typename OtherDerived::Scalar>::ret), + YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) + ei_assert(size() == other.size()); return ei_dot_impl<_Nested, _OtherNested>::run(derived(), other.derived()); |