File indexing completed on 2025-01-18 09:42:52
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_NORM_INF_HPP_DEFINED
0019 #define BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_NORM_INF_HPP_DEFINED
0020
0021 #include <map>
0022 #include <algorithm>
0023
0024 #include <vexcl/vector.hpp>
0025 #include <vexcl/multivector.hpp>
0026 #include <vexcl/reductor.hpp>
0027
0028 #include <boost/numeric/odeint/algebra/vector_space_algebra.hpp>
0029
0030 namespace boost {
0031 namespace numeric {
0032 namespace odeint {
0033
0034
0035 template <typename T>
0036 struct vector_space_norm_inf< vex::vector<T> > {
0037 typedef T result_type;
0038
0039 T operator()( const vex::vector<T> &x ) const {
0040 const auto &max = vex::get_reductor<T, vex::MAX>(x.queue_list());
0041
0042 return max( fabs(x) );
0043 }
0044 };
0045
0046
0047 template <typename T, size_t N>
0048 struct vector_space_norm_inf< vex::multivector<T, N> > {
0049 typedef T result_type;
0050
0051 T operator()( const vex::multivector<T, N> &x ) const {
0052 const auto &max = vex::get_reductor<T, vex::MAX>(x.queue_list());
0053
0054
0055 auto m = max( fabs(x) );
0056
0057
0058 return *std::max_element(m.begin(), m.end());
0059 }
0060 };
0061
0062
0063 }
0064 }
0065 }
0066
0067
0068 #endif