]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /* |
2 | [auto_generated] | |
3 | boost/numeric/odeint/external/mtl4/mtl4_algebra_dispatcher.hpp | |
4 | ||
5 | [begin_description] | |
6 | specialization of the algebra dispatcher for mtl4 | |
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_MTL4_MTL4_ALGEBRA_DISPATCHER_HPP_INCLUDED | |
18 | #define BOOST_NUMERIC_ODEINT_MTL4_MTL4_ALGEBRA_DISPATCHER_HPP_INCLUDED | |
19 | ||
20 | #include <boost/numeric/mtl/mtl.hpp> | |
21 | ||
22 | #include <boost/numeric/odeint/algebra/vector_space_algebra.hpp> | |
23 | #include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> | |
24 | ||
25 | namespace boost { | |
26 | namespace numeric { | |
27 | namespace odeint { | |
28 | ||
29 | template<typename Value, typename Parameters> | |
30 | struct algebra_dispatcher< mtl::dense_vector< Value , Parameters > > | |
31 | { | |
32 | typedef vector_space_algebra algebra_type; | |
33 | }; | |
34 | ||
35 | template<typename Value, typename Parameters> | |
36 | struct algebra_dispatcher< mtl::dense2D< Value , Parameters > > | |
37 | { | |
38 | typedef vector_space_algebra algebra_type; | |
39 | }; | |
40 | ||
41 | template<typename Value , size_t BitMask , typename Parameters> | |
42 | struct algebra_dispatcher< mtl::morton_dense< Value , BitMask, Parameters > > | |
43 | { | |
44 | typedef vector_space_algebra algebra_type; | |
45 | }; | |
46 | ||
47 | template<typename Value, typename Parameters> | |
48 | struct algebra_dispatcher< mtl::compressed2D< Value , Parameters > > | |
49 | { | |
50 | typedef vector_space_algebra algebra_type; | |
51 | }; | |
52 | ||
53 | // specialization of infinity norm calculation | |
54 | ||
55 | template<typename Value, typename Parameters> | |
56 | struct vector_space_norm_inf< mtl::dense_vector< Value , Parameters > > | |
57 | { | |
58 | typedef Value result_type; | |
59 | Value operator()( const mtl::dense_vector< Value , Parameters > &x ) const | |
60 | { | |
61 | return mtl::infinity_norm(x); | |
62 | } | |
63 | }; | |
64 | ||
65 | template<typename Value, typename Parameters> | |
66 | struct vector_space_norm_inf< mtl::dense2D< Value , Parameters > > | |
67 | { | |
68 | typedef Value result_type; | |
69 | Value operator()( const mtl::dense2D< Value , Parameters > &x ) const | |
70 | { | |
71 | return mtl::infinity_norm(x); | |
72 | } | |
73 | }; | |
74 | ||
75 | template<typename Value , size_t BitMask , typename Parameters> | |
76 | struct vector_space_norm_inf< mtl::morton_dense< Value , BitMask , Parameters > > | |
77 | { | |
78 | typedef Value result_type; | |
79 | Value operator()( const mtl::morton_dense< Value , BitMask , Parameters > &x ) const | |
80 | { | |
81 | return mtl::infinity_norm(x); | |
82 | } | |
83 | }; | |
84 | ||
85 | template<typename Value, typename Parameters> | |
86 | struct vector_space_norm_inf< mtl::compressed2D< Value , Parameters > > | |
87 | { | |
88 | typedef Value result_type; | |
89 | Value operator()( const mtl::compressed2D< Value , Parameters > &x ) const | |
90 | { | |
91 | return mtl::infinity_norm(x); | |
92 | } | |
93 | }; | |
94 | ||
95 | } | |
96 | } | |
97 | } | |
98 | ||
99 | #endif // BOOST_NUMERIC_ODEINT_MTL4_MTL4_ALGEBRA_DISPATCHER_INCLUDED |