delpi  0.0.1
DElta-complete LP solver
Loading...
Searching...
No Matches
math.h
1
7#pragma once
8
9#include <algorithm>
10
11namespace delpi {
12
20template <class T, class... Args>
21T Min(const T& a, const Args&... args) {
22 if constexpr (sizeof...(args) == 0) {
23 return a;
24 } else {
25 return std::min(a, Min(args...));
26 }
27}
28
36template <class T, class... Args>
37T Max(const T& a, const Args&... args) {
38 if constexpr (sizeof...(args) == 0) {
39 return a;
40 } else {
41 return std::max(a, Max(args...));
42 }
43}
44
45} // namespace delpi
Global namespace for the delpi library.
T Min(const T &a, const Args &... args)
Return the minimum of the given values.
Definition math.h:21
T Max(const T &a, const Args &... args)
Return the maximum of the given values.
Definition math.h:37