Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:58:35

0001 /*
0002   [auto_generated]
0003   boost/numeric/odeint/external/eigen/eigen_resize.hpp
0004 
0005   [begin_description]
0006   tba.
0007   [end_description]
0008 
0009   Copyright 2013 Ankur Sinha
0010   Copyright 2013 Karsten Ahnert
0011 
0012   Distributed under the Boost Software License, Version 1.0.
0013   (See accompanying file LICENSE_1_0.txt or
0014   copy at http://www.boost.org/LICENSE_1_0.txt)
0015 */
0016 
0017 
0018 #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_RESIZE_HPP_DEFINED
0019 #define BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_RESIZE_HPP_DEFINED
0020 
0021 #include <type_traits>
0022 
0023 #include <boost/numeric/odeint/util/is_resizeable.hpp>
0024 #include <boost/numeric/odeint/util/resize.hpp>
0025 #include <boost/numeric/odeint/util/same_size.hpp>
0026 
0027 #include <Eigen/Dense>
0028 
0029 namespace boost {
0030 namespace numeric {
0031 namespace odeint {
0032 
0033 template< class Derived >
0034 struct is_resizeable_sfinae< Derived ,
0035                       typename std::enable_if< std::is_base_of< Eigen::MatrixBase< Derived > , Derived >::value >::type >
0036 { 
0037     typedef std::integral_constant<bool, true> type;
0038     const static bool value = type::value;
0039 };
0040 
0041 
0042 template < class Derived  >
0043 struct is_resizeable_sfinae< Derived ,
0044                       typename std::enable_if< std::is_base_of< Eigen::ArrayBase< Derived > , Derived >::value >::type >
0045 { 
0046     typedef std::integral_constant<bool, true> type;
0047     const static bool value = type::value;
0048 };
0049 
0050 
0051 
0052 template< class Derived >
0053 struct same_size_impl_sfinae< Derived , Derived ,
0054                        typename std::enable_if< std::is_base_of< Eigen::MatrixBase< Derived > , Derived >::value >::type >
0055 {
0056     static bool same_size( const Eigen::MatrixBase< Derived > &m1 , const Eigen::MatrixBase< Derived > &m2 )
0057 
0058     {
0059         return ( ( m1.innerSize () == m2.innerSize () ) && ( m1.outerSize() == m2.outerSize() ) );
0060     }
0061 };
0062 
0063 template< class Derived  >
0064 struct same_size_impl_sfinae< Derived , Derived ,
0065                        typename std::enable_if< std::is_base_of< Eigen::ArrayBase< Derived > , Derived >::value >::type >
0066 {
0067     static bool same_size( const Eigen::ArrayBase< Derived > &v1 , const Eigen::ArrayBase< Derived >  &v2 )
0068     {
0069         return  ( ( v1.innerSize () == v2.innerSize () ) && ( v1.outerSize() == v2.outerSize() ) );
0070     }
0071 };
0072 
0073 
0074 
0075 
0076 template< class Derived >
0077 struct resize_impl_sfinae< Derived , Derived ,
0078                     typename std::enable_if< std::is_base_of< Eigen::MatrixBase< Derived > , Derived >::value >::type >
0079 {
0080     static void resize( Eigen::MatrixBase< Derived > &m1 , const Eigen::MatrixBase< Derived > &m2 )
0081     {
0082         m1.derived().resizeLike(m2);
0083     }
0084 };
0085 
0086 template< class Derived >
0087 struct resize_impl_sfinae< Derived , Derived ,
0088                     typename std::enable_if< std::is_base_of< Eigen::ArrayBase< Derived > , Derived >::value >::type >
0089 {
0090     static void resize( Eigen::ArrayBase< Derived > &v1 , const Eigen::ArrayBase< Derived > &v2 )
0091     {
0092         v1.derived().resizeLike(v2);
0093     }
0094 };
0095 
0096 
0097 
0098 } // namespace odeint
0099 } // namespace numeric
0100 } // namespace boost
0101 
0102 
0103 #endif // BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_RESIZE_HPP_DEFINED