Brian Silverman | 7c33ab2 | 2018-08-04 17:14:51 -0700 | [diff] [blame^] | 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 <nt2/include/functions/linspace.hpp> |
| 12 | |
| 13 | #include <boost/config.hpp> |
| 14 | #ifdef BOOST_MSVC |
| 15 | #pragma warning(disable:4996) |
| 16 | #endif |
| 17 | |
| 18 | #define BOOST_TEST_MODULE odeint_nt2_copy |
| 19 | |
| 20 | #include <boost/test/included/unit_test.hpp> |
| 21 | #include <boost/numeric/odeint/external/nt2/nt2_copy.hpp> |
| 22 | |
| 23 | #include <boost/mpl/list.hpp> |
| 24 | |
| 25 | using namespace boost::unit_test; |
| 26 | using namespace boost::numeric::odeint; |
| 27 | |
| 28 | typedef boost::mpl::list< float , double > fp_types; |
| 29 | |
| 30 | BOOST_AUTO_TEST_SUITE( nt2_copy ) |
| 31 | |
| 32 | BOOST_AUTO_TEST_CASE_TEMPLATE( test_copy, T, fp_types ) |
| 33 | { |
| 34 | nt2::table<T> x = nt2::linspace(T(1),T(0),7); |
| 35 | |
| 36 | nt2::table<T> y; |
| 37 | |
| 38 | copy(y,x); |
| 39 | |
| 40 | for (std::size_t ii=1; ii<=x.size();ii++) |
| 41 | BOOST_CHECK_EQUAL(x(ii),y(ii)); |
| 42 | } |
| 43 | |
| 44 | BOOST_AUTO_TEST_SUITE_END() |