]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/qvm/test/mul_vm_test.cpp
81ed93e891a37b22489099a4edccd764c43a1d1d
1 // Copyright 2008-2022 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 #ifdef BOOST_QVM_TEST_SINGLE_HEADER
7 # include BOOST_QVM_TEST_SINGLE_HEADER
9 # include <boost/qvm/vec_operations.hpp>
10 # include <boost/qvm/mat_operations.hpp>
11 # include <boost/qvm/vec_mat_operations.hpp>
12 # include <boost/qvm/vec.hpp>
15 #include "test_qvm_matrix.hpp"
16 #include "test_qvm_vector.hpp"
21 template <class T
,class U
>
30 template <class T
,class U
>
32 check_same_type( T
const &, U
const & )
37 template <int M
,int N
>
41 using namespace boost::qvm::sfinae
;
42 using namespace boost::qvm
;
43 test_qvm::vector
<V1
,M
> const x(42,1);
44 test_qvm::matrix
<M1
,M
,N
> const y(42,1);
46 test_qvm::vector
<V2
,N
> r
=x
*y
;
47 test_qvm::multiply_vm(r
.b
,x
.b
,y
.b
);
48 BOOST_QVM_TEST_CLOSE(r
.a
,r
.b
,0.0000001f
);
51 test_qvm::vector
<V2
,N
> r
=vref(x
)*y
;
52 test_qvm::multiply_vm(r
.b
,x
.b
,y
.b
);
53 BOOST_QVM_TEST_CLOSE(r
.a
,r
.b
,0.0000001f
);
56 test_qvm::vector
<V2
,N
> r
=x
*mref(y
);
57 test_qvm::multiply_vm(r
.b
,x
.b
,y
.b
);
58 BOOST_QVM_TEST_CLOSE(r
.a
,r
.b
,0.0000001f
);
60 check_same_type(x
*y
,boost::qvm::vec
<float,N
>());
79 return boost::report_errors();