div_eq_ms_test.cpp 864 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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,1);
  15. test_qvm::scalar_multiply_m(x.b,x.a,0.5f);
  16. x/=2;
  17. BOOST_QVM_TEST_EQ(x.a,x.b);
  18. }
  19. }
  20. int
  21. main()
  22. {
  23. test<1,2>();
  24. test<2,1>();
  25. test<2,2>();
  26. test<1,3>();
  27. test<3,1>();
  28. test<3,3>();
  29. test<1,4>();
  30. test<4,1>();
  31. test<4,4>();
  32. test<1,5>();
  33. test<5,1>();
  34. test<5,5>();
  35. return boost::report_errors();
  36. }