]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/numeric/odeint/test_external/nt2/norm_inf.cpp
1 //==============================================================================
2 // Copyright 2014 LRI UMR 8623 CNRS/Univ Paris Sud XI
3 // Copyright 2014 NumScale SAS
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/zeros.hpp>
12 #include <nt2/include/functions/ones.hpp>
14 #include <boost/config.hpp>
16 #pragma warning(disable:4996)
19 #define BOOST_TEST_MODULE odeint_nt2_copy
21 #include <boost/test/included/unit_test.hpp>
22 #include <boost/test/floating_point_comparison.hpp>
23 #include <boost/numeric/odeint/external/nt2/nt2_norm_inf.hpp>
25 #include <boost/mpl/list.hpp>
27 using namespace boost::unit_test
;
28 using namespace boost::numeric::odeint
;
30 typedef boost::mpl::list
< float , double > fp_types
;
32 BOOST_AUTO_TEST_SUITE( nt2_norm_inf
)
34 BOOST_AUTO_TEST_CASE_TEMPLATE( test_norm_inf
, T
, fp_types
)
36 nt2::table
<T
> x
= nt2::ones(10,1, nt2::meta::as_
<T
>() );
39 nt2::table
<T
> y
= nt2::zeros(8,8, nt2::meta::as_
<T
>() );
42 BOOST_CHECK_SMALL(vector_space_norm_inf
<nt2::table
<T
> >()(x
) - T(55), T(1e-10));
43 BOOST_CHECK_SMALL(vector_space_norm_inf
<nt2::table
<T
> >()(y
) - T(42), T(1e-10));
46 BOOST_AUTO_TEST_SUITE_END()