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