23#ifndef VCL_MATH_MIN_MAX_H
24#define VCL_MATH_MIN_MAX_H
26#include <vclib/concepts/space/point.h>
42constexpr auto min(
const T& p1,
const T&
p2)
44 return std::min(p1,
p2);
42constexpr auto min(
const T& p1,
const T&
p2) {
…}
66template<
typename Head,
typename... Tail>
68 requires (
sizeof...(tail) > 0)
83constexpr auto max(
const T& p1,
const T&
p2)
85 return std::max(p1,
p2);
83constexpr auto max(
const T& p1,
const T&
p2) {
…}
107template<
typename Head,
typename... Tail>
109 requires (
sizeof...(tail) > 0)
126template<Po
intConcept Po
intType>
127constexpr auto min(
const PointType& p1,
const PointType&
p2)
130 for (
size_t i = 0;
i <
p.
DIM;
i++) {
131 p[
i] = std::min(p1[
i],
p2[
i]);
127constexpr auto min(
const PointType& p1,
const PointType&
p2) {
…}
148template<Po
intConcept Po
intType>
149constexpr auto max(
const PointType& p1,
const PointType&
p2)
152 for (
size_t i = 0;
i <
p.
DIM;
i++) {
153 p[
i] = std::max(p1[
i],
p2[
i]);
149constexpr auto max(
const PointType& p1,
const PointType&
p2) {
…}
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43
static const uint DIM
The dimensionality of the segment.
Definition segment.h:62
constexpr auto max(const T &p1, const T &p2)
Returns the maximum between the two parameters.
Definition min_max.h:83
constexpr auto min(const T &p1, const T &p2)
Returns the minimum between the two parameters.
Definition min_max.h:42