]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/qvm/test/mul_mv_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/vec_mat_operations.hpp>
7 #include <boost/qvm/mat_operations.hpp>
8 #include <boost/qvm/vec_operations.hpp>
9 #include <boost/qvm/mat.hpp>
10 #include <boost/qvm/vec.hpp>
11 #include "test_qvm_matrix.hpp"
12 #include "test_qvm_vector.hpp"
17 template <class T
,class U
>
26 template <class T
,class U
>
28 check_same_type( T
const &, U
const & )
33 template <int M
,int N
>
37 using namespace boost::qvm::sfinae
;
38 test_qvm::matrix
<M1
,M
,N
> const x(42,1);
39 test_qvm::vector
<V1
,N
> const y(42,1);
41 test_qvm::vector
<V2
,M
> r
=x
*y
;
42 test_qvm::multiply_mv(r
.b
,x
.b
,y
.b
);
43 BOOST_QVM_TEST_CLOSE(r
.a
,r
.b
,0.0000001f
);
46 test_qvm::vector
<V2
,M
> r
=mref(x
)*y
;
47 test_qvm::multiply_mv(r
.b
,x
.b
,y
.b
);
48 BOOST_QVM_TEST_CLOSE(r
.a
,r
.b
,0.0000001f
);
51 test_qvm::vector
<V2
,M
> r
=x
*vref(y
);
52 test_qvm::multiply_mv(r
.b
,x
.b
,y
.b
);
53 BOOST_QVM_TEST_CLOSE(r
.a
,r
.b
,0.0000001f
);
55 check_same_type(x
*y
,boost::qvm::vec
<float,M
>());
74 return boost::report_errors();