1#ifndef PHYTH_INTERVAL_HPP
2#define PHYTH_INTERVAL_HPP
19 template<
typename UnitT>
21 static_assert(
is_unit_v<UnitT>,
"Interval requires a Unit type as template parameter");
42 throw std::invalid_argument(
"Interval: min must be less than max");
Closed interval [min, max] of physical quantities.
bool Contains(const Interval &interval) const noexcept
Check if another interval is fully contained in this one.
Interval(Quantity< UnitT > min, Quantity< UnitT > max)
Construct a closed interval [min, max].
Quantity< UnitT > GetMaximum() const noexcept
Interval(Quantity< UnitT > value) noexcept
Construct a zero-length interval containing a single value.
bool Contains(Quantity< UnitT > x) const noexcept
Check if a value lies within the interval.
Quantity< UnitT > GetMinimum() const noexcept
Physical quantity with a value and a compile-time unit.