]>
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_mat_mat.hpp>\r | |
7 | #include <boost/qvm/mat_operations.hpp>\r | |
8 | #include <boost/qvm/mat_traits_array.hpp>\r | |
9 | #include <boost/qvm/mat.hpp>\r | |
10 | #include "test_qvm.hpp"\r | |
11 | #include "test_qvm_matrix.hpp"\r | |
12 | #include "gold.hpp"\r | |
13 | \r | |
14 | namespace\r | |
15 | {\r | |
16 | template <int Rows,int Cols,int Row,int Col>\r | |
17 | void\r | |
18 | test()\r | |
19 | {\r | |
20 | using namespace boost::qvm;\r | |
21 | test_qvm::matrix<M1,Rows,Cols> x(42,1);\r | |
22 | float r1[Rows-1][Cols-1];\r | |
23 | for( int i=0; i!=Rows-1; ++i )\r | |
24 | for( int j=0; j!=Cols-1; ++j )\r | |
25 | r1[i][j]=x.a[i+(i>=Row)][j+(j>=Col)];\r | |
26 | float r2[Rows-1][Cols-1];\r | |
27 | assign(r2,del_row_col<Row,Col>(x));\r | |
28 | BOOST_QVM_TEST_EQ(r1,r2);\r | |
29 | del_row_col<Row,Col>(x) *= 2;\r | |
30 | for( int i=0; i!=Rows-1; ++i )\r | |
31 | for( int j=0; j!=Cols-1; ++j )\r | |
32 | r1[i][j]=x.a[i+(i>=Row)][j+(j>=Col)];\r | |
33 | assign(r2,del_row_col<Row,Col>(x));\r | |
34 | BOOST_QVM_TEST_EQ(r1,r2);\r | |
35 | del_row_col<Row,Col>(x) + del_row_col<Row,Col>(x);\r | |
36 | -del_row_col<Row,Col>(x);\r | |
37 | }\r | |
38 | }\r | |
39 | \r | |
40 | int\r | |
41 | main()\r | |
42 | {\r | |
43 | test<2,2,0,0>();\r | |
44 | test<2,2,0,1>();\r | |
45 | test<2,2,1,0>();\r | |
46 | test<2,2,1,1>();\r | |
47 | \r | |
48 | test<3,3,0,0>();\r | |
49 | test<3,3,0,1>();\r | |
50 | test<3,3,0,2>();\r | |
51 | test<3,3,1,0>();\r | |
52 | test<3,3,1,1>();\r | |
53 | test<3,3,1,2>();\r | |
54 | test<3,3,2,0>();\r | |
55 | test<3,3,2,1>();\r | |
56 | test<3,3,2,2>();\r | |
57 | \r | |
58 | test<4,4,0,0>();\r | |
59 | test<4,4,0,1>();\r | |
60 | test<4,4,0,2>();\r | |
61 | test<4,4,0,3>();\r | |
62 | test<4,4,1,0>();\r | |
63 | test<4,4,1,1>();\r | |
64 | test<4,4,1,2>();\r | |
65 | test<4,4,1,3>();\r | |
66 | test<4,4,2,0>();\r | |
67 | test<4,4,2,1>();\r | |
68 | test<4,4,2,2>();\r | |
69 | test<4,4,2,3>();\r | |
70 | test<4,4,3,0>();\r | |
71 | test<4,4,3,1>();\r | |
72 | test<4,4,3,2>();\r | |
73 | test<4,4,3,3>();\r | |
74 | \r | |
75 | test<5,5,0,0>();\r | |
76 | test<5,5,0,1>();\r | |
77 | test<5,5,0,2>();\r | |
78 | test<5,5,0,3>();\r | |
79 | test<5,5,0,4>();\r | |
80 | test<5,5,1,0>();\r | |
81 | test<5,5,1,1>();\r | |
82 | test<5,5,1,2>();\r | |
83 | test<5,5,1,3>();\r | |
84 | test<5,5,1,4>();\r | |
85 | test<5,5,2,0>();\r | |
86 | test<5,5,2,1>();\r | |
87 | test<5,5,2,2>();\r | |
88 | test<5,5,2,3>();\r | |
89 | test<5,5,2,4>();\r | |
90 | test<5,5,3,0>();\r | |
91 | test<5,5,3,1>();\r | |
92 | test<5,5,3,2>();\r | |
93 | test<5,5,3,3>();\r | |
94 | test<5,5,3,4>();\r | |
95 | test<5,5,4,0>();\r | |
96 | test<5,5,4,1>();\r | |
97 | test<5,5,4,2>();\r | |
98 | test<5,5,4,3>();\r | |
99 | test<5,5,4,4>();\r | |
100 | return boost::report_errors();\r | |
101 | }\r |