]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/qvm/test/inverse_m_test.cpp
update sources to v12.2.4
[ceph.git] / ceph / src / boost / libs / qvm / test / inverse_m_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/mat_operations.hpp>\r
7#include <boost/qvm/mat.hpp>\r
8#include <boost/exception/diagnostic_information.hpp>\r
9#include "test_qvm_matrix.hpp"\r
10#include "gold.hpp"\r
11\r
12namespace\r
13 {\r
14 template <class T,class U> struct same_type_tester;\r
15 template <class T> struct same_type_tester<T,T> { };\r
16 template <class T,class U> void test_same_type( T, U ) { same_type_tester<T,U>(); }\r
17\r
18 template <int D>\r
19 void\r
20 test()\r
21 {\r
22 using namespace boost::qvm::sfinae;\r
23 test_qvm::matrix<M1,D,D> x;\r
24 test_qvm::rotation_z(x.a,42.0f);\r
25 test_qvm::inverse(x.b,x.a);\r
26 test_same_type(x,inverse(x));\r
27 {\r
28 test_qvm::matrix<M1,D,D> y=inverse(x);\r
29 BOOST_QVM_TEST_CLOSE(x.b,y.a,0.000001f);\r
30 }\r
31 {\r
32 test_qvm::matrix<M1,D,D> y=inverse(mref(x));\r
33 BOOST_QVM_TEST_CLOSE(x.b,y.a,0.000001f);\r
34 }\r
35 }\r
36 }\r
37\r
38int\r
39main()\r
40 {\r
41 try\r
42 {\r
43 test<2>();\r
44 test<3>();\r
45 test<4>();\r
46 test<5>();\r
47 return boost::report_errors();\r
48 }\r
49 catch(\r
50 ... )\r
51 {\r
52 std::cerr << "Uncaught exception:\n" << boost::current_exception_diagnostic_information();\r
53 return 1;\r
54 }\r
55 }\r