AMDiS 2.10
The Adaptive Multi-Dimensional Simulation Toolbox
MaxMin.hpp
1#pragma once
2
3namespace AMDiS
4{
5 namespace Operation
6 {
8 struct Max
9 {
10 template <class T, class S>
11 constexpr auto operator()(T const& lhs, S const& rhs) const
12 {
13 return Math::max(lhs, rhs);
14 }
15 };
16
17 // -------------------------------------------------------------------------
18
20 struct Min
21 {
22 template <class T, class S>
23 constexpr auto operator()(T const& lhs, S const& rhs) const
24 {
25 return Math::min(lhs, rhs);
26 }
27 };
28
29 // -------------------------------------------------------------------------
30
32 struct AbsMax
33 {
34 template <class T, class S>
35 constexpr auto operator()(T const& lhs, S const& rhs) const
36 {
37 using std::abs;
38 return Math::max(abs(lhs), abs(rhs));
39 }
40 };
41
42 // -------------------------------------------------------------------------
43
45 struct AbsMin
46 {
47 template <class T, class S>
48 constexpr auto operator()(T const& lhs, S const& rhs) const
49 {
50 using std::abs;
51 return Math::min(abs(lhs), abs(rhs));
52 }
53 };
54
55 } // end namespace Operation
56} // end namespace AMDiS
Operation that represents max(|A|,|B|)
Definition: MaxMin.hpp:33
Operation that represents min(|A|,|B|)
Definition: MaxMin.hpp:46
Operation that represents max(A,B)
Definition: MaxMin.hpp:9
Operation that represents min(A,B)
Definition: MaxMin.hpp:21