File indexing completed on 2025-07-09 08:17:51
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 <type_traits>
0021 #include <complex>
0022 #include <array>
0023
0024 #include <boost/numeric/odeint/config.hpp>
0025
0026 #include <boost/numeric/ublas/vector.hpp>
0027 #include <boost/numeric/ublas/matrix.hpp>
0028
0029 #include <boost/numeric/odeint/algebra/range_algebra.hpp>
0030 #include <boost/numeric/odeint/algebra/array_algebra.hpp>
0031 #include <boost/numeric/odeint/algebra/vector_space_algebra.hpp>
0032
0033 namespace boost {
0034 namespace numeric {
0035 namespace odeint {
0036
0037 template< class StateType , class Enabler = void >
0038 struct algebra_dispatcher_sfinae
0039 {
0040
0041 typedef range_algebra algebra_type;
0042 };
0043
0044 template< class StateType >
0045 struct algebra_dispatcher : algebra_dispatcher_sfinae< StateType > { };
0046
0047
0048 template< class T , size_t N >
0049 struct algebra_dispatcher< std::array< T , N > >
0050 {
0051 typedef array_algebra algebra_type;
0052 };
0053
0054
0055 template< typename T >
0056 struct algebra_dispatcher_sfinae< T , typename std::enable_if< std::is_floating_point< T >::value >::type >
0057 {
0058 typedef vector_space_algebra algebra_type;
0059 };
0060
0061 template< typename T >
0062 struct algebra_dispatcher< std::complex<T> >
0063 {
0064 typedef vector_space_algebra algebra_type;
0065 };
0066
0067
0068
0069 template< class T , class A >
0070 struct algebra_dispatcher< boost::numeric::ublas::vector< T , A > >
0071 {
0072 typedef vector_space_algebra algebra_type;
0073 };
0074
0075 template< class T , class L , class A >
0076 struct algebra_dispatcher< boost::numeric::ublas::matrix< T , L , A > >
0077 {
0078 typedef vector_space_algebra algebra_type;
0079 };
0080
0081
0082 }
0083 }
0084 }
0085
0086 #endif