• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  [auto_generated]
3  boost/numeric/odeint/algebra/range_algebra.hpp
4 
5  [begin_description]
6  Default algebra, which works with the most state types, like vector< double >, boost::array< double >, boost::range.
7  Internally is uses boost::range to obtain the begin and end iterator of the according sequence.
8  [end_description]
9 
10  Copyright 2010-2013 Karsten Ahnert
11  Copyright 2010-2013 Mario Mulansky
12 
13  Distributed under the Boost Software License, Version 1.0.
14  (See accompanying file LICENSE_1_0.txt or
15  copy at http://www.boost.org/LICENSE_1_0.txt)
16  */
17 
18 
19 #ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_RANGE_ALGEBRA_HPP_INCLUDED
20 #define BOOST_NUMERIC_ODEINT_ALGEBRA_RANGE_ALGEBRA_HPP_INCLUDED
21 
22 #include <boost/range.hpp>
23 #include <boost/mpl/size_t.hpp>
24 
25 #include <boost/numeric/odeint/algebra/detail/macros.hpp>
26 #include <boost/numeric/odeint/algebra/detail/for_each.hpp>
27 #include <boost/numeric/odeint/algebra/detail/norm_inf.hpp>
28 #include <boost/numeric/odeint/algebra/norm_result_type.hpp>
29 
30 namespace boost {
31 namespace numeric {
32 namespace odeint {
33 
34 struct range_algebra
35 {
36     template< class S1 , class Op >
for_each1boost::numeric::odeint::range_algebra37     static void for_each1( S1 &s1 , Op op )
38     {
39         detail::for_each1( boost::begin( s1 ) , boost::end( s1 ) ,
40                 op );
41     }
42 
43     template< class S1 , class S2 , class Op >
for_each2boost::numeric::odeint::range_algebra44     static void for_each2( S1 &s1 , S2 &s2 , Op op )
45     {
46         detail::for_each2( boost::begin( s1 ) , boost::end( s1 ) ,
47                 boost::begin( s2 ) , op );
48     }
49 
50     template< class S1 , class S2 , class S3 , class Op >
for_each3boost::numeric::odeint::range_algebra51     static void for_each3( S1 &s1 , S2 &s2 , S3 &s3 , Op op )
52     {
53         detail::for_each3( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , op );
54     }
55 
56     template< class S1 , class S2 , class S3 , class S4 , class Op >
for_each4boost::numeric::odeint::range_algebra57     static void for_each4( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , Op op )
58     {
59         detail::for_each4( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , op );
60     }
61 
62     template< class S1 , class S2 , class S3 , class S4 , class S5 , class Op >
for_each5boost::numeric::odeint::range_algebra63     static void for_each5( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , Op op )
64     {
65         detail::for_each5( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , op );
66     }
67 
68     template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class Op >
for_each6boost::numeric::odeint::range_algebra69     static void for_each6( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , Op op )
70     {
71         detail::for_each6( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , op );
72     }
73 
74     template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class Op >
for_each7boost::numeric::odeint::range_algebra75     static void for_each7( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , Op op )
76     {
77         detail::for_each7( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , op );
78     }
79 
80     template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class Op >
for_each8boost::numeric::odeint::range_algebra81     static void for_each8( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , Op op )
82     {
83         detail::for_each8( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , boost::begin( s8 ) , op );
84     }
85 
86     template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class Op >
for_each9boost::numeric::odeint::range_algebra87     static void for_each9( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , Op op )
88     {
89         detail::for_each9( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , boost::begin( s8 ) , boost::begin( s9 ) , op );
90     }
91 
92     template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class Op >
for_each10boost::numeric::odeint::range_algebra93     static void for_each10( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , Op op )
94     {
95         detail::for_each10( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , boost::begin( s8 ) , boost::begin( s9 ) , boost::begin( s10 ) , op );
96     }
97 
98     template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class S11 , class Op >
for_each11boost::numeric::odeint::range_algebra99     static void for_each11( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , Op op )
100     {
101         detail::for_each11( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , boost::begin( s8 ) , boost::begin( s9 ) , boost::begin( s10 ) , boost::begin( s11 ) , op );
102     }
103 
104     template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class Op >
for_each12boost::numeric::odeint::range_algebra105     static void for_each12( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , Op op )
106     {
107         detail::for_each12( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , boost::begin( s8 ) , boost::begin( s9 ) , boost::begin( s10 ) , boost::begin( s11 ) , boost::begin( s12 ) , op );
108     }
109 
110     template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class S13 , class Op >
for_each13boost::numeric::odeint::range_algebra111     static void for_each13( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , S13 &s13 , Op op )
112     {
113         detail::for_each13( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , boost::begin( s8 ) , boost::begin( s9 ) , boost::begin( s10 ) , boost::begin( s11 ) , boost::begin( s12 ) , boost::begin( s13 ) , op );
114     }
115 
116     template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class S13 , class S14 , class Op >
for_each14boost::numeric::odeint::range_algebra117     static void for_each14( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , S13 &s13 , S14 &s14 , Op op )
118     {
119         detail::for_each14( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , boost::begin( s8 ) , boost::begin( s9 ) , boost::begin( s10 ) , boost::begin( s11 ) , boost::begin( s12 ) , boost::begin( s13 ) , boost::begin( s14 ) , op );
120     }
121 
122     template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class S13 , class S14 , class S15 , class Op >
for_each15boost::numeric::odeint::range_algebra123     static void for_each15( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , S13 &s13 , S14 &s14 , S15 &s15 , Op op )
124     {
125         detail::for_each15( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , boost::begin( s8 ) , boost::begin( s9 ) , boost::begin( s10 ) , boost::begin( s11 ) , boost::begin( s12 ) , boost::begin( s13 ) , boost::begin( s14 ) , boost::begin( s15 ) , op );
126     }
127 
128     template< typename S >
norm_infboost::numeric::odeint::range_algebra129     static typename norm_result_type<S>::type norm_inf( const S &s )
130     {
131         return detail::norm_inf( boost::begin( s ) , boost::end( s ) ,
132                                  static_cast< typename norm_result_type<S>::type >( 0 ) );
133     }
134 
135 };
136 
137 } // odeint
138 } // numeric
139 } // boost
140 
141 
142 #endif // BOOST_NUMERIC_ODEINT_ALGEBRA_RANGE_ALGEBRA_HPP_INCLUDED
143