resize.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //==============================================================================
  2. // Copyright 2014 LRI UMR 8623 CNRS/Univ Paris Sud XI
  3. // Copyright 2014 NumScale SAS
  4. //
  5. // Distributed under the Boost Software License, Version 1.0.
  6. // See accompanying file LICENSE.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt
  8. //==============================================================================
  9. #include <boost/numeric/odeint.hpp>
  10. #include <nt2/table.hpp>
  11. #include <boost/config.hpp>
  12. #ifdef BOOST_MSVC
  13. #pragma warning(disable:4996)
  14. #endif
  15. #define BOOST_TEST_MODULE odeint_nt2_resize
  16. #include <boost/test/included/unit_test.hpp>
  17. #include <boost/numeric/odeint/external/nt2/nt2_resize.hpp>
  18. #include <boost/mpl/list.hpp>
  19. using namespace boost::unit_test;
  20. using namespace boost::numeric::odeint;
  21. typedef boost::mpl::list< float , double > fp_types;
  22. BOOST_AUTO_TEST_SUITE( nt2_resize )
  23. BOOST_AUTO_TEST_CASE_TEMPLATE( test_resize, T, fp_types )
  24. {
  25. nt2::table<T> x;
  26. x.resize(nt2::of_size(10,10));
  27. nt2::table<T> y;
  28. BOOST_CHECK_EQUAL(same_size(x,y),false);
  29. resize(y,x);
  30. BOOST_CHECK_EQUAL(same_size(x,y),true);
  31. }
  32. BOOST_AUTO_TEST_SUITE_END()