plus_eq_mm_test.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 Rows,int Cols>
  10. void
  11. test()
  12. {
  13. using namespace boost::qvm::sfinae;
  14. test_qvm::matrix<M1,Rows,Cols> x(42,2);
  15. {
  16. test_qvm::matrix<M1,Rows,Cols> const y(42,1);
  17. test_qvm::add_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<M2,Rows,Cols> const y(42,1);
  23. test_qvm::add_m(x.b,x.a,y.a);
  24. x+=y;
  25. BOOST_QVM_TEST_EQ(x.a,x.b);
  26. }
  27. }
  28. }
  29. int
  30. main()
  31. {
  32. test<1,2>();
  33. test<2,1>();
  34. test<2,2>();
  35. test<1,3>();
  36. test<3,1>();
  37. test<3,3>();
  38. test<1,4>();
  39. test<4,1>();
  40. test<4,4>();
  41. test<1,5>();
  42. test<5,1>();
  43. test<5,5>();
  44. return boost::report_errors();
  45. }