]>
Commit | Line | Data |
---|---|---|
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/map.hpp>\r | |
7 | #include <boost/qvm/mat_traits_array.hpp>\r | |
8 | #include <boost/qvm/vec_operations.hpp>\r | |
9 | #include <boost/qvm/mat_operations.hpp>\r | |
10 | #include <boost/qvm/mat.hpp>\r | |
11 | #include "test_qvm_vector.hpp"\r | |
12 | #include "gold.hpp"\r | |
13 | \r | |
14 | namespace\r | |
15 | {\r | |
16 | template <int Dim>\r | |
17 | void\r | |
18 | test()\r | |
19 | {\r | |
20 | using namespace boost::qvm;\r | |
21 | test_qvm::vector<V1,Dim-1> x(42,1);\r | |
22 | float r1[Dim][Dim];\r | |
23 | test_qvm::translation(r1,x.a);\r | |
24 | float r2[Dim][Dim];\r | |
25 | assign(r2,translation_mat(x));\r | |
26 | BOOST_QVM_TEST_EQ(r1,r2);\r | |
27 | test_qvm::scalar_multiply_v(x.b,x.a,2.0f);\r | |
28 | col<Dim-1>(del_row<Dim-1>(translation_mat(x))) *= 2;\r | |
29 | BOOST_QVM_TEST_EQ(x.a,x.b);\r | |
30 | translation_mat(x) + translation_mat(x);\r | |
31 | -translation_mat(x);\r | |
32 | }\r | |
33 | }\r | |
34 | \r | |
35 | int\r | |
36 | main()\r | |
37 | {\r | |
38 | test<3>();\r | |
39 | test<4>();\r | |
40 | test<5>();\r | |
41 | return boost::report_errors();\r | |
42 | }\r |