2009-02-17 17:53:05 +08:00
|
|
|
// This file is part of Eigen, a lightweight C++ template library
|
2009-05-23 02:25:33 +08:00
|
|
|
// for linear algebra.
|
2009-02-17 17:53:05 +08:00
|
|
|
//
|
2010-06-25 05:21:58 +08:00
|
|
|
// Copyright (C) 2008-2009 Gael Guennebaud <gael.guennebaud@inria.fr>
|
2009-11-13 23:41:51 +08:00
|
|
|
// Copyright (C) 2009 Mathieu Gautier <mathieu.gautier@cea.fr>
|
2009-02-17 17:53:05 +08:00
|
|
|
//
|
2012-07-14 02:42:47 +08:00
|
|
|
// This Source Code Form is subject to the terms of the Mozilla
|
|
|
|
// Public License v. 2.0. If a copy of the MPL was not distributed
|
|
|
|
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2009-02-17 17:53:05 +08:00
|
|
|
|
|
|
|
#include "main.h"
|
|
|
|
#include <Eigen/Geometry>
|
|
|
|
#include <Eigen/LU>
|
|
|
|
#include <Eigen/SVD>
|
2018-07-19 05:34:34 +08:00
|
|
|
#include "AnnoyingScalar.h"
|
2009-02-17 17:53:05 +08:00
|
|
|
|
2011-12-24 05:39:32 +08:00
|
|
|
template<typename T> T bounded_acos(T v)
|
|
|
|
{
|
|
|
|
using std::acos;
|
|
|
|
using std::min;
|
|
|
|
using std::max;
|
|
|
|
return acos((max)(T(-1),(min)(v,T(1))));
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename QuatType> void check_slerp(const QuatType& q0, const QuatType& q1)
|
|
|
|
{
|
2012-11-06 22:25:50 +08:00
|
|
|
using std::abs;
|
2011-12-24 05:39:32 +08:00
|
|
|
typedef typename QuatType::Scalar Scalar;
|
|
|
|
typedef AngleAxis<Scalar> AA;
|
|
|
|
|
|
|
|
Scalar largeEps = test_precision<Scalar>();
|
|
|
|
|
|
|
|
Scalar theta_tot = AA(q1*q0.inverse()).angle();
|
2016-05-05 19:35:45 +08:00
|
|
|
if(theta_tot>Scalar(EIGEN_PI))
|
2016-05-26 23:42:12 +08:00
|
|
|
theta_tot = Scalar(2.)*Scalar(EIGEN_PI)-theta_tot;
|
2013-07-12 22:40:02 +08:00
|
|
|
for(Scalar t=0; t<=Scalar(1.001); t+=Scalar(0.1))
|
2011-12-24 05:39:32 +08:00
|
|
|
{
|
|
|
|
QuatType q = q0.slerp(t,q1);
|
|
|
|
Scalar theta = AA(q*q0.inverse()).angle();
|
2012-11-06 22:25:50 +08:00
|
|
|
VERIFY(abs(q.norm() - 1) < largeEps);
|
2011-12-24 05:39:32 +08:00
|
|
|
if(theta_tot==0) VERIFY(theta_tot==0);
|
2013-07-12 20:30:28 +08:00
|
|
|
else VERIFY(abs(theta - t * theta_tot) < largeEps);
|
2011-12-24 05:39:32 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-27 22:14:30 +08:00
|
|
|
template<typename Scalar, int Options> void quaternion(void)
|
2009-02-17 17:53:05 +08:00
|
|
|
{
|
|
|
|
/* this test covers the following files:
|
|
|
|
Quaternion.h
|
|
|
|
*/
|
2012-11-06 22:25:50 +08:00
|
|
|
using std::abs;
|
2009-02-17 17:53:05 +08:00
|
|
|
typedef Matrix<Scalar,3,1> Vector3;
|
2015-12-01 16:45:56 +08:00
|
|
|
typedef Matrix<Scalar,3,3> Matrix3;
|
2011-01-27 22:14:30 +08:00
|
|
|
typedef Quaternion<Scalar,Options> Quaternionx;
|
2009-02-17 17:53:05 +08:00
|
|
|
typedef AngleAxis<Scalar> AngleAxisx;
|
|
|
|
|
|
|
|
Scalar largeEps = test_precision<Scalar>();
|
2010-10-26 04:13:49 +08:00
|
|
|
if (internal::is_same<Scalar,float>::value)
|
2016-05-23 00:17:04 +08:00
|
|
|
largeEps = Scalar(1e-3);
|
2009-02-17 17:53:05 +08:00
|
|
|
|
2010-10-25 22:15:22 +08:00
|
|
|
Scalar eps = internal::random<Scalar>() * Scalar(1e-2);
|
2009-02-17 17:53:05 +08:00
|
|
|
|
|
|
|
Vector3 v0 = Vector3::Random(),
|
|
|
|
v1 = Vector3::Random(),
|
|
|
|
v2 = Vector3::Random(),
|
|
|
|
v3 = Vector3::Random();
|
|
|
|
|
2015-06-10 23:12:10 +08:00
|
|
|
Scalar a = internal::random<Scalar>(-Scalar(EIGEN_PI), Scalar(EIGEN_PI)),
|
|
|
|
b = internal::random<Scalar>(-Scalar(EIGEN_PI), Scalar(EIGEN_PI));
|
2009-02-17 17:53:05 +08:00
|
|
|
|
|
|
|
// Quaternion: Identity(), setIdentity();
|
|
|
|
Quaternionx q1, q2;
|
|
|
|
q2.setIdentity();
|
|
|
|
VERIFY_IS_APPROX(Quaternionx(Quaternionx::Identity()).coeffs(), q2.coeffs());
|
|
|
|
q1.coeffs().setRandom();
|
|
|
|
VERIFY_IS_APPROX(q1.coeffs(), (q1*q2).coeffs());
|
|
|
|
|
2010-01-28 17:32:44 +08:00
|
|
|
// concatenation
|
|
|
|
q1 *= q2;
|
|
|
|
|
2009-02-17 17:53:05 +08:00
|
|
|
q1 = AngleAxisx(a, v0.normalized());
|
|
|
|
q2 = AngleAxisx(a, v1.normalized());
|
|
|
|
|
|
|
|
// angular distance
|
2012-11-06 22:25:50 +08:00
|
|
|
Scalar refangle = abs(AngleAxisx(q1.inverse()*q2).angle());
|
2015-06-10 23:12:10 +08:00
|
|
|
if (refangle>Scalar(EIGEN_PI))
|
|
|
|
refangle = Scalar(2)*Scalar(EIGEN_PI) - refangle;
|
2009-02-17 17:53:05 +08:00
|
|
|
|
2018-07-19 05:34:34 +08:00
|
|
|
if((q1.coeffs()-q2.coeffs()).norm() > Scalar(10)*largeEps)
|
2009-02-17 17:53:05 +08:00
|
|
|
{
|
2012-11-06 22:25:50 +08:00
|
|
|
VERIFY_IS_MUCH_SMALLER_THAN(abs(q1.angularDistance(q2) - refangle), Scalar(1));
|
2009-02-17 17:53:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// rotation matrix conversion
|
|
|
|
VERIFY_IS_APPROX(q1 * v2, q1.toRotationMatrix() * v2);
|
|
|
|
VERIFY_IS_APPROX(q1 * q2 * v2,
|
|
|
|
q1.toRotationMatrix() * q2.toRotationMatrix() * v2);
|
|
|
|
|
|
|
|
VERIFY( (q2*q1).isApprox(q1*q2, largeEps)
|
|
|
|
|| !(q2 * q1 * v2).isApprox(q1.toRotationMatrix() * q2.toRotationMatrix() * v2));
|
|
|
|
|
|
|
|
q2 = q1.toRotationMatrix();
|
|
|
|
VERIFY_IS_APPROX(q1*v1,q2*v1);
|
|
|
|
|
2015-12-01 16:45:56 +08:00
|
|
|
Matrix3 rot1(q1);
|
|
|
|
VERIFY_IS_APPROX(q1*v1,rot1*v1);
|
|
|
|
Quaternionx q3(rot1.transpose()*rot1);
|
|
|
|
VERIFY_IS_APPROX(q3*v1,v1);
|
|
|
|
|
2009-02-17 17:53:05 +08:00
|
|
|
|
|
|
|
// angle-axis conversion
|
2009-11-13 23:41:51 +08:00
|
|
|
AngleAxisx aa = AngleAxisx(q1);
|
2009-02-17 17:53:05 +08:00
|
|
|
VERIFY_IS_APPROX(q1 * v1, Quaternionx(aa) * v1);
|
2011-03-07 19:42:55 +08:00
|
|
|
|
|
|
|
// Do not execute the test if the rotation angle is almost zero, or
|
|
|
|
// the rotation axis and v1 are almost parallel.
|
2018-07-19 05:34:34 +08:00
|
|
|
if (abs(aa.angle()) > Scalar(5)*test_precision<Scalar>()
|
2016-05-05 19:35:45 +08:00
|
|
|
&& (aa.axis() - v1.normalized()).norm() < Scalar(1.99)
|
|
|
|
&& (aa.axis() + v1.normalized()).norm() < Scalar(1.99))
|
2011-03-07 19:42:55 +08:00
|
|
|
{
|
|
|
|
VERIFY_IS_NOT_APPROX(q1 * v1, Quaternionx(AngleAxisx(aa.angle()*2,aa.axis())) * v1);
|
|
|
|
}
|
2009-02-17 17:53:05 +08:00
|
|
|
|
|
|
|
// from two vector creation
|
|
|
|
VERIFY_IS_APPROX( v2.normalized(),(q2.setFromTwoVectors(v1, v2)*v1).normalized());
|
|
|
|
VERIFY_IS_APPROX( v1.normalized(),(q2.setFromTwoVectors(v1, v1)*v1).normalized());
|
|
|
|
VERIFY_IS_APPROX(-v1.normalized(),(q2.setFromTwoVectors(v1,-v1)*v1).normalized());
|
2010-10-26 04:13:49 +08:00
|
|
|
if (internal::is_same<Scalar,double>::value)
|
2009-10-29 06:19:29 +08:00
|
|
|
{
|
2010-01-05 02:13:08 +08:00
|
|
|
v3 = (v1.array()+eps).matrix();
|
2009-10-29 06:19:29 +08:00
|
|
|
VERIFY_IS_APPROX( v3.normalized(),(q2.setFromTwoVectors(v1, v3)*v1).normalized());
|
|
|
|
VERIFY_IS_APPROX(-v3.normalized(),(q2.setFromTwoVectors(v1,-v3)*v1).normalized());
|
|
|
|
}
|
2009-02-17 17:53:05 +08:00
|
|
|
|
2012-03-27 00:30:04 +08:00
|
|
|
// from two vector creation static function
|
|
|
|
VERIFY_IS_APPROX( v2.normalized(),(Quaternionx::FromTwoVectors(v1, v2)*v1).normalized());
|
|
|
|
VERIFY_IS_APPROX( v1.normalized(),(Quaternionx::FromTwoVectors(v1, v1)*v1).normalized());
|
|
|
|
VERIFY_IS_APPROX(-v1.normalized(),(Quaternionx::FromTwoVectors(v1,-v1)*v1).normalized());
|
|
|
|
if (internal::is_same<Scalar,double>::value)
|
|
|
|
{
|
|
|
|
v3 = (v1.array()+eps).matrix();
|
|
|
|
VERIFY_IS_APPROX( v3.normalized(),(Quaternionx::FromTwoVectors(v1, v3)*v1).normalized());
|
|
|
|
VERIFY_IS_APPROX(-v3.normalized(),(Quaternionx::FromTwoVectors(v1,-v3)*v1).normalized());
|
|
|
|
}
|
|
|
|
|
2009-02-17 17:53:05 +08:00
|
|
|
// inverse and conjugate
|
|
|
|
VERIFY_IS_APPROX(q1 * (q1.inverse() * v1), v1);
|
|
|
|
VERIFY_IS_APPROX(q1 * (q1.conjugate() * v1), v1);
|
|
|
|
|
|
|
|
// test casting
|
|
|
|
Quaternion<float> q1f = q1.template cast<float>();
|
|
|
|
VERIFY_IS_APPROX(q1f.template cast<Scalar>(),q1);
|
|
|
|
Quaternion<double> q1d = q1.template cast<double>();
|
|
|
|
VERIFY_IS_APPROX(q1d.template cast<Scalar>(),q1);
|
2011-10-31 21:23:41 +08:00
|
|
|
|
|
|
|
// test bug 369 - improper alignment.
|
|
|
|
Quaternionx *q = new Quaternionx;
|
|
|
|
delete q;
|
2011-12-24 05:39:32 +08:00
|
|
|
|
2016-05-20 19:21:34 +08:00
|
|
|
q1 = Quaternionx::UnitRandom();
|
|
|
|
q2 = Quaternionx::UnitRandom();
|
2011-12-24 05:39:32 +08:00
|
|
|
check_slerp(q1,q2);
|
|
|
|
|
|
|
|
q1 = AngleAxisx(b, v1.normalized());
|
2015-06-10 23:12:10 +08:00
|
|
|
q2 = AngleAxisx(b+Scalar(EIGEN_PI), v1.normalized());
|
2011-12-24 05:39:32 +08:00
|
|
|
check_slerp(q1,q2);
|
|
|
|
|
|
|
|
q1 = AngleAxisx(b, v1.normalized());
|
|
|
|
q2 = AngleAxisx(-b, -v1.normalized());
|
|
|
|
check_slerp(q1,q2);
|
|
|
|
|
2016-05-20 19:21:34 +08:00
|
|
|
q1 = Quaternionx::UnitRandom();
|
2011-12-24 05:39:32 +08:00
|
|
|
q2.coeffs() = -q1.coeffs();
|
|
|
|
check_slerp(q1,q2);
|
2009-02-17 17:53:05 +08:00
|
|
|
}
|
|
|
|
|
2009-11-13 23:41:51 +08:00
|
|
|
template<typename Scalar> void mapQuaternion(void){
|
|
|
|
typedef Map<Quaternion<Scalar>, Aligned> MQuaternionA;
|
2013-01-20 17:21:54 +08:00
|
|
|
typedef Map<const Quaternion<Scalar>, Aligned> MCQuaternionA;
|
2011-05-18 20:11:40 +08:00
|
|
|
typedef Map<Quaternion<Scalar> > MQuaternionUA;
|
2011-04-12 20:49:50 +08:00
|
|
|
typedef Map<const Quaternion<Scalar> > MCQuaternionUA;
|
2009-11-13 23:41:51 +08:00
|
|
|
typedef Quaternion<Scalar> Quaternionx;
|
2013-01-20 17:21:54 +08:00
|
|
|
typedef Matrix<Scalar,3,1> Vector3;
|
|
|
|
typedef AngleAxis<Scalar> AngleAxisx;
|
|
|
|
|
|
|
|
Vector3 v0 = Vector3::Random(),
|
|
|
|
v1 = Vector3::Random();
|
2015-06-10 23:12:10 +08:00
|
|
|
Scalar a = internal::random<Scalar>(-Scalar(EIGEN_PI), Scalar(EIGEN_PI));
|
2009-11-13 23:41:51 +08:00
|
|
|
|
2015-07-29 17:11:23 +08:00
|
|
|
EIGEN_ALIGN_MAX Scalar array1[4];
|
|
|
|
EIGEN_ALIGN_MAX Scalar array2[4];
|
|
|
|
EIGEN_ALIGN_MAX Scalar array3[4+1];
|
2011-01-27 22:14:30 +08:00
|
|
|
Scalar* array3unaligned = array3+1;
|
2013-01-20 17:21:54 +08:00
|
|
|
|
|
|
|
MQuaternionA mq1(array1);
|
|
|
|
MCQuaternionA mcq1(array1);
|
|
|
|
MQuaternionA mq2(array2);
|
|
|
|
MQuaternionUA mq3(array3unaligned);
|
|
|
|
MCQuaternionUA mcq3(array3unaligned);
|
2009-11-13 23:41:51 +08:00
|
|
|
|
2011-05-18 20:11:40 +08:00
|
|
|
// std::cerr << array1 << " " << array2 << " " << array3 << "\n";
|
2013-01-20 17:21:54 +08:00
|
|
|
mq1 = AngleAxisx(a, v0.normalized());
|
|
|
|
mq2 = mq1;
|
|
|
|
mq3 = mq1;
|
2009-11-13 23:41:51 +08:00
|
|
|
|
2013-01-20 17:21:54 +08:00
|
|
|
Quaternionx q1 = mq1;
|
|
|
|
Quaternionx q2 = mq2;
|
|
|
|
Quaternionx q3 = mq3;
|
2011-04-12 20:49:50 +08:00
|
|
|
Quaternionx q4 = MCQuaternionUA(array3unaligned);
|
2009-11-13 23:41:51 +08:00
|
|
|
|
|
|
|
VERIFY_IS_APPROX(q1.coeffs(), q2.coeffs());
|
|
|
|
VERIFY_IS_APPROX(q1.coeffs(), q3.coeffs());
|
2011-04-12 20:49:50 +08:00
|
|
|
VERIFY_IS_APPROX(q4.coeffs(), q3.coeffs());
|
2010-08-18 15:35:55 +08:00
|
|
|
#ifdef EIGEN_VECTORIZE
|
2011-05-18 20:11:40 +08:00
|
|
|
if(internal::packet_traits<Scalar>::Vectorizable)
|
|
|
|
VERIFY_RAISES_ASSERT((MQuaternionA(array3unaligned)));
|
2010-08-18 15:35:55 +08:00
|
|
|
#endif
|
2013-01-20 17:21:54 +08:00
|
|
|
|
|
|
|
VERIFY_IS_APPROX(mq1 * (mq1.inverse() * v1), v1);
|
|
|
|
VERIFY_IS_APPROX(mq1 * (mq1.conjugate() * v1), v1);
|
|
|
|
|
|
|
|
VERIFY_IS_APPROX(mcq1 * (mcq1.inverse() * v1), v1);
|
|
|
|
VERIFY_IS_APPROX(mcq1 * (mcq1.conjugate() * v1), v1);
|
|
|
|
|
|
|
|
VERIFY_IS_APPROX(mq3 * (mq3.inverse() * v1), v1);
|
|
|
|
VERIFY_IS_APPROX(mq3 * (mq3.conjugate() * v1), v1);
|
|
|
|
|
|
|
|
VERIFY_IS_APPROX(mcq3 * (mcq3.inverse() * v1), v1);
|
|
|
|
VERIFY_IS_APPROX(mcq3 * (mcq3.conjugate() * v1), v1);
|
|
|
|
|
|
|
|
VERIFY_IS_APPROX(mq1*mq2, q1*q2);
|
|
|
|
VERIFY_IS_APPROX(mq3*mq2, q3*q2);
|
|
|
|
VERIFY_IS_APPROX(mcq1*mq2, q1*q2);
|
|
|
|
VERIFY_IS_APPROX(mcq3*mq2, q3*q2);
|
2017-08-22 21:10:42 +08:00
|
|
|
|
|
|
|
// Bug 1461, compilation issue with Map<const Quat>::w(), and other reference/constness checks:
|
|
|
|
VERIFY_IS_APPROX(mcq3.coeffs().x() + mcq3.coeffs().y() + mcq3.coeffs().z() + mcq3.coeffs().w(), mcq3.coeffs().sum());
|
|
|
|
VERIFY_IS_APPROX(mcq3.x() + mcq3.y() + mcq3.z() + mcq3.w(), mcq3.coeffs().sum());
|
|
|
|
mq3.w() = 1;
|
|
|
|
const Quaternionx& cq3(q3);
|
|
|
|
VERIFY( &cq3.x() == &q3.x() );
|
|
|
|
const MQuaternionUA& cmq3(mq3);
|
|
|
|
VERIFY( &cmq3.x() == &mq3.x() );
|
|
|
|
// FIXME the following should be ok. The problem is that currently the LValueBit flag
|
2018-03-11 22:01:44 +08:00
|
|
|
// is used to determine whether we can return a coeff by reference or not, which is not enough for Map<const ...>.
|
2017-08-22 21:10:42 +08:00
|
|
|
//const MCQuaternionUA& cmcq3(mcq3);
|
|
|
|
//VERIFY( &cmcq3.x() == &mcq3.x() );
|
2009-11-13 23:41:51 +08:00
|
|
|
}
|
|
|
|
|
2011-01-27 22:14:30 +08:00
|
|
|
template<typename Scalar> void quaternionAlignment(void){
|
|
|
|
typedef Quaternion<Scalar,AutoAlign> QuaternionA;
|
|
|
|
typedef Quaternion<Scalar,DontAlign> QuaternionUA;
|
|
|
|
|
2015-07-29 17:11:23 +08:00
|
|
|
EIGEN_ALIGN_MAX Scalar array1[4];
|
|
|
|
EIGEN_ALIGN_MAX Scalar array2[4];
|
|
|
|
EIGEN_ALIGN_MAX Scalar array3[4+1];
|
2011-01-27 22:14:30 +08:00
|
|
|
Scalar* arrayunaligned = array3+1;
|
|
|
|
|
|
|
|
QuaternionA *q1 = ::new(reinterpret_cast<void*>(array1)) QuaternionA;
|
|
|
|
QuaternionUA *q2 = ::new(reinterpret_cast<void*>(array2)) QuaternionUA;
|
|
|
|
QuaternionUA *q3 = ::new(reinterpret_cast<void*>(arrayunaligned)) QuaternionUA;
|
|
|
|
|
|
|
|
q1->coeffs().setRandom();
|
|
|
|
*q2 = *q1;
|
|
|
|
*q3 = *q1;
|
|
|
|
|
|
|
|
VERIFY_IS_APPROX(q1->coeffs(), q2->coeffs());
|
|
|
|
VERIFY_IS_APPROX(q1->coeffs(), q3->coeffs());
|
2015-07-29 17:11:23 +08:00
|
|
|
#if defined(EIGEN_VECTORIZE) && EIGEN_MAX_STATIC_ALIGN_BYTES>0
|
2014-03-27 22:29:56 +08:00
|
|
|
if(internal::packet_traits<Scalar>::Vectorizable && internal::packet_traits<Scalar>::size<=4)
|
2011-05-18 20:11:40 +08:00
|
|
|
VERIFY_RAISES_ASSERT((::new(reinterpret_cast<void*>(arrayunaligned)) QuaternionA));
|
2011-01-27 22:14:30 +08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2011-04-12 20:49:50 +08:00
|
|
|
template<typename PlainObjectType> void check_const_correctness(const PlainObjectType&)
|
|
|
|
{
|
|
|
|
// there's a lot that we can't test here while still having this test compile!
|
|
|
|
// the only possible approach would be to run a script trying to compile stuff and checking that it fails.
|
|
|
|
// CMake can help with that.
|
|
|
|
|
|
|
|
// verify that map-to-const don't have LvalueBit
|
|
|
|
typedef typename internal::add_const<PlainObjectType>::type ConstPlainObjectType;
|
|
|
|
VERIFY( !(internal::traits<Map<ConstPlainObjectType> >::Flags & LvalueBit) );
|
|
|
|
VERIFY( !(internal::traits<Map<ConstPlainObjectType, Aligned> >::Flags & LvalueBit) );
|
|
|
|
VERIFY( !(Map<ConstPlainObjectType>::Flags & LvalueBit) );
|
|
|
|
VERIFY( !(Map<ConstPlainObjectType, Aligned>::Flags & LvalueBit) );
|
|
|
|
}
|
|
|
|
|
2018-07-19 05:34:34 +08:00
|
|
|
#if EIGEN_HAS_RVALUE_REFERENCES
|
|
|
|
|
|
|
|
// Regression for bug 1573
|
|
|
|
struct MovableClass {
|
2018-08-27 16:38:20 +08:00
|
|
|
// The following line is a workaround for gcc 4.7 and 4.8 (see bug 1573 comments).
|
|
|
|
static_assert(std::is_nothrow_move_constructible<Quaternionf>::value,"");
|
2018-07-19 05:34:34 +08:00
|
|
|
MovableClass() = default;
|
|
|
|
MovableClass(const MovableClass&) = default;
|
|
|
|
MovableClass(MovableClass&&) noexcept = default;
|
|
|
|
MovableClass& operator=(const MovableClass&) = default;
|
|
|
|
MovableClass& operator=(MovableClass&&) = default;
|
|
|
|
Quaternionf m_quat;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2018-07-17 20:46:15 +08:00
|
|
|
EIGEN_DECLARE_TEST(geo_quaternion)
|
2009-02-17 17:53:05 +08:00
|
|
|
{
|
|
|
|
for(int i = 0; i < g_repeat; i++) {
|
2011-01-27 22:14:30 +08:00
|
|
|
CALL_SUBTEST_1(( quaternion<float,AutoAlign>() ));
|
2011-04-12 20:49:50 +08:00
|
|
|
CALL_SUBTEST_1( check_const_correctness(Quaternionf()) );
|
2018-07-19 05:34:34 +08:00
|
|
|
CALL_SUBTEST_1(( quaternion<float,DontAlign>() ));
|
|
|
|
CALL_SUBTEST_1(( quaternionAlignment<float>() ));
|
|
|
|
CALL_SUBTEST_1( mapQuaternion<float>() );
|
|
|
|
|
2011-05-20 15:59:15 +08:00
|
|
|
CALL_SUBTEST_2(( quaternion<double,AutoAlign>() ));
|
|
|
|
CALL_SUBTEST_2( check_const_correctness(Quaterniond()) );
|
2018-07-19 05:34:34 +08:00
|
|
|
CALL_SUBTEST_2(( quaternion<double,DontAlign>() ));
|
|
|
|
CALL_SUBTEST_2(( quaternionAlignment<double>() ));
|
2011-05-18 20:11:40 +08:00
|
|
|
CALL_SUBTEST_2( mapQuaternion<double>() );
|
2018-07-19 05:34:34 +08:00
|
|
|
|
|
|
|
AnnoyingScalar::dont_throw = true;
|
|
|
|
CALL_SUBTEST_3(( quaternion<AnnoyingScalar,AutoAlign>() ));
|
2009-02-17 17:53:05 +08:00
|
|
|
}
|
|
|
|
}
|