]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/qvm/test/zero_mat_test.cpp
1 //Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
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)
6 #include <boost/qvm/mat_operations.hpp>
7 #include <boost/qvm/mat.hpp>
8 #include "test_qvm_matrix.hpp"
12 template <class T
,class U
>
21 template <class T
,class U
>
23 check_deduction( T
const &, U
const & )
25 same_type
<T
,typename
boost::qvm::deduce_mat
<U
>::type
>();
28 template <int Rows
,int Cols
>
32 using namespace boost::qvm
;
33 test_qvm::matrix
<M1
,Rows
,Cols
> m1
=zero_mat
<float,Rows
,Cols
>();
34 for( int i
=0; i
!=Rows
; ++i
)
35 for( int j
=0; j
!=Cols
; ++j
)
36 BOOST_TEST(!m1
.a
[i
][j
]);
37 test_qvm::matrix
<M2
,Rows
,Cols
> m2(42,1);
39 for( int i
=0; i
!=Rows
; ++i
)
40 for( int j
=0; j
!=Cols
; ++j
)
41 BOOST_TEST(!m2
.a
[i
][j
]);
42 check_deduction(mat
<float,Rows
,Cols
>(),zero_mat
<float,Rows
,Cols
>());
43 check_deduction(mat
<int,Rows
,Cols
>(),zero_mat
<int,Rows
,Cols
>());
50 using namespace boost::qvm
;
51 test_qvm::matrix
<M1
,Dim
,Dim
> m1
=zero_mat
<float,Dim
>();
52 for( int i
=0; i
!=Dim
; ++i
)
53 for( int j
=0; j
!=Dim
; ++j
)
54 BOOST_TEST(!m1
.a
[i
][j
]);
77 return boost::report_errors();