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/examples/2d_lattice/nested_range_algebra.hpp b/examples/2d_lattice/nested_range_algebra.hpp
new file mode 100644
index 0000000..0afa367
--- /dev/null
+++ b/examples/2d_lattice/nested_range_algebra.hpp
@@ -0,0 +1,46 @@
+/*
+ Copyright 2011 Mario Mulansky
+ Copyright 2012 Karsten Ahnert
+
+ 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)
+ */
+
+
+/* nested range algebra */
+
+#ifndef NESTED_RANGE_ALGEBRA
+#define NESTED_RANGE_ALGEBRA
+
+namespace detail {
+
+    template< class Iterator1 , class Iterator2 , class Iterator3 , class Operation , class Algebra >
+    void for_each3( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3, Operation op , Algebra &algebra )
+{
+    for( ; first1 != last1 ; )
+        algebra.for_each3( *first1++ , *first2++ , *first3++ , op );
+}
+}
+
+
+template< class InnerAlgebra >
+struct nested_range_algebra
+{
+    
+    nested_range_algebra() 
+        : m_inner_algebra()
+    { }
+
+    template< class S1 , class S2 , class S3 , class Op >
+    void for_each3( S1 &s1 , S2 &s2 , S3 &s3 , Op op )
+    {
+        detail::for_each3( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , op , m_inner_algebra );
+    }
+
+
+private:
+    InnerAlgebra m_inner_algebra;
+};
+
+#endif