aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/adjoint.cpp
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2010-04-28 18:51:38 -0400
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2010-04-28 18:51:38 -0400
commite2775869588e1df2d19265eac5c167651168a414 (patch)
tree8ca0d2fdbc1f8945405fb3fd99c5634b60f3189f /test/adjoint.cpp
parent4f83d6ad1959f3c76cd5eb328ec65ced4ca4f339 (diff)
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.
Diffstat (limited to 'test/adjoint.cpp')
-rw-r--r--test/adjoint.cpp6
1 files changed, 4 insertions, 2 deletions
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 <http://www.gnu.org/licenses/>.
+#define EIGEN_NO_STATIC_ASSERT
+
#include "main.h"
template<typename MatrixType> void adjoint(const MatrixType& m)
@@ -69,7 +71,7 @@ template<typename MatrixType> 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<Scalar>::HasFloatingPoint)
+ if(!NumTraits<Scalar>::IsInteger)
VERIFY_IS_APPROX(v1.squaredNorm(), v1.norm() * v1.norm());
VERIFY_IS_MUCH_SMALLER_THAN(ei_abs(vzero.dot(v1)), static_cast<RealScalar>(1));
@@ -82,7 +84,7 @@ template<typename MatrixType> 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<Scalar>::HasFloatingPoint)
+ if(!NumTraits<Scalar>::IsInteger)
{
// check that Random().normalized() works: tricky as the random xpr must be evaluated by
// normalized() in order to produce a consistent result.