]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/qvm/test/cross_test.cpp
update sources to v12.2.4
[ceph.git] / ceph / src / boost / libs / qvm / test / cross_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/vec_operations.hpp>\r
7#include <boost/qvm/vec_access.hpp>\r
8#include <boost/qvm/mat_access.hpp>\r
9#include <boost/qvm/vec_operations3.hpp>\r
10#include <boost/qvm/vec.hpp>\r
11//#include <boost/qvm/quat_traits.hpp>\r
12#include "test_qvm_vector.hpp"\r
13#include "test_qvm_matrix.hpp"\r
14#include "gold.hpp"\r
15\r
16namespace\r
17 {\r
18 template <class T,class U> struct same_type_tester;\r
19 template <class T> struct same_type_tester<T,T> { };\r
20 template <class T,class U> void test_same_type( T, U ) { same_type_tester<T,U>(); }\r
21 }\r
22\r
23int\r
24main()\r
25 {\r
26 using namespace boost::qvm;\r
27 test_qvm::vector<V1,3> x(42,1);\r
28 test_qvm::vector<V1,3> y=x*2;\r
29 test_qvm::matrix<M1,3,3> m;\r
30 A00(m) = 0;\r
31 A01(m) = -A2(x);\r
32 A02(m) = A1(x);\r
33 A10(m) = A2(x);\r
34 A11(m) = 0;\r
35 A12(m) = -A0(x);\r
36 A20(m) = -A1(x);\r
37 A21(m) = A0(x);\r
38 A22(m) = 0;\r
39 {\r
40 test_same_type(x,cross(x,y));\r
41 test_qvm::vector<V1,3> c=cross(x,y);\r
42 test_qvm::multiply_mv(c.b,m.a,y.a);\r
43 BOOST_QVM_TEST_EQ(c.a,c.b);\r
44 }\r
45 {\r
46 test_qvm::vector<V2,3> c=cross(vref(x),y);\r
47 test_qvm::multiply_mv(c.b,m.a,y.a);\r
48 BOOST_QVM_TEST_EQ(c.a,c.b);\r
49 }\r
50 {\r
51 test_qvm::vector<V2,3> c=cross(x,vref(y));\r
52 test_qvm::multiply_mv(c.b,m.a,y.a);\r
53 BOOST_QVM_TEST_EQ(c.a,c.b);\r
54 }\r
55 return boost::report_errors();\r
56 }\r