]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/qvm/test/neg_row_test.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / qvm / test / neg_row_test.cpp
CommitLineData
1e59de90 1// Copyright 2008-2022 Emil Dotchevski and Reverge Studios, Inc.
92f5a8d4 2
1e59de90
TL
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#ifdef BOOST_QVM_TEST_SINGLE_HEADER
7# include BOOST_QVM_TEST_SINGLE_HEADER
8#else
9# include <boost/qvm/map_mat_mat.hpp>
10# include <boost/qvm/mat_operations.hpp>
11# include <boost/qvm/mat.hpp>
12#endif
92f5a8d4 13
92f5a8d4 14#include <boost/qvm/mat_traits_array.hpp>
92f5a8d4
TL
15#include "test_qvm.hpp"
16#include "test_qvm_matrix.hpp"
17#include "gold.hpp"
18
19namespace
20 {
21 template <int Rows,int Cols,int Row>
22 void
23 test()
24 {
25 using namespace boost::qvm;
26 test_qvm::matrix<M1,Rows,Cols> x(42,1);
27 float r1[Rows][Cols];
28 for( int i=0; i!=Rows; ++i )
29 for( int j=0; j!=Cols; ++j )
30 r1[i][j]=(i==Row?-x.a[i][j]:x.a[i][j]);
31 float r2[Rows][Cols];
32 assign(r2,neg_row<Row>(x));
33 BOOST_QVM_TEST_EQ(r1,r2);
34 neg_row<Row>(x) + neg_row<Row>(x);
35 -neg_row<Row>(x);
36 }
37 }
38
39int
40main()
41 {
42 test<2,2,0>();
43 test<2,2,1>();
44
45 test<3,3,0>();
46 test<3,3,1>();
47 test<3,3,2>();
48
49 test<4,4,0>();
50 test<4,4,1>();
51 test<4,4,2>();
52 test<4,4,3>();
53
54 test<5,5,0>();
55 test<5,5,1>();
56 test<5,5,2>();
57 test<5,5,3>();
58 test<5,5,4>();
59 return boost::report_errors();
60 }