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