]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/numeric/odeint/test_external/mkl/check_mkl.cpp
1 /* Boost check_mkl.cpp test file
3 Copyright 2010-2011 Mario Mulansky
4 Copyright 2011 Karsten Ahnert
6 This file tests the odeint library with the intel mkl blas1 routines
8 Distributed under the Boost Software License, Version 1.0.
9 (See accompanying file LICENSE_1_0.txt or
10 copy at http://www.boost.org/LICENSE_1_0.txt)
13 #define BOOST_TEST_MODULE test_mkl
15 #include <boost/test/unit_test.hpp>
17 #include <boost/numeric/odeint/stepper/euler.hpp>
18 #include <boost/numeric/odeint/stepper/runge_kutta4.hpp>
19 #include <boost/numeric/odeint/algebra/vector_space_algebra.hpp>
20 #include <boost/numeric/odeint/external/mkl/mkl_operations.hpp>
22 using namespace boost::numeric::odeint
;
24 typedef double value_type
;
25 typedef boost::array
< value_type
, 1 > state_type
;
28 void constant_system( state_type
&x
, state_type
&dxdt
, value_type t
)
33 const double eps
= 1E-14;
36 BOOST_AUTO_TEST_CASE( test_mkl
)
39 //to use mkl routines we have to use the vector_space_algebra and the mkl_operations
40 runge_kutta4
< state_type
, value_type
, state_type
, value_type
, vector_space_algebra
, mkl_operations
> stepper
;
44 stepper
.do_step( constant_system
, x
, 0.0 , 0.1 );
48 std::cout
<< x
[0] << " ?= " << 0.1 << std::endl
;
49 BOOST_CHECK_SMALL( abs( x
[0] - 0.1 ) , eps
);