-
Notifications
You must be signed in to change notification settings - Fork 2
/
LRL_MinMaxTools.h
72 lines (68 loc) · 1.75 KB
/
LRL_MinMaxTools.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef LRL_MinMaxTools_H
#define LRL_MinMaxTools_H
template<typename T>
T maxNC(const T& t1, const T& t2) {
return (std::max(t1, t2));
}
;
template<typename T>
T maxNC(const T& t1, const T& t2, const T& t3) {
const T t4 = std::max(t2, t3);
return (std::max(t1, t4));
}
;
template<typename T>
T maxNC(const T& t1, const T& t2, const T& t3, const T& t4) {
return (std::max(t1, maxNC(t2, t3, t4)));
}
;
template<typename T>
T maxNC(const T& t1, const T& t2, const T& t3, const T& t4, const T& t5) {
return (std::max(t1, maxNC(t2, t3, t4, t5)));
}
;
template<typename T>
T maxNC(const T& t1, const T& t2, const T& t3, const T& t4, const T& t5,
const T& t6) {
return (std::max(t1, maxNC(t2, t3, t4, t5, t6)));
}
;
template<typename T>
T maxNC(const T& t1, const T& t2, const T& t3, const T& t4, const T& t5,
const T& t6, const T& t7) {
return (std::max(t1, maxNC(t2, t3, t4, t5, t6, t7)));
}
;
template<typename T>
T minNC(const T& t1, const T& t2) {
return (std::min(t1, t2));
}
;
template<typename T>
T minNC(const T& t1, const T& t2, const T& t3) {
return (std::min(t1, std::min(t2, t3)));
}
;
template<typename T>
T minNC(const T& t1, const T& t2, const T& t3, const T& t4) {
return (std::min(t1, minNC(t2, t3, t4)));
}
;
template<typename T>
T minNC(const T& t1, const T& t2, const T& t3, const T& t4, const T& t5) {
return (std::min(t1, minNC(t2, t3, t4, t5)));
}
;
template<typename T>
T minNC(const T& t1, const T& t2, const T& t3, const T& t4, const T& t5,
const T& t6) {
return (std::min(t1, minNC(t2, t3, t4, t5, t6)));
}
;
template<typename T>
T minNC(const T& t1, const T& t2, const T& t3, const T& t4, const T& t5,
const T& t6, const T& t7) {
return (std::min(t1, minNC(t2, t3, t4, t5, t6, t7)));
}
;
#endif // LRL_MinMaxTools_H