Squashed 'boost/' content from commit b4feb19f2

git-subtree-dir: boost
git-subtree-split: b4feb19f287ee92d87a9624b5d36b7cf46aeadeb
This commit is contained in:
Bill Somerville
2018-06-09 21:48:32 +01:00
commit 4ebe6417a5
12444 changed files with 2327021 additions and 0 deletions
@@ -0,0 +1,30 @@
# Copyright 2012 Karsten Ahnert
# Copyright 2012 Mario Mulansky
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
# bring in rules for testing
import testing ;
use-project boost : $(BOOST_ROOT) ;
project
: requirements
<library>/boost/test//boost_unit_test_framework
;
lib libmkl : : <name>mkl_intel_lp64 <link>shared ;
lib libmkl_core : : <name>mkl_core <link>shared ;
lib libmkl_intel_thread : : <name>mkl_intel_thread ;
lib libiomp5 : : <name>iomp5 ;
lib libpthread : : <name>pthread ;
test-suite "mkl"
:
[ run check_mkl.cpp libpthread libiomp5 libmkl_core libmkl_intel_thread libmkl
:
:
: <link>shared:<define>BOOST_TEST_DYN_LINK=1
]
;
@@ -0,0 +1,51 @@
/* Boost check_mkl.cpp test file
Copyright 2010-2011 Mario Mulansky
Copyright 2011 Karsten Ahnert
This file tests the odeint library with the intel mkl blas1 routines
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or
copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#define BOOST_TEST_MODULE test_mkl
#include <boost/test/unit_test.hpp>
#include <boost/numeric/odeint/stepper/euler.hpp>
#include <boost/numeric/odeint/stepper/runge_kutta4.hpp>
#include <boost/numeric/odeint/algebra/vector_space_algebra.hpp>
#include <boost/numeric/odeint/external/mkl/mkl_operations.hpp>
using namespace boost::numeric::odeint;
typedef double value_type;
typedef boost::array< value_type , 1 > state_type;
void constant_system( state_type &x , state_type &dxdt , value_type t )
{
dxdt[0] = 1.0;
}
const double eps = 1E-14;
BOOST_AUTO_TEST_CASE( test_mkl )
{
//to use mkl routines we have to use the vector_space_algebra and the mkl_operations
runge_kutta4< state_type , value_type , state_type , value_type , vector_space_algebra , mkl_operations > stepper;
state_type x;
x[0] = 0.0;
stepper.do_step( constant_system , x , 0.0 , 0.1 );
using std::abs;
std::cout << x[0] << " ?= " << 0.1 << std::endl;
BOOST_CHECK_SMALL( abs( x[0] - 0.1 ) , eps );
}