From e2775869588e1df2d19265eac5c167651168a414 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Wed, 28 Apr 2010 18:51:38 -0400 Subject: Complete rework of global math functions and NumTraits. * Now completely generic so all standard integer types (like char...) are supported. ** add unit test for that (integer_types). * NumTraits does no longer inherit numeric_limits * All math functions are now templated * Better guard (static asserts) against using certain math functions on integer types. --- test/adjoint.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test/adjoint.cpp') diff --git a/test/adjoint.cpp b/test/adjoint.cpp index b34112249..fc6c8897b 100644 --- a/test/adjoint.cpp +++ b/test/adjoint.cpp @@ -22,6 +22,8 @@ // License and a copy of the GNU General Public License along with // Eigen. If not, see . +#define EIGEN_NO_STATIC_ASSERT + #include "main.h" template void adjoint(const MatrixType& m) @@ -69,7 +71,7 @@ template void adjoint(const MatrixType& m) VERIFY(ei_isApprox(v3.dot(s1 * v1 + s2 * v2), s1*v3.dot(v1)+s2*v3.dot(v2), largerEps)); VERIFY_IS_APPROX(ei_conj(v1.dot(v2)), v2.dot(v1)); VERIFY_IS_APPROX(ei_abs(v1.dot(v1)), v1.squaredNorm()); - if(NumTraits::HasFloatingPoint) + if(!NumTraits::IsInteger) VERIFY_IS_APPROX(v1.squaredNorm(), v1.norm() * v1.norm()); VERIFY_IS_MUCH_SMALLER_THAN(ei_abs(vzero.dot(v1)), static_cast(1)); @@ -82,7 +84,7 @@ template void adjoint(const MatrixType& m) VERIFY_IS_APPROX(m1.conjugate()(r,c), ei_conj(m1(r,c))); VERIFY_IS_APPROX(m1.adjoint()(c,r), ei_conj(m1(r,c))); - if(NumTraits::HasFloatingPoint) + if(!NumTraits::IsInteger) { // check that Random().normalized() works: tricky as the random xpr must be evaluated by // normalized() in order to produce a consistent result. -- cgit v1.2.3