blob: 841728efc3ff73289d962b7a89be89f0b5864300 [file] [log] [blame]
Brian Silverman7c33ab22018-08-04 17:14:51 -07001//==============================================================================
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
25using namespace boost::unit_test;
26using namespace boost::numeric::odeint;
27
28typedef boost::mpl::list< float , double > fp_types;
29
30BOOST_AUTO_TEST_SUITE( nt2_copy )
31
32BOOST_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
44BOOST_AUTO_TEST_SUITE_END()