Chris@102: /* Chris@102: [auto_generated] Chris@102: boost/numeric/odeint/algebra/algebra_dispatcher.hpp Chris@102: Chris@102: [begin_description] Chris@102: Algebra dispatcher to automatically chose suitable algebra. Chris@102: [end_description] Chris@102: Chris@102: Copyright 2013 Karsten Ahnert Chris@102: Copyright 2013 Mario Mulansky Chris@102: Chris@102: Distributed under the Boost Software License, Version 1.0. Chris@102: (See accompanying file LICENSE_1_0.txt or Chris@102: copy at http://www.boost.org/LICENSE_1_0.txt) Chris@102: */ Chris@102: Chris@102: #ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_ALGEBRA_DISPATCHER_HPP_INCLUDED Chris@102: #define BOOST_NUMERIC_ODEINT_ALGEBRA_ALGEBRA_DISPATCHER_HPP_INCLUDED Chris@102: Chris@102: #include Chris@102: Chris@102: #include Chris@102: #include Chris@102: Chris@102: #include Chris@102: #include Chris@102: Chris@102: #include Chris@102: #include Chris@102: #include Chris@102: Chris@102: #include Chris@102: Chris@102: Chris@102: namespace boost { Chris@102: namespace numeric { Chris@102: namespace odeint { Chris@102: Chris@102: template< class StateType , class Enabler = void > Chris@102: struct algebra_dispatcher_sfinae Chris@102: { Chris@102: // range_algebra is the standard algebra Chris@102: typedef range_algebra algebra_type; Chris@102: }; Chris@102: Chris@102: template< class StateType > Chris@102: struct algebra_dispatcher : algebra_dispatcher_sfinae< StateType > { }; Chris@102: Chris@102: // specialize for array Chris@102: template< class T , size_t N > Chris@102: struct algebra_dispatcher< boost::array< T , N > > Chris@102: { Chris@102: typedef array_algebra algebra_type; Chris@102: }; Chris@102: Chris@102: //specialize for some integral types Chris@102: template< typename T > Chris@102: struct algebra_dispatcher_sfinae< T , typename boost::enable_if< typename boost::is_floating_point< T >::type >::type > Chris@102: { Chris@102: typedef vector_space_algebra algebra_type; Chris@102: }; Chris@102: Chris@102: template< typename T > Chris@102: struct algebra_dispatcher< std::complex > Chris@102: { Chris@102: typedef vector_space_algebra algebra_type; Chris@102: }; Chris@102: Chris@102: ///* think about that again.... Chris@102: // specialize for ublas vector and matrix types Chris@102: template< class T , class A > Chris@102: struct algebra_dispatcher< boost::numeric::ublas::vector< T , A > > Chris@102: { Chris@102: typedef vector_space_algebra algebra_type; Chris@102: }; Chris@102: Chris@102: template< class T , class L , class A > Chris@102: struct algebra_dispatcher< boost::numeric::ublas::matrix< T , L , A > > Chris@102: { Chris@102: typedef vector_space_algebra algebra_type; Chris@102: }; Chris@102: //*/ Chris@102: Chris@102: } Chris@102: } Chris@102: } Chris@102: Chris@102: #ifdef BOOST_NUMERIC_ODEINT_CXX11 Chris@102: Chris@102: // c++11 mode: specialization for std::array if available Chris@102: Chris@102: #include Chris@102: Chris@102: namespace boost { Chris@102: namespace numeric { Chris@102: namespace odeint { Chris@102: Chris@102: // specialize for std::array Chris@102: template< class T , size_t N > Chris@102: struct algebra_dispatcher< std::array< T , N > > Chris@102: { Chris@102: typedef array_algebra algebra_type; Chris@102: }; Chris@102: Chris@102: } } } Chris@102: Chris@102: #endif Chris@102: Chris@102: Chris@102: #endif