123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- #ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_ALGEBRA_DISPATCHER_HPP_INCLUDED
- #define BOOST_NUMERIC_ODEINT_ALGEBRA_ALGEBRA_DISPATCHER_HPP_INCLUDED
- #include <boost/numeric/odeint/config.hpp>
- #include <complex>
- #include <boost/type_traits/is_floating_point.hpp>
- #include <boost/numeric/ublas/vector.hpp>
- #include <boost/numeric/ublas/matrix.hpp>
- #include <boost/numeric/odeint/algebra/range_algebra.hpp>
- #include <boost/numeric/odeint/algebra/array_algebra.hpp>
- #include <boost/numeric/odeint/algebra/vector_space_algebra.hpp>
- #include <boost/array.hpp>
- namespace boost {
- namespace numeric {
- namespace odeint {
-
- template< class StateType , class Enabler = void >
- struct algebra_dispatcher_sfinae
- {
-
- typedef range_algebra algebra_type;
- };
- template< class StateType >
- struct algebra_dispatcher : algebra_dispatcher_sfinae< StateType > { };
- template< class T , size_t N >
- struct algebra_dispatcher< boost::array< T , N > >
- {
- typedef array_algebra algebra_type;
- };
- template< typename T >
- struct algebra_dispatcher_sfinae< T , typename boost::enable_if< typename boost::is_floating_point< T >::type >::type >
- {
- typedef vector_space_algebra algebra_type;
- };
- template< typename T >
- struct algebra_dispatcher< std::complex<T> >
- {
- typedef vector_space_algebra algebra_type;
- };
- template< class T , class A >
- struct algebra_dispatcher< boost::numeric::ublas::vector< T , A > >
- {
- typedef vector_space_algebra algebra_type;
- };
- template< class T , class L , class A >
- struct algebra_dispatcher< boost::numeric::ublas::matrix< T , L , A > >
- {
- typedef vector_space_algebra algebra_type;
- };
- }
- }
- }
- #ifdef BOOST_NUMERIC_ODEINT_CXX11
- #include <array>
- namespace boost {
- namespace numeric {
- namespace odeint {
-
- template< class T , size_t N >
- struct algebra_dispatcher< std::array< T , N > >
- {
- typedef array_algebra algebra_type;
- };
- } } }
- #endif
- #endif
|