aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/geo_quaternion.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2012-11-06 15:25:50 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2012-11-06 15:25:50 +0100
commita76fbbf39777827200455477a9e3557b6063913f (patch)
tree6a03f8fcb163fa2c3dc2267c52fd1204f5490309 /test/geo_quaternion.cpp
parent959ef37006e60f68b9a9e667bf9da2e14eb0e8af (diff)
Fix bug #314:
- remove most of the metaprogramming kung fu in MathFunctions.h (only keep functions that differs from the std) - remove the overloads for array expression that were in the std namespace
Diffstat (limited to 'test/geo_quaternion.cpp')
-rw-r--r--test/geo_quaternion.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/test/geo_quaternion.cpp b/test/geo_quaternion.cpp
index 6e6922864..c3fceafdf 100644
--- a/test/geo_quaternion.cpp
+++ b/test/geo_quaternion.cpp
@@ -23,6 +23,7 @@ template<typename T> T bounded_acos(T v)
template<typename QuatType> void check_slerp(const QuatType& q0, const QuatType& q1)
{
+ using std::abs;
typedef typename QuatType::Scalar Scalar;
typedef Matrix<Scalar,3,1> VectorType;
typedef AngleAxis<Scalar> AA;
@@ -36,9 +37,9 @@ template<typename QuatType> void check_slerp(const QuatType& q0, const QuatType&
{
QuatType q = q0.slerp(t,q1);
Scalar theta = AA(q*q0.inverse()).angle();
- VERIFY(internal::abs(q.norm() - 1) < largeEps);
+ VERIFY(abs(q.norm() - 1) < largeEps);
if(theta_tot==0) VERIFY(theta_tot==0);
- else VERIFY(internal::abs(theta/theta_tot - t) < largeEps);
+ else VERIFY(abs(theta/theta_tot - t) < largeEps);
}
}
@@ -47,7 +48,7 @@ template<typename Scalar, int Options> void quaternion(void)
/* this test covers the following files:
Quaternion.h
*/
-
+ using std::abs;
typedef Matrix<Scalar,3,3> Matrix3;
typedef Matrix<Scalar,3,1> Vector3;
typedef Matrix<Scalar,4,1> Vector4;
@@ -82,13 +83,13 @@ template<typename Scalar, int Options> void quaternion(void)
q2 = AngleAxisx(a, v1.normalized());
// angular distance
- Scalar refangle = internal::abs(AngleAxisx(q1.inverse()*q2).angle());
+ Scalar refangle = abs(AngleAxisx(q1.inverse()*q2).angle());
if (refangle>Scalar(M_PI))
refangle = Scalar(2)*Scalar(M_PI) - refangle;
if((q1.coeffs()-q2.coeffs()).norm() > 10*largeEps)
{
- VERIFY_IS_MUCH_SMALLER_THAN(internal::abs(q1.angularDistance(q2) - refangle), Scalar(1));
+ VERIFY_IS_MUCH_SMALLER_THAN(abs(q1.angularDistance(q2) - refangle), Scalar(1));
}
// rotation matrix conversion
@@ -109,7 +110,7 @@ template<typename Scalar, int Options> void quaternion(void)
// Do not execute the test if the rotation angle is almost zero, or
// the rotation axis and v1 are almost parallel.
- if (internal::abs(aa.angle()) > 5*test_precision<Scalar>()
+ if (abs(aa.angle()) > 5*test_precision<Scalar>()
&& (aa.axis() - v1.normalized()).norm() < 1.99
&& (aa.axis() + v1.normalized()).norm() < 1.99)
{