norm_inf.cpp 566 B

12345678910111213141516171819202122232425
  1. #define BOOST_TEST_MODULE odeint_vexcl_norm_inf
  2. #include <boost/numeric/odeint/external/vexcl/vexcl_norm_inf.hpp>
  3. #include <boost/test/unit_test.hpp>
  4. template <class T>
  5. double norm(const T &x) {
  6. return boost::numeric::odeint::vector_space_norm_inf<T>()(x);
  7. }
  8. BOOST_AUTO_TEST_CASE( norm_inf )
  9. {
  10. vex::Context ctx(vex::Filter::Env);
  11. std::cout << ctx << std::endl;
  12. vex::vector<double> x(ctx, 1024);
  13. x = 41;
  14. vex::multivector<double, 2> y(ctx, 1024);
  15. y = 42;
  16. BOOST_CHECK_EQUAL( norm(x), 41 );
  17. BOOST_CHECK_EQUAL( norm(y), 42 );
  18. }