61 inline operator bool()
const {
return start <=
end; }
179 return start == other.start &&
end == other.end;
195 template <
class T,
class _Alloc = std::allocator<
interval<T>>>
196 using interval_vector = std::vector<interval<T>, _Alloc>;
Numerical interval.
Definition interval.hpp:18
interval(T x) noexcept
Constructs a zero-size interval.
Definition interval.hpp:32
interval< T > operator-(const T x) const
Moves interval towards the beginning by a number.
Definition interval.hpp:140
bool contains(T x) const
Is value in interval?
Definition interval.hpp:70
interval< T > operator++(int)
Moves interval towards the end by one.
Definition interval.hpp:113
bool empty() const
Is interval empty?
Definition interval.hpp:54
interval(T _start, T _end) noexcept
Constructs an interval.
Definition interval.hpp:40
interval< T > operator+(const T x) const
Moves interval towards the end by a number.
Definition interval.hpp:91
interval< T > operator+(const interval< T > &other) const
Adds two intervals by components.
Definition interval.hpp:79
T size() const
Returns interval size.
Definition interval.hpp:47
T end
interval end
Definition interval.hpp:20
bool operator==(const interval< T > &other) const
Are intervals identical?
Definition interval.hpp:177
interval< T > operator++()
Moves interval towards the end by one.
Definition interval.hpp:101
interval() noexcept
Constructs an invalid interval.
Definition interval.hpp:25
interval< T > operator--()
Moves interval towards the begginning by one.
Definition interval.hpp:150
bool operator!=(const interval< T > &other) const
Are intervals different?
Definition interval.hpp:189
T start
interval start
Definition interval.hpp:19
interval< T > operator-(const interval< T > &other) const
Subtracts two intervals by components.
Definition interval.hpp:128
interval< T > operator--(int)
Moves interval towards the begginning by one.
Definition interval.hpp:162