annotate DEPENDENCIES/generic/include/boost/numeric/odeint/algebra/algebra_dispatcher.hpp @ 125:34e428693f5d vext

Vext -> Repoint
author Chris Cannam
date Thu, 14 Jun 2018 11:15:39 +0100
parents f46d142149f5
children
rev   line source
Chris@102 1 /*
Chris@102 2 [auto_generated]
Chris@102 3 boost/numeric/odeint/algebra/algebra_dispatcher.hpp
Chris@102 4
Chris@102 5 [begin_description]
Chris@102 6 Algebra dispatcher to automatically chose suitable algebra.
Chris@102 7 [end_description]
Chris@102 8
Chris@102 9 Copyright 2013 Karsten Ahnert
Chris@102 10 Copyright 2013 Mario Mulansky
Chris@102 11
Chris@102 12 Distributed under the Boost Software License, Version 1.0.
Chris@102 13 (See accompanying file LICENSE_1_0.txt or
Chris@102 14 copy at http://www.boost.org/LICENSE_1_0.txt)
Chris@102 15 */
Chris@102 16
Chris@102 17 #ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_ALGEBRA_DISPATCHER_HPP_INCLUDED
Chris@102 18 #define BOOST_NUMERIC_ODEINT_ALGEBRA_ALGEBRA_DISPATCHER_HPP_INCLUDED
Chris@102 19
Chris@102 20 #include <boost/numeric/odeint/config.hpp>
Chris@102 21
Chris@102 22 #include <complex>
Chris@102 23 #include <boost/type_traits/is_floating_point.hpp>
Chris@102 24
Chris@102 25 #include <boost/numeric/ublas/vector.hpp>
Chris@102 26 #include <boost/numeric/ublas/matrix.hpp>
Chris@102 27
Chris@102 28 #include <boost/numeric/odeint/algebra/range_algebra.hpp>
Chris@102 29 #include <boost/numeric/odeint/algebra/array_algebra.hpp>
Chris@102 30 #include <boost/numeric/odeint/algebra/vector_space_algebra.hpp>
Chris@102 31
Chris@102 32 #include <boost/array.hpp>
Chris@102 33
Chris@102 34
Chris@102 35 namespace boost {
Chris@102 36 namespace numeric {
Chris@102 37 namespace odeint {
Chris@102 38
Chris@102 39 template< class StateType , class Enabler = void >
Chris@102 40 struct algebra_dispatcher_sfinae
Chris@102 41 {
Chris@102 42 // range_algebra is the standard algebra
Chris@102 43 typedef range_algebra algebra_type;
Chris@102 44 };
Chris@102 45
Chris@102 46 template< class StateType >
Chris@102 47 struct algebra_dispatcher : algebra_dispatcher_sfinae< StateType > { };
Chris@102 48
Chris@102 49 // specialize for array
Chris@102 50 template< class T , size_t N >
Chris@102 51 struct algebra_dispatcher< boost::array< T , N > >
Chris@102 52 {
Chris@102 53 typedef array_algebra algebra_type;
Chris@102 54 };
Chris@102 55
Chris@102 56 //specialize for some integral types
Chris@102 57 template< typename T >
Chris@102 58 struct algebra_dispatcher_sfinae< T , typename boost::enable_if< typename boost::is_floating_point< T >::type >::type >
Chris@102 59 {
Chris@102 60 typedef vector_space_algebra algebra_type;
Chris@102 61 };
Chris@102 62
Chris@102 63 template< typename T >
Chris@102 64 struct algebra_dispatcher< std::complex<T> >
Chris@102 65 {
Chris@102 66 typedef vector_space_algebra algebra_type;
Chris@102 67 };
Chris@102 68
Chris@102 69 ///* think about that again....
Chris@102 70 // specialize for ublas vector and matrix types
Chris@102 71 template< class T , class A >
Chris@102 72 struct algebra_dispatcher< boost::numeric::ublas::vector< T , A > >
Chris@102 73 {
Chris@102 74 typedef vector_space_algebra algebra_type;
Chris@102 75 };
Chris@102 76
Chris@102 77 template< class T , class L , class A >
Chris@102 78 struct algebra_dispatcher< boost::numeric::ublas::matrix< T , L , A > >
Chris@102 79 {
Chris@102 80 typedef vector_space_algebra algebra_type;
Chris@102 81 };
Chris@102 82 //*/
Chris@102 83
Chris@102 84 }
Chris@102 85 }
Chris@102 86 }
Chris@102 87
Chris@102 88 #ifdef BOOST_NUMERIC_ODEINT_CXX11
Chris@102 89
Chris@102 90 // c++11 mode: specialization for std::array if available
Chris@102 91
Chris@102 92 #include <array>
Chris@102 93
Chris@102 94 namespace boost {
Chris@102 95 namespace numeric {
Chris@102 96 namespace odeint {
Chris@102 97
Chris@102 98 // specialize for std::array
Chris@102 99 template< class T , size_t N >
Chris@102 100 struct algebra_dispatcher< std::array< T , N > >
Chris@102 101 {
Chris@102 102 typedef array_algebra algebra_type;
Chris@102 103 };
Chris@102 104
Chris@102 105 } } }
Chris@102 106
Chris@102 107 #endif
Chris@102 108
Chris@102 109
Chris@102 110 #endif