]>
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>\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];\r | |
23 | for( int i=0; i!=Rows-1; ++i )\r | |
24 | for( int j=0; j!=Cols; ++j )\r | |
25 | r1[i][j]=x.a[i+(i>=Row)][j];\r | |
26 | float r2[Rows-1][Cols];\r | |
27 | assign(r2,del_row<Row>(x));\r | |
28 | BOOST_QVM_TEST_EQ(r1,r2);\r | |
29 | del_row<Row>(x) *= 2;\r | |
30 | for( int i=0; i!=Rows-1; ++i )\r | |
31 | for( int j=0; j!=Cols; ++j )\r | |
32 | r1[i][j]=x.a[i+(i>=Row)][j];\r | |
33 | assign(r2,del_row<Row>(x));\r | |
34 | BOOST_QVM_TEST_EQ(r1,r2);\r | |
35 | del_row<Row>(x)+del_row<Row>(x);\r | |
36 | -del_row<Row>(x);\r | |
37 | }\r | |
38 | }\r | |
39 | \r | |
40 | int\r | |
41 | main()\r | |
42 | {\r | |
43 | test<2,2,0>();\r | |
44 | test<2,2,1>();\r | |
45 | \r | |
46 | test<3,3,0>();\r | |
47 | test<3,3,1>();\r | |
48 | test<3,3,2>();\r | |
49 | \r | |
50 | test<4,4,0>();\r | |
51 | test<4,4,1>();\r | |
52 | test<4,4,2>();\r | |
53 | test<4,4,3>();\r | |
54 | \r | |
55 | test<5,5,0>();\r | |
56 | test<5,5,1>();\r | |
57 | test<5,5,2>();\r | |
58 | test<5,5,3>();\r | |
59 | test<5,5,4>();\r | |
60 | return boost::report_errors();\r | |
61 | }\r |