]>
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/mat_operations.hpp>\r | |
7 | #include <boost/qvm/mat.hpp>\r | |
8 | #include "test_qvm_matrix.hpp"\r | |
9 | #include "gold.hpp"\r | |
10 | \r | |
11 | namespace\r | |
12 | {\r | |
13 | template <class T,class U> struct same_type_tester;\r | |
14 | template <class T> struct same_type_tester<T,T> { };\r | |
15 | template <class T,class U> void test_same_type( T, U ) { same_type_tester<T,U>(); }\r | |
16 | \r | |
17 | template <int Rows,int Cols>\r | |
18 | void\r | |
19 | test()\r | |
20 | {\r | |
21 | using namespace boost::qvm::sfinae;\r | |
22 | test_qvm::matrix<M1,Rows,Cols> const x(42,1);\r | |
23 | test_qvm::scalar_multiply_m(x.b,x.a,2.0f);\r | |
24 | test_same_type(x,x*2);\r | |
25 | {\r | |
26 | test_qvm::matrix<M1,Rows,Cols> y=x*2;\r | |
27 | BOOST_QVM_TEST_EQ(x.b,y.a);\r | |
28 | }\r | |
29 | {\r | |
30 | test_qvm::matrix<M1,Rows,Cols> y=mref(x)*2;\r | |
31 | BOOST_QVM_TEST_EQ(x.b,y.a);\r | |
32 | }\r | |
33 | }\r | |
34 | }\r | |
35 | \r | |
36 | int\r | |
37 | main()\r | |
38 | {\r | |
39 | test<1,2>();\r | |
40 | test<2,1>();\r | |
41 | test<2,2>();\r | |
42 | test<1,3>();\r | |
43 | test<3,1>();\r | |
44 | test<3,3>();\r | |
45 | test<1,4>();\r | |
46 | test<4,1>();\r | |
47 | test<4,4>();\r | |
48 | test<1,5>();\r | |
49 | test<5,1>();\r | |
50 | test<5,5>();\r | |
51 | return boost::report_errors();\r | |
52 | }\r |