• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2   [auto_generated]
3   boost/numeric/odeint/external/eigen/eigen_resize.hpp
4 
5   [begin_description]
6   tba.
7   [end_description]
8 
9   Copyright 2013 Ankur Sinha
10   Copyright 2013 Karsten Ahnert
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_EXTERNAL_EIGEN_EIGEN_RESIZE_HPP_DEFINED
19 #define BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_RESIZE_HPP_DEFINED
20 
21 
22 #include <boost/numeric/odeint/util/is_resizeable.hpp>
23 #include <boost/numeric/odeint/util/resize.hpp>
24 #include <boost/numeric/odeint/util/same_size.hpp>
25 
26 #include <boost/utility/enable_if.hpp>
27 #include <boost/type_traits/is_base_of.hpp>
28 
29 #include <Eigen/Dense>
30 
31 namespace boost {
32 namespace numeric {
33 namespace odeint {
34 
35 
36 
37 template< class Derived >
38 struct is_resizeable_sfinae< Derived ,
39                       typename boost::enable_if< typename boost::is_base_of< Eigen::MatrixBase< Derived > , Derived >::type >::type >
40 {
41     typedef boost::true_type type;
42     const static bool value = type::value;
43 };
44 
45 
46 template < class Derived  >
47 struct is_resizeable_sfinae< Derived ,
48                       typename boost::enable_if< typename boost::is_base_of< Eigen::ArrayBase< Derived > , Derived >::type >::type >
49 {
50     typedef boost::true_type type;
51     const static bool value = type::value;
52 };
53 
54 
55 
56 template< class Derived >
57 struct same_size_impl_sfinae< Derived , Derived ,
58                        typename boost::enable_if< typename boost::is_base_of< Eigen::MatrixBase< Derived > , Derived >::type >::type >
59 {
same_sizeboost::numeric::odeint::same_size_impl_sfinae60     static bool same_size( const Eigen::MatrixBase< Derived > &m1 , const Eigen::MatrixBase< Derived > &m2 )
61 
62     {
63         return ( ( m1.innerSize () == m2.innerSize () ) && ( m1.outerSize() == m2.outerSize() ) );
64     }
65 };
66 
67 template< class Derived  >
68 struct same_size_impl_sfinae< Derived , Derived ,
69                        typename boost::enable_if< typename boost::is_base_of< Eigen::ArrayBase< Derived > , Derived >::type >::type >
70 {
same_sizeboost::numeric::odeint::same_size_impl_sfinae71     static bool same_size( const Eigen::ArrayBase< Derived > &v1 , const Eigen::ArrayBase< Derived >  &v2 )
72     {
73         return  ( ( v1.innerSize () == v2.innerSize () ) && ( v1.outerSize() == v2.outerSize() ) );
74     }
75 };
76 
77 
78 
79 
80 template< class Derived >
81 struct resize_impl_sfinae< Derived , Derived ,
82                     typename boost::enable_if< typename boost::is_base_of< Eigen::MatrixBase< Derived > , Derived >::type >::type >
83 {
resizeboost::numeric::odeint::resize_impl_sfinae84     static void resize( Eigen::MatrixBase< Derived > &m1 , const Eigen::MatrixBase< Derived > &m2 )
85     {
86         m1.derived().resizeLike(m2);
87     }
88 };
89 
90 template< class Derived >
91 struct resize_impl_sfinae< Derived , Derived ,
92                     typename boost::enable_if< typename boost::is_base_of< Eigen::ArrayBase< Derived > , Derived >::type >::type >
93 {
resizeboost::numeric::odeint::resize_impl_sfinae94     static void resize( Eigen::ArrayBase< Derived > &v1 , const Eigen::ArrayBase< Derived > &v2 )
95     {
96         v1.derived().resizeLike(v2);
97     }
98 };
99 
100 
101 
102 } // namespace odeint
103 } // namespace numeric
104 } // namespace boost
105 
106 
107 #endif // BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_RESIZE_HPP_DEFINED
108