]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/qvm/test/del_col_test.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / qvm / test / del_col_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 Col>
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-1];
28 for( int i=0; i!=Rows; ++i )
29 for( int j=0; j!=Cols-1; ++j )
30 r1[i][j]=x.a[i][j+(j>=Col)];
31 float r2[Rows][Cols-1];
32 assign(r2,del_col<Col>(x));
33 BOOST_QVM_TEST_EQ(r1,r2);
34 del_col<Col>(x) *= 2;
35 for( int i=0; i!=Rows; ++i )
36 for( int j=0; j!=Cols-1; ++j )
37 r1[i][j]=x.a[i][j+(j>=Col)];
38 assign(r2,del_col<Col>(x));
39 BOOST_QVM_TEST_EQ(r1,r2);
40 del_col<Col>(x) + del_col<Col>(x);
41 -del_col<Col>(x);
42 }
43 }
44
45int
46main()
47 {
48 test<2,2,0>();
49 test<2,2,1>();
50
51 test<3,3,0>();
52 test<3,3,1>();
53 test<3,3,2>();
54
55 test<4,4,0>();
56 test<4,4,1>();
57 test<4,4,2>();
58 test<4,4,3>();
59
60 test<5,5,0>();
61 test<5,5,1>();
62 test<5,5,2>();
63 test<5,5,3>();
64 test<5,5,4>();
65 return boost::report_errors();
66 }