Squashed 'third_party/boostorg/odeint/' content from commit 6ff2719

Change-Id: If4892e29c1a5e6cf3a7aa51486a2725c251b0c7d
git-subtree-dir: third_party/boostorg/odeint
git-subtree-split: 6ff2719b6907b86596c3d43e88c1bcfdf29df560
diff --git a/test_external/mkl/Jamfile.v2 b/test_external/mkl/Jamfile.v2
new file mode 100644
index 0000000..f585fa8
--- /dev/null
+++ b/test_external/mkl/Jamfile.v2
@@ -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
+      ] 
+    ;
diff --git a/test_external/mkl/check_mkl.cpp b/test_external/mkl/check_mkl.cpp
new file mode 100644
index 0000000..bedbd66
--- /dev/null
+++ b/test_external/mkl/check_mkl.cpp
@@ -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 );
+
+}