Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:42:49

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 <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     // range_algebra is the standard algebra
0043     typedef range_algebra algebra_type;
0044 };
0045 
0046 template< class StateType >
0047 struct algebra_dispatcher : algebra_dispatcher_sfinae< StateType > { };
0048 
0049 // specialize for array
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 //specialize for some integral types
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 ///* think about that again....
0070 // specialize for ublas vector and matrix types
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 // c++11 mode: specialization for std::array if available
0091 
0092 #include <array>
0093 
0094 namespace boost {
0095 namespace numeric {
0096 namespace odeint {
0097     
0098 // specialize for std::array
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