]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/qvm/test/dot_qq_test.cpp
update sources to v12.2.4
[ceph.git] / ceph / src / boost / libs / qvm / test / dot_qq_test.cpp
CommitLineData
3a9019d9
FG
1//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.\r
2\r
3//Distributed under the Boost Software License, Version 1.0. (See accompanying\r
4//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
5\r
6#include <boost/qvm/quat_operations.hpp>\r
7#include "test_qvm_quaternion.hpp"\r
8#include "gold.hpp"\r
9\r
10namespace\r
11 {\r
12 template <class T,class U> struct same_type_tester;\r
13 template <class T> struct same_type_tester<T,T> { };\r
14 template <class T,class U> void test_same_type( T, U ) { same_type_tester<T,U>(); }\r
15\r
16 void\r
17 test()\r
18 {\r
19 using namespace boost::qvm::sfinae;\r
20\r
21 test_qvm::quaternion<Q1> const x(42,1);\r
22 {\r
23 test_qvm::quaternion<Q1> const y(43,1);\r
24 test_same_type(float(),dot(x,y));\r
25 float d1=dot(x,y);\r
26 float d2=test_qvm::dot<float>(x.a,y.a);\r
27 BOOST_QVM_TEST_CLOSE(d1,d2,0.000001f);\r
28 }\r
29 {\r
30 test_qvm::quaternion<Q1,double> const y(43,1);\r
31 test_same_type(double(),dot(x,y));\r
32 double d1=dot(x,y);\r
33 double d2=test_qvm::dot<double>(x.a,y.a);\r
34 BOOST_QVM_TEST_CLOSE(d1,d2,0.000001);\r
35 }\r
36 }\r
37 }\r
38\r
39int\r
40main()\r
41 {\r
42 test();\r
43 return boost::report_errors();\r
44 }\r