//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc. //Distributed under the Boost Software License, Version 1.0. (See accompanying //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include #include #include #include #include //#include #include "test_qvm_vector.hpp" #include "test_qvm_matrix.hpp" #include "gold.hpp" namespace { template struct same_type_tester; template struct same_type_tester { }; template void test_same_type( T, U ) { same_type_tester(); } } int main() { using namespace boost::qvm; test_qvm::vector x(42,1); test_qvm::vector y=x*2; test_qvm::matrix m; A00(m) = 0; A01(m) = -A2(x); A02(m) = A1(x); A10(m) = A2(x); A11(m) = 0; A12(m) = -A0(x); A20(m) = -A1(x); A21(m) = A0(x); A22(m) = 0; { test_same_type(x,cross(x,y)); test_qvm::vector c=cross(x,y); test_qvm::multiply_mv(c.b,m.a,y.a); BOOST_QVM_TEST_EQ(c.a,c.b); } { test_qvm::vector c=cross(vref(x),y); test_qvm::multiply_mv(c.b,m.a,y.a); BOOST_QVM_TEST_EQ(c.a,c.b); } { test_qvm::vector c=cross(x,vref(y)); test_qvm::multiply_mv(c.b,m.a,y.a); BOOST_QVM_TEST_EQ(c.a,c.b); } return boost::report_errors(); }