mul_eq_mm_test.cpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
  2. //Distributed under the Boost Software License, Version 1.0. (See accompanying
  3. //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. #include <boost/qvm/mat_operations.hpp>
  5. #include "test_qvm_matrix.hpp"
  6. #include "gold.hpp"
  7. namespace
  8. {
  9. template <int Dim>
  10. void
  11. test()
  12. {
  13. using namespace boost::qvm::sfinae;
  14. {
  15. test_qvm::matrix<M1,Dim,Dim> x(42,1);
  16. test_qvm::matrix<M1,Dim,Dim> const y(42,2);
  17. test_qvm::multiply_m(x.b,x.a,y.a);
  18. x *= y;
  19. BOOST_QVM_TEST_EQ(x.a,x.b);
  20. }
  21. {
  22. test_qvm::matrix<M1,Dim,Dim> x(42,1);
  23. test_qvm::matrix<M2,Dim,Dim> const y(42,2);
  24. test_qvm::multiply_m(x.b,x.a,y.a);
  25. x *= y;
  26. BOOST_QVM_TEST_EQ(x.a,x.b);
  27. }
  28. }
  29. }
  30. int
  31. main()
  32. {
  33. test<2>();
  34. test<3>();
  35. test<4>();
  36. test<5>();
  37. return boost::report_errors();
  38. }