Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-09 08:17:51

0001 /*
0002  [auto_generated]
0003  boost/numeric/odeint/algebra/algebra_dispatcher.hpp
0004 
0005  [begin_description]
0006  Algebra dispatcher to automatically chose suitable algebra.
0007  [end_description]
0008 
0009  Copyright 2013 Karsten Ahnert
0010  Copyright 2013 Mario Mulansky
0011 
0012  Distributed under the Boost Software License, Version 1.0.
0013  (See accompanying file LICENSE_1_0.txt or
0014  copy at http://www.boost.org/LICENSE_1_0.txt)
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     // range_algebra is the standard algebra
0041     typedef range_algebra algebra_type;
0042 };
0043 
0044 template< class StateType >
0045 struct algebra_dispatcher : algebra_dispatcher_sfinae< StateType > { };
0046 
0047 // specialize for array
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 //specialize for some integral types
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 ///* think about that again....
0068 // specialize for ublas vector and matrix types
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