1*bf2c3715SXin Li // This file is part of Eigen, a lightweight C++ template library
2*bf2c3715SXin Li // for linear algebra.
3*bf2c3715SXin Li //
4*bf2c3715SXin Li // Copyright (C) 2008-2009 Gael Guennebaud <[email protected]>
5*bf2c3715SXin Li // Copyright (C) 2009 Mathieu Gautier <[email protected]>
6*bf2c3715SXin Li //
7*bf2c3715SXin Li // This Source Code Form is subject to the terms of the Mozilla
8*bf2c3715SXin Li // Public License v. 2.0. If a copy of the MPL was not distributed
9*bf2c3715SXin Li // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10*bf2c3715SXin Li
11*bf2c3715SXin Li #include "main.h"
12*bf2c3715SXin Li #include <Eigen/Geometry>
13*bf2c3715SXin Li #include <Eigen/LU>
14*bf2c3715SXin Li #include <Eigen/SVD>
15*bf2c3715SXin Li #include "AnnoyingScalar.h"
16*bf2c3715SXin Li
bounded_acos(T v)17*bf2c3715SXin Li template<typename T> T bounded_acos(T v)
18*bf2c3715SXin Li {
19*bf2c3715SXin Li using std::acos;
20*bf2c3715SXin Li using std::min;
21*bf2c3715SXin Li using std::max;
22*bf2c3715SXin Li return acos((max)(T(-1),(min)(v,T(1))));
23*bf2c3715SXin Li }
24*bf2c3715SXin Li
check_slerp(const QuatType & q0,const QuatType & q1)25*bf2c3715SXin Li template<typename QuatType> void check_slerp(const QuatType& q0, const QuatType& q1)
26*bf2c3715SXin Li {
27*bf2c3715SXin Li using std::abs;
28*bf2c3715SXin Li typedef typename QuatType::Scalar Scalar;
29*bf2c3715SXin Li typedef AngleAxis<Scalar> AA;
30*bf2c3715SXin Li
31*bf2c3715SXin Li Scalar largeEps = test_precision<Scalar>();
32*bf2c3715SXin Li
33*bf2c3715SXin Li Scalar theta_tot = AA(q1*q0.inverse()).angle();
34*bf2c3715SXin Li if(theta_tot>Scalar(EIGEN_PI))
35*bf2c3715SXin Li theta_tot = Scalar(2.)*Scalar(EIGEN_PI)-theta_tot;
36*bf2c3715SXin Li for(Scalar t=0; t<=Scalar(1.001); t+=Scalar(0.1))
37*bf2c3715SXin Li {
38*bf2c3715SXin Li QuatType q = q0.slerp(t,q1);
39*bf2c3715SXin Li Scalar theta = AA(q*q0.inverse()).angle();
40*bf2c3715SXin Li VERIFY(abs(q.norm() - 1) < largeEps);
41*bf2c3715SXin Li if(theta_tot==0) VERIFY(theta_tot==0);
42*bf2c3715SXin Li else VERIFY(abs(theta - t * theta_tot) < largeEps);
43*bf2c3715SXin Li }
44*bf2c3715SXin Li }
45*bf2c3715SXin Li
quaternion(void)46*bf2c3715SXin Li template<typename Scalar, int Options> void quaternion(void)
47*bf2c3715SXin Li {
48*bf2c3715SXin Li /* this test covers the following files:
49*bf2c3715SXin Li Quaternion.h
50*bf2c3715SXin Li */
51*bf2c3715SXin Li using std::abs;
52*bf2c3715SXin Li typedef Matrix<Scalar,3,1> Vector3;
53*bf2c3715SXin Li typedef Matrix<Scalar,3,3> Matrix3;
54*bf2c3715SXin Li typedef Quaternion<Scalar,Options> Quaternionx;
55*bf2c3715SXin Li typedef AngleAxis<Scalar> AngleAxisx;
56*bf2c3715SXin Li
57*bf2c3715SXin Li Scalar largeEps = test_precision<Scalar>();
58*bf2c3715SXin Li if (internal::is_same<Scalar,float>::value)
59*bf2c3715SXin Li largeEps = Scalar(1e-3);
60*bf2c3715SXin Li
61*bf2c3715SXin Li Scalar eps = internal::random<Scalar>() * Scalar(1e-2);
62*bf2c3715SXin Li
63*bf2c3715SXin Li Vector3 v0 = Vector3::Random(),
64*bf2c3715SXin Li v1 = Vector3::Random(),
65*bf2c3715SXin Li v2 = Vector3::Random(),
66*bf2c3715SXin Li v3 = Vector3::Random();
67*bf2c3715SXin Li
68*bf2c3715SXin Li Scalar a = internal::random<Scalar>(-Scalar(EIGEN_PI), Scalar(EIGEN_PI)),
69*bf2c3715SXin Li b = internal::random<Scalar>(-Scalar(EIGEN_PI), Scalar(EIGEN_PI));
70*bf2c3715SXin Li
71*bf2c3715SXin Li // Quaternion: Identity(), setIdentity();
72*bf2c3715SXin Li Quaternionx q1, q2;
73*bf2c3715SXin Li q2.setIdentity();
74*bf2c3715SXin Li VERIFY_IS_APPROX(Quaternionx(Quaternionx::Identity()).coeffs(), q2.coeffs());
75*bf2c3715SXin Li q1.coeffs().setRandom();
76*bf2c3715SXin Li VERIFY_IS_APPROX(q1.coeffs(), (q1*q2).coeffs());
77*bf2c3715SXin Li
78*bf2c3715SXin Li #ifndef EIGEN_NO_IO
79*bf2c3715SXin Li // Printing
80*bf2c3715SXin Li std::ostringstream ss;
81*bf2c3715SXin Li ss << q2;
82*bf2c3715SXin Li VERIFY(ss.str() == "0i + 0j + 0k + 1");
83*bf2c3715SXin Li #endif
84*bf2c3715SXin Li
85*bf2c3715SXin Li // concatenation
86*bf2c3715SXin Li q1 *= q2;
87*bf2c3715SXin Li
88*bf2c3715SXin Li q1 = AngleAxisx(a, v0.normalized());
89*bf2c3715SXin Li q2 = AngleAxisx(a, v1.normalized());
90*bf2c3715SXin Li
91*bf2c3715SXin Li // angular distance
92*bf2c3715SXin Li Scalar refangle = abs(AngleAxisx(q1.inverse()*q2).angle());
93*bf2c3715SXin Li if (refangle>Scalar(EIGEN_PI))
94*bf2c3715SXin Li refangle = Scalar(2)*Scalar(EIGEN_PI) - refangle;
95*bf2c3715SXin Li
96*bf2c3715SXin Li if((q1.coeffs()-q2.coeffs()).norm() > Scalar(10)*largeEps)
97*bf2c3715SXin Li {
98*bf2c3715SXin Li VERIFY_IS_MUCH_SMALLER_THAN(abs(q1.angularDistance(q2) - refangle), Scalar(1));
99*bf2c3715SXin Li }
100*bf2c3715SXin Li
101*bf2c3715SXin Li // rotation matrix conversion
102*bf2c3715SXin Li VERIFY_IS_APPROX(q1 * v2, q1.toRotationMatrix() * v2);
103*bf2c3715SXin Li VERIFY_IS_APPROX(q1 * q2 * v2,
104*bf2c3715SXin Li q1.toRotationMatrix() * q2.toRotationMatrix() * v2);
105*bf2c3715SXin Li
106*bf2c3715SXin Li VERIFY( (q2*q1).isApprox(q1*q2, largeEps)
107*bf2c3715SXin Li || !(q2 * q1 * v2).isApprox(q1.toRotationMatrix() * q2.toRotationMatrix() * v2));
108*bf2c3715SXin Li
109*bf2c3715SXin Li q2 = q1.toRotationMatrix();
110*bf2c3715SXin Li VERIFY_IS_APPROX(q1*v1,q2*v1);
111*bf2c3715SXin Li
112*bf2c3715SXin Li Matrix3 rot1(q1);
113*bf2c3715SXin Li VERIFY_IS_APPROX(q1*v1,rot1*v1);
114*bf2c3715SXin Li Quaternionx q3(rot1.transpose()*rot1);
115*bf2c3715SXin Li VERIFY_IS_APPROX(q3*v1,v1);
116*bf2c3715SXin Li
117*bf2c3715SXin Li
118*bf2c3715SXin Li // angle-axis conversion
119*bf2c3715SXin Li AngleAxisx aa = AngleAxisx(q1);
120*bf2c3715SXin Li VERIFY_IS_APPROX(q1 * v1, Quaternionx(aa) * v1);
121*bf2c3715SXin Li
122*bf2c3715SXin Li // Do not execute the test if the rotation angle is almost zero, or
123*bf2c3715SXin Li // the rotation axis and v1 are almost parallel.
124*bf2c3715SXin Li if (abs(aa.angle()) > Scalar(5)*test_precision<Scalar>()
125*bf2c3715SXin Li && (aa.axis() - v1.normalized()).norm() < Scalar(1.99)
126*bf2c3715SXin Li && (aa.axis() + v1.normalized()).norm() < Scalar(1.99))
127*bf2c3715SXin Li {
128*bf2c3715SXin Li VERIFY_IS_NOT_APPROX(q1 * v1, Quaternionx(AngleAxisx(aa.angle()*2,aa.axis())) * v1);
129*bf2c3715SXin Li }
130*bf2c3715SXin Li
131*bf2c3715SXin Li // from two vector creation
132*bf2c3715SXin Li VERIFY_IS_APPROX( v2.normalized(),(q2.setFromTwoVectors(v1, v2)*v1).normalized());
133*bf2c3715SXin Li VERIFY_IS_APPROX( v1.normalized(),(q2.setFromTwoVectors(v1, v1)*v1).normalized());
134*bf2c3715SXin Li VERIFY_IS_APPROX(-v1.normalized(),(q2.setFromTwoVectors(v1,-v1)*v1).normalized());
135*bf2c3715SXin Li if (internal::is_same<Scalar,double>::value)
136*bf2c3715SXin Li {
137*bf2c3715SXin Li v3 = (v1.array()+eps).matrix();
138*bf2c3715SXin Li VERIFY_IS_APPROX( v3.normalized(),(q2.setFromTwoVectors(v1, v3)*v1).normalized());
139*bf2c3715SXin Li VERIFY_IS_APPROX(-v3.normalized(),(q2.setFromTwoVectors(v1,-v3)*v1).normalized());
140*bf2c3715SXin Li }
141*bf2c3715SXin Li
142*bf2c3715SXin Li // from two vector creation static function
143*bf2c3715SXin Li VERIFY_IS_APPROX( v2.normalized(),(Quaternionx::FromTwoVectors(v1, v2)*v1).normalized());
144*bf2c3715SXin Li VERIFY_IS_APPROX( v1.normalized(),(Quaternionx::FromTwoVectors(v1, v1)*v1).normalized());
145*bf2c3715SXin Li VERIFY_IS_APPROX(-v1.normalized(),(Quaternionx::FromTwoVectors(v1,-v1)*v1).normalized());
146*bf2c3715SXin Li if (internal::is_same<Scalar,double>::value)
147*bf2c3715SXin Li {
148*bf2c3715SXin Li v3 = (v1.array()+eps).matrix();
149*bf2c3715SXin Li VERIFY_IS_APPROX( v3.normalized(),(Quaternionx::FromTwoVectors(v1, v3)*v1).normalized());
150*bf2c3715SXin Li VERIFY_IS_APPROX(-v3.normalized(),(Quaternionx::FromTwoVectors(v1,-v3)*v1).normalized());
151*bf2c3715SXin Li }
152*bf2c3715SXin Li
153*bf2c3715SXin Li // inverse and conjugate
154*bf2c3715SXin Li VERIFY_IS_APPROX(q1 * (q1.inverse() * v1), v1);
155*bf2c3715SXin Li VERIFY_IS_APPROX(q1 * (q1.conjugate() * v1), v1);
156*bf2c3715SXin Li
157*bf2c3715SXin Li // test casting
158*bf2c3715SXin Li Quaternion<float> q1f = q1.template cast<float>();
159*bf2c3715SXin Li VERIFY_IS_APPROX(q1f.template cast<Scalar>(),q1);
160*bf2c3715SXin Li Quaternion<double> q1d = q1.template cast<double>();
161*bf2c3715SXin Li VERIFY_IS_APPROX(q1d.template cast<Scalar>(),q1);
162*bf2c3715SXin Li
163*bf2c3715SXin Li // test bug 369 - improper alignment.
164*bf2c3715SXin Li Quaternionx *q = new Quaternionx;
165*bf2c3715SXin Li delete q;
166*bf2c3715SXin Li
167*bf2c3715SXin Li q1 = Quaternionx::UnitRandom();
168*bf2c3715SXin Li q2 = Quaternionx::UnitRandom();
169*bf2c3715SXin Li check_slerp(q1,q2);
170*bf2c3715SXin Li
171*bf2c3715SXin Li q1 = AngleAxisx(b, v1.normalized());
172*bf2c3715SXin Li q2 = AngleAxisx(b+Scalar(EIGEN_PI), v1.normalized());
173*bf2c3715SXin Li check_slerp(q1,q2);
174*bf2c3715SXin Li
175*bf2c3715SXin Li q1 = AngleAxisx(b, v1.normalized());
176*bf2c3715SXin Li q2 = AngleAxisx(-b, -v1.normalized());
177*bf2c3715SXin Li check_slerp(q1,q2);
178*bf2c3715SXin Li
179*bf2c3715SXin Li q1 = Quaternionx::UnitRandom();
180*bf2c3715SXin Li q2.coeffs() = -q1.coeffs();
181*bf2c3715SXin Li check_slerp(q1,q2);
182*bf2c3715SXin Li }
183*bf2c3715SXin Li
mapQuaternion(void)184*bf2c3715SXin Li template<typename Scalar> void mapQuaternion(void){
185*bf2c3715SXin Li typedef Map<Quaternion<Scalar>, Aligned> MQuaternionA;
186*bf2c3715SXin Li typedef Map<const Quaternion<Scalar>, Aligned> MCQuaternionA;
187*bf2c3715SXin Li typedef Map<Quaternion<Scalar> > MQuaternionUA;
188*bf2c3715SXin Li typedef Map<const Quaternion<Scalar> > MCQuaternionUA;
189*bf2c3715SXin Li typedef Quaternion<Scalar> Quaternionx;
190*bf2c3715SXin Li typedef Matrix<Scalar,3,1> Vector3;
191*bf2c3715SXin Li typedef AngleAxis<Scalar> AngleAxisx;
192*bf2c3715SXin Li
193*bf2c3715SXin Li Vector3 v0 = Vector3::Random(),
194*bf2c3715SXin Li v1 = Vector3::Random();
195*bf2c3715SXin Li Scalar a = internal::random<Scalar>(-Scalar(EIGEN_PI), Scalar(EIGEN_PI));
196*bf2c3715SXin Li
197*bf2c3715SXin Li EIGEN_ALIGN_MAX Scalar array1[4];
198*bf2c3715SXin Li EIGEN_ALIGN_MAX Scalar array2[4];
199*bf2c3715SXin Li EIGEN_ALIGN_MAX Scalar array3[4+1];
200*bf2c3715SXin Li Scalar* array3unaligned = array3+1;
201*bf2c3715SXin Li
202*bf2c3715SXin Li MQuaternionA mq1(array1);
203*bf2c3715SXin Li MCQuaternionA mcq1(array1);
204*bf2c3715SXin Li MQuaternionA mq2(array2);
205*bf2c3715SXin Li MQuaternionUA mq3(array3unaligned);
206*bf2c3715SXin Li MCQuaternionUA mcq3(array3unaligned);
207*bf2c3715SXin Li
208*bf2c3715SXin Li // std::cerr << array1 << " " << array2 << " " << array3 << "\n";
209*bf2c3715SXin Li mq1 = AngleAxisx(a, v0.normalized());
210*bf2c3715SXin Li mq2 = mq1;
211*bf2c3715SXin Li mq3 = mq1;
212*bf2c3715SXin Li
213*bf2c3715SXin Li Quaternionx q1 = mq1;
214*bf2c3715SXin Li Quaternionx q2 = mq2;
215*bf2c3715SXin Li Quaternionx q3 = mq3;
216*bf2c3715SXin Li Quaternionx q4 = MCQuaternionUA(array3unaligned);
217*bf2c3715SXin Li
218*bf2c3715SXin Li VERIFY_IS_APPROX(q1.coeffs(), q2.coeffs());
219*bf2c3715SXin Li VERIFY_IS_APPROX(q1.coeffs(), q3.coeffs());
220*bf2c3715SXin Li VERIFY_IS_APPROX(q4.coeffs(), q3.coeffs());
221*bf2c3715SXin Li
222*bf2c3715SXin Li VERIFY_IS_APPROX(mq1 * (mq1.inverse() * v1), v1);
223*bf2c3715SXin Li VERIFY_IS_APPROX(mq1 * (mq1.conjugate() * v1), v1);
224*bf2c3715SXin Li
225*bf2c3715SXin Li VERIFY_IS_APPROX(mcq1 * (mcq1.inverse() * v1), v1);
226*bf2c3715SXin Li VERIFY_IS_APPROX(mcq1 * (mcq1.conjugate() * v1), v1);
227*bf2c3715SXin Li
228*bf2c3715SXin Li VERIFY_IS_APPROX(mq3 * (mq3.inverse() * v1), v1);
229*bf2c3715SXin Li VERIFY_IS_APPROX(mq3 * (mq3.conjugate() * v1), v1);
230*bf2c3715SXin Li
231*bf2c3715SXin Li VERIFY_IS_APPROX(mcq3 * (mcq3.inverse() * v1), v1);
232*bf2c3715SXin Li VERIFY_IS_APPROX(mcq3 * (mcq3.conjugate() * v1), v1);
233*bf2c3715SXin Li
234*bf2c3715SXin Li VERIFY_IS_APPROX(mq1*mq2, q1*q2);
235*bf2c3715SXin Li VERIFY_IS_APPROX(mq3*mq2, q3*q2);
236*bf2c3715SXin Li VERIFY_IS_APPROX(mcq1*mq2, q1*q2);
237*bf2c3715SXin Li VERIFY_IS_APPROX(mcq3*mq2, q3*q2);
238*bf2c3715SXin Li
239*bf2c3715SXin Li // Bug 1461, compilation issue with Map<const Quat>::w(), and other reference/constness checks:
240*bf2c3715SXin Li VERIFY_IS_APPROX(mcq3.coeffs().x() + mcq3.coeffs().y() + mcq3.coeffs().z() + mcq3.coeffs().w(), mcq3.coeffs().sum());
241*bf2c3715SXin Li VERIFY_IS_APPROX(mcq3.x() + mcq3.y() + mcq3.z() + mcq3.w(), mcq3.coeffs().sum());
242*bf2c3715SXin Li mq3.w() = 1;
243*bf2c3715SXin Li const Quaternionx& cq3(q3);
244*bf2c3715SXin Li VERIFY( &cq3.x() == &q3.x() );
245*bf2c3715SXin Li const MQuaternionUA& cmq3(mq3);
246*bf2c3715SXin Li VERIFY( &cmq3.x() == &mq3.x() );
247*bf2c3715SXin Li // FIXME the following should be ok. The problem is that currently the LValueBit flag
248*bf2c3715SXin Li // is used to determine whether we can return a coeff by reference or not, which is not enough for Map<const ...>.
249*bf2c3715SXin Li //const MCQuaternionUA& cmcq3(mcq3);
250*bf2c3715SXin Li //VERIFY( &cmcq3.x() == &mcq3.x() );
251*bf2c3715SXin Li
252*bf2c3715SXin Li // test cast
253*bf2c3715SXin Li {
254*bf2c3715SXin Li Quaternion<float> q1f = mq1.template cast<float>();
255*bf2c3715SXin Li VERIFY_IS_APPROX(q1f.template cast<Scalar>(),mq1);
256*bf2c3715SXin Li Quaternion<double> q1d = mq1.template cast<double>();
257*bf2c3715SXin Li VERIFY_IS_APPROX(q1d.template cast<Scalar>(),mq1);
258*bf2c3715SXin Li }
259*bf2c3715SXin Li }
260*bf2c3715SXin Li
quaternionAlignment(void)261*bf2c3715SXin Li template<typename Scalar> void quaternionAlignment(void){
262*bf2c3715SXin Li typedef Quaternion<Scalar,AutoAlign> QuaternionA;
263*bf2c3715SXin Li typedef Quaternion<Scalar,DontAlign> QuaternionUA;
264*bf2c3715SXin Li
265*bf2c3715SXin Li EIGEN_ALIGN_MAX Scalar array1[4];
266*bf2c3715SXin Li EIGEN_ALIGN_MAX Scalar array2[4];
267*bf2c3715SXin Li EIGEN_ALIGN_MAX Scalar array3[4+1];
268*bf2c3715SXin Li Scalar* arrayunaligned = array3+1;
269*bf2c3715SXin Li
270*bf2c3715SXin Li QuaternionA *q1 = ::new(reinterpret_cast<void*>(array1)) QuaternionA;
271*bf2c3715SXin Li QuaternionUA *q2 = ::new(reinterpret_cast<void*>(array2)) QuaternionUA;
272*bf2c3715SXin Li QuaternionUA *q3 = ::new(reinterpret_cast<void*>(arrayunaligned)) QuaternionUA;
273*bf2c3715SXin Li
274*bf2c3715SXin Li q1->coeffs().setRandom();
275*bf2c3715SXin Li *q2 = *q1;
276*bf2c3715SXin Li *q3 = *q1;
277*bf2c3715SXin Li
278*bf2c3715SXin Li VERIFY_IS_APPROX(q1->coeffs(), q2->coeffs());
279*bf2c3715SXin Li VERIFY_IS_APPROX(q1->coeffs(), q3->coeffs());
280*bf2c3715SXin Li }
281*bf2c3715SXin Li
check_const_correctness(const PlainObjectType &)282*bf2c3715SXin Li template<typename PlainObjectType> void check_const_correctness(const PlainObjectType&)
283*bf2c3715SXin Li {
284*bf2c3715SXin Li // there's a lot that we can't test here while still having this test compile!
285*bf2c3715SXin Li // the only possible approach would be to run a script trying to compile stuff and checking that it fails.
286*bf2c3715SXin Li // CMake can help with that.
287*bf2c3715SXin Li
288*bf2c3715SXin Li // verify that map-to-const don't have LvalueBit
289*bf2c3715SXin Li typedef typename internal::add_const<PlainObjectType>::type ConstPlainObjectType;
290*bf2c3715SXin Li VERIFY( !(internal::traits<Map<ConstPlainObjectType> >::Flags & LvalueBit) );
291*bf2c3715SXin Li VERIFY( !(internal::traits<Map<ConstPlainObjectType, Aligned> >::Flags & LvalueBit) );
292*bf2c3715SXin Li VERIFY( !(Map<ConstPlainObjectType>::Flags & LvalueBit) );
293*bf2c3715SXin Li VERIFY( !(Map<ConstPlainObjectType, Aligned>::Flags & LvalueBit) );
294*bf2c3715SXin Li }
295*bf2c3715SXin Li
296*bf2c3715SXin Li #if EIGEN_HAS_RVALUE_REFERENCES
297*bf2c3715SXin Li
298*bf2c3715SXin Li // Regression for bug 1573
299*bf2c3715SXin Li struct MovableClass {
300*bf2c3715SXin Li // The following line is a workaround for gcc 4.7 and 4.8 (see bug 1573 comments).
301*bf2c3715SXin Li static_assert(std::is_nothrow_move_constructible<Quaternionf>::value,"");
302*bf2c3715SXin Li MovableClass() = default;
303*bf2c3715SXin Li MovableClass(const MovableClass&) = default;
304*bf2c3715SXin Li MovableClass(MovableClass&&) noexcept = default;
305*bf2c3715SXin Li MovableClass& operator=(const MovableClass&) = default;
306*bf2c3715SXin Li MovableClass& operator=(MovableClass&&) = default;
307*bf2c3715SXin Li Quaternionf m_quat;
308*bf2c3715SXin Li };
309*bf2c3715SXin Li
310*bf2c3715SXin Li #endif
311*bf2c3715SXin Li
EIGEN_DECLARE_TEST(geo_quaternion)312*bf2c3715SXin Li EIGEN_DECLARE_TEST(geo_quaternion)
313*bf2c3715SXin Li {
314*bf2c3715SXin Li for(int i = 0; i < g_repeat; i++) {
315*bf2c3715SXin Li CALL_SUBTEST_1(( quaternion<float,AutoAlign>() ));
316*bf2c3715SXin Li CALL_SUBTEST_1( check_const_correctness(Quaternionf()) );
317*bf2c3715SXin Li CALL_SUBTEST_1(( quaternion<float,DontAlign>() ));
318*bf2c3715SXin Li CALL_SUBTEST_1(( quaternionAlignment<float>() ));
319*bf2c3715SXin Li CALL_SUBTEST_1( mapQuaternion<float>() );
320*bf2c3715SXin Li
321*bf2c3715SXin Li CALL_SUBTEST_2(( quaternion<double,AutoAlign>() ));
322*bf2c3715SXin Li CALL_SUBTEST_2( check_const_correctness(Quaterniond()) );
323*bf2c3715SXin Li CALL_SUBTEST_2(( quaternion<double,DontAlign>() ));
324*bf2c3715SXin Li CALL_SUBTEST_2(( quaternionAlignment<double>() ));
325*bf2c3715SXin Li CALL_SUBTEST_2( mapQuaternion<double>() );
326*bf2c3715SXin Li
327*bf2c3715SXin Li #ifndef EIGEN_TEST_ANNOYING_SCALAR_DONT_THROW
328*bf2c3715SXin Li AnnoyingScalar::dont_throw = true;
329*bf2c3715SXin Li #endif
330*bf2c3715SXin Li CALL_SUBTEST_3(( quaternion<AnnoyingScalar,AutoAlign>() ));
331*bf2c3715SXin Li }
332*bf2c3715SXin Li }
333