]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/qvm/test/row_test.cpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / libs / qvm / test / row_test.cpp
CommitLineData
92f5a8d4
TL
1//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
2
3//Distributed under the Boost Software License, Version 1.0. (See accompanying
4//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
6#include <boost/qvm/map_mat_vec.hpp>
7#include <boost/qvm/vec_traits_array.hpp>
8#include <boost/qvm/mat_operations.hpp>
9#include <boost/qvm/vec_operations.hpp>
10#include <boost/qvm/vec.hpp>
11#include "test_qvm.hpp"
12#include "test_qvm_matrix.hpp"
13#include "gold.hpp"
14
15namespace
16 {
17 template <int Rows,int Cols,int Row>
18 void
19 test()
20 {
21 using namespace boost::qvm;
22 test_qvm::matrix<M1,Rows,Cols> x(42,1);
23 float r1[Cols];
24 for( int i=0; i!=Cols; ++i )
25 r1[i]=x.a[Row][i];
26 float r2[Cols];
27 assign(r2,row<Row>(x));
28 BOOST_QVM_TEST_EQ(r1,r2);
29 row<Row>(x) *= 2;
30 for( int i=0; i!=Cols; ++i )
31 r1[i]=x.a[Row][i];
32 assign(r2,row<Row>(x));
33 BOOST_QVM_TEST_EQ(r1,r2);
34 row<Row>(x) + row<Row>(x);
35 -row<Row>(x);
36 }
37 }
38
39int
40main()
41 {
42 test<2,1,0>();
43 test<2,1,1>();
44 test<3,1,0>();
45 test<3,1,1>();
46 test<3,1,2>();
47 test<4,1,0>();
48 test<4,1,1>();
49 test<4,1,2>();
50 test<4,1,3>();
51 test<5,1,0>();
52 test<5,1,1>();
53 test<5,1,2>();
54 test<5,1,3>();
55 test<5,1,4>();
56
57 test<2,2,0>();
58 test<2,2,1>();
59 test<3,2,0>();
60 test<3,2,1>();
61 test<3,2,2>();
62 test<4,2,0>();
63 test<4,2,1>();
64 test<4,2,2>();
65 test<4,2,3>();
66 test<5,2,0>();
67 test<5,2,1>();
68 test<5,2,2>();
69 test<5,2,3>();
70 test<5,2,4>();
71
72 test<2,3,0>();
73 test<2,3,1>();
74 test<3,3,0>();
75 test<3,3,1>();
76 test<3,3,2>();
77 test<4,3,0>();
78 test<4,3,1>();
79 test<4,3,2>();
80 test<4,3,3>();
81 test<5,3,0>();
82 test<5,3,1>();
83 test<5,3,2>();
84 test<5,3,3>();
85 test<5,3,4>();
86
87 test<2,4,0>();
88 test<2,4,1>();
89 test<3,4,0>();
90 test<3,4,1>();
91 test<3,4,2>();
92 test<4,4,0>();
93 test<4,4,1>();
94 test<4,4,2>();
95 test<4,4,3>();
96 test<5,4,0>();
97 test<5,4,1>();
98 test<5,4,2>();
99 test<5,4,3>();
100 test<5,4,4>();
101
102 test<2,5,0>();
103 test<2,5,1>();
104 test<3,5,0>();
105 test<3,5,1>();
106 test<3,5,2>();
107 test<4,5,0>();
108 test<4,5,1>();
109 test<4,5,2>();
110 test<4,5,3>();
111 test<5,5,0>();
112 test<5,5,1>();
113 test<5,5,2>();
114 test<5,5,3>();
115 test<5,5,4>();
116
117 return boost::report_errors();
118 }