diff options
author | Gael Guennebaud <g.gael@free.fr> | 2011-02-21 11:00:07 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2011-02-21 11:00:07 +0100 |
commit | 2d5ea82807c4ae6ec1fbea928d01cbbdfaf7689f (patch) | |
tree | b06c5f68e972770244151fcb848306aef8be5d2d | |
parent | 3c00e3da03cdd6c4f13398fc792fa657e303d199 (diff) |
fix bug #176 (workaround a too aggressive optimization made by ICC)
-rw-r--r-- | test/jacobisvd.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/jacobisvd.cpp b/test/jacobisvd.cpp index 681852ffa..72681bb73 100644 --- a/test/jacobisvd.cpp +++ b/test/jacobisvd.cpp @@ -214,6 +214,9 @@ void jacobisvd_method() template<typename Scalar> EIGEN_DONT_INLINE Scalar zero() { return Scalar(0); } +// workaround aggressive optimization in ICC +template<typename T> EIGEN_DONT_INLINE T sub(T a, T b) { return a - b; } + template<typename MatrixType> void jacobisvd_inf_nan() { @@ -222,7 +225,7 @@ void jacobisvd_inf_nan() JacobiSVD<MatrixType> svd; typedef typename MatrixType::Scalar Scalar; Scalar some_inf = Scalar(1) / zero<Scalar>(); - VERIFY((some_inf - some_inf) != (some_inf - some_inf)); + VERIFY(sub(some_inf, some_inf) != sub(some_inf, some_inf)); svd.compute(MatrixType::Constant(10,10,some_inf), ComputeFullU | ComputeFullV); Scalar some_nan = zero<Scalar>() / zero<Scalar>(); |