File indexing completed on 2025-01-18 09:42:49
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_ALGEBRA_DISPATCHER_HPP_INCLUDED
0018 #define BOOST_NUMERIC_ODEINT_ALGEBRA_ALGEBRA_DISPATCHER_HPP_INCLUDED
0019
0020 #include <boost/numeric/odeint/config.hpp>
0021
0022 #include <complex>
0023 #include <boost/type_traits/is_floating_point.hpp>
0024
0025 #include <boost/numeric/ublas/vector.hpp>
0026 #include <boost/numeric/ublas/matrix.hpp>
0027
0028 #include <boost/numeric/odeint/algebra/range_algebra.hpp>
0029 #include <boost/numeric/odeint/algebra/array_algebra.hpp>
0030 #include <boost/numeric/odeint/algebra/vector_space_algebra.hpp>
0031
0032 #include <boost/array.hpp>
0033
0034
0035 namespace boost {
0036 namespace numeric {
0037 namespace odeint {
0038
0039 template< class StateType , class Enabler = void >
0040 struct algebra_dispatcher_sfinae
0041 {
0042
0043 typedef range_algebra algebra_type;
0044 };
0045
0046 template< class StateType >
0047 struct algebra_dispatcher : algebra_dispatcher_sfinae< StateType > { };
0048
0049
0050 template< class T , size_t N >
0051 struct algebra_dispatcher< boost::array< T , N > >
0052 {
0053 typedef array_algebra algebra_type;
0054 };
0055
0056
0057 template< typename T >
0058 struct algebra_dispatcher_sfinae< T , typename boost::enable_if< typename boost::is_floating_point< T >::type >::type >
0059 {
0060 typedef vector_space_algebra algebra_type;
0061 };
0062
0063 template< typename T >
0064 struct algebra_dispatcher< std::complex<T> >
0065 {
0066 typedef vector_space_algebra algebra_type;
0067 };
0068
0069
0070
0071 template< class T , class A >
0072 struct algebra_dispatcher< boost::numeric::ublas::vector< T , A > >
0073 {
0074 typedef vector_space_algebra algebra_type;
0075 };
0076
0077 template< class T , class L , class A >
0078 struct algebra_dispatcher< boost::numeric::ublas::matrix< T , L , A > >
0079 {
0080 typedef vector_space_algebra algebra_type;
0081 };
0082
0083
0084 }
0085 }
0086 }
0087
0088 #ifdef BOOST_NUMERIC_ODEINT_CXX11
0089
0090
0091
0092 #include <array>
0093
0094 namespace boost {
0095 namespace numeric {
0096 namespace odeint {
0097
0098
0099 template< class T , size_t N >
0100 struct algebra_dispatcher< std::array< T , N > >
0101 {
0102 typedef array_algebra algebra_type;
0103 };
0104
0105 } } }
0106
0107 #endif
0108
0109
0110 #endif