aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/linearstructure.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2014-09-14 18:27:48 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2014-09-14 18:27:48 +0200
commitdfc54e1bbf99a069146025677b70e38755383df9 (patch)
treeee0fdd90f24e7f33ad26fa930f8879b95d83af50 /test/linearstructure.cpp
parent749b56f6af4f712ccc4235a4faf7c13e09b9f3a3 (diff)
Fix /= when using evaluator as in changeset 2d90484450f3934db3f5db39ef37967fb9444263
Diffstat (limited to 'test/linearstructure.cpp')
-rw-r--r--test/linearstructure.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/linearstructure.cpp b/test/linearstructure.cpp
index b627915ce..87dfa1b6b 100644
--- a/test/linearstructure.cpp
+++ b/test/linearstructure.cpp
@@ -9,7 +9,6 @@
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
static bool g_called;
-
#define EIGEN_SPECIAL_SCALAR_MULTIPLE_PLUGIN { g_called = true; }
#include "main.h"
@@ -107,4 +106,19 @@ void test_linearstructure()
CALL_SUBTEST_10( real_complex<Matrix4cd>() );
CALL_SUBTEST_10( real_complex<MatrixXcf>(10,10) );
}
+
+#ifdef EIGEN_TEST_PART_4
+ {
+ // make sure that /=scalar and /scalar do not overflow
+ // rational: 1.0/4.94e-320 overflow, but m/4.94e-320 should not
+ Matrix4d m2, m3;
+ m3 = m2 = Matrix4d::Random()*1e-20;
+ m2 = m2 / 4.9e-320;
+ VERIFY_IS_APPROX(m2.cwiseQuotient(m2), Matrix4d::Ones());
+ m3 /= 4.9e-320;
+ VERIFY_IS_APPROX(m3.cwiseQuotient(m3), Matrix4d::Ones());
+
+
+ }
+#endif
}