comparison DEPENDENCIES/generic/include/boost/numeric/odeint/util/copy.hpp @ 16:2665513ce2d3

Add boost headers
author Chris Cannam
date Tue, 05 Aug 2014 11:11:38 +0100
parents
children c530137014c0
comparison
equal deleted inserted replaced
15:663ca0da4350 16:2665513ce2d3
1 /*
2 [auto_generated]
3 boost/numeric/odeint/util/copy.hpp
4
5 [begin_description]
6 Copy abstraction for the usage in the steppers.
7 [end_description]
8
9 Copyright 2009-2011 Karsten Ahnert
10 Copyright 2009-2011 Mario Mulansky
11
12 Distributed under the Boost Software License, Version 1.0.
13 (See accompanying file LICENSE_1_0.txt or
14 copy at http://www.boost.org/LICENSE_1_0.txt)
15 */
16
17
18 #ifndef BOOST_NUMERIC_ODEINT_UTIL_COPY_HPP_INCLUDED
19 #define BOOST_NUMERIC_ODEINT_UTIL_COPY_HPP_INCLUDED
20
21
22 #include <boost/range/algorithm/copy.hpp>
23
24 #include <boost/utility/enable_if.hpp>
25
26 #include <boost/numeric/odeint/util/detail/is_range.hpp>
27
28 namespace boost {
29 namespace numeric {
30 namespace odeint {
31
32 namespace detail {
33
34 template< class Container1 , class Container2 >
35 void do_copying( const Container1 &from , Container2 &to , boost::mpl::true_ )
36 {
37 boost::range::copy( from , boost::begin( to ) );
38 }
39
40 template< class Container1 , class Container2 >
41 void do_copying( const Container1 &from , Container2 &to , boost::mpl::false_ )
42 {
43 to = from;
44 }
45
46 } // namespace detail
47
48
49 /*
50 * Default implementation of the copy operation used the assign operator
51 * gsl_vector must copied differently
52 */
53 template< class Container1, class Container2 , class Enabler = void >
54 struct copy_impl
55 {
56 static void copy( const Container1 &from , Container2 &to )
57 {
58 typedef typename boost::numeric::odeint::detail::is_range< Container1 >::type is_range_type;
59 detail::do_copying( from , to , is_range_type() );
60 }
61 };
62
63 template< class Container1 , class Container2 >
64 void copy( const Container1 &from , Container2 &to )
65 {
66 copy_impl< Container1 , Container2 >::copy( from , to );
67 }
68
69
70 } // namespace odeint
71 } // namespace numeric
72 } // namespace boost
73
74
75 #endif // BOOST_NUMERIC_ODEINT_UTIL_COPY_HPP_INCLUDED