]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/numeric/odeint/include/boost/numeric/odeint/external/eigen/eigen_resize.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / numeric / odeint / include / boost / numeric / odeint / external / eigen / eigen_resize.hpp
CommitLineData
7c673cae
FG
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
31namespace boost {
32namespace numeric {
33namespace odeint {
34
35
36
37template< class Derived >
38struct 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
46template < class Derived >
47struct 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
56template< class Derived >
57struct same_size_impl_sfinae< Derived , Derived ,
58 typename boost::enable_if< typename boost::is_base_of< Eigen::MatrixBase< Derived > , Derived >::type >::type >
59{
60 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
67template< class Derived >
68struct same_size_impl_sfinae< Derived , Derived ,
69 typename boost::enable_if< typename boost::is_base_of< Eigen::ArrayBase< Derived > , Derived >::type >::type >
70{
71 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
80template< class Derived >
81struct resize_impl_sfinae< Derived , Derived ,
82 typename boost::enable_if< typename boost::is_base_of< Eigen::MatrixBase< Derived > , Derived >::type >::type >
83{
84 static void resize( Eigen::MatrixBase< Derived > &m1 , const Eigen::MatrixBase< Derived > &m2 )
85 {
86 m1.derived().resizeLike(m2);
87 }
88};
89
90template< class Derived >
91struct resize_impl_sfinae< Derived , Derived ,
92 typename boost::enable_if< typename boost::is_base_of< Eigen::ArrayBase< Derived > , Derived >::type >::type >
93{
94 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