|
HikoGUI
A low latency retained GUI
|
#include <hikogui/interval.hpp>
Public Types | |
| using | value_type = T |
| using | bound_type = simd<value_type, 2> |
Public Member Functions | |
| constexpr | interval (interval const &rhs) noexcept=default |
| constexpr | interval (interval &&rhs) noexcept=default |
| constexpr interval & | operator= (interval const &rhs) noexcept=default |
| constexpr interval & | operator= (interval &&rhs) noexcept=default |
| constexpr | interval () noexcept |
| Default construct an interval. | |
| constexpr | interval (value_type lower, value_type upper) noexcept |
| Construct an interval from a lower and upper bounds. | |
| constexpr bool | holds_invariant () const noexcept |
| constexpr value_type | lower () const noexcept |
| Get the lower bound of the interval. | |
| constexpr value_type | upper () const noexcept |
| Get the upper bound of the interval. | |
| constexpr value_type | delta () const noexcept |
| The distance between lower and upper bound. | |
| constexpr bool | is_value () const noexcept |
| Check if the interval is one value. | |
| constexpr bool | is_range () const noexcept |
| Check if the interval is a range of values. | |
| template<numeric_limited T> | |
| constexpr bool | type_contains_range () const noexcept |
| Check if a given type can hold all values in the interval. | |
| template<numeric_limited T> | |
| constexpr bool | range_contains_type () const noexcept |
| Check if all the values in a type is inside the interval. | |
| operator bool () const noexcept | |
| Check if the interval is true. | |
| constexpr interval | operator- () const noexcept |
| constexpr interval | operator+ (interval const &rhs) const noexcept |
| constexpr interval | operator- (interval const &rhs) const noexcept |
| constexpr interval | operator* (interval const &rhs) const noexcept |
| constexpr interval | positive_mul (interval const &rhs) const noexcept |
| Multiply two positive intervals. | |
| constexpr interval | operator/ (interval const &rhs) const noexcept |
| constexpr interval | operator% (interval const &rhs) const noexcept |
| interval & | operator+= (interval const &rhs) noexcept |
| interval & | operator-= (interval const &rhs) noexcept |
| interval & | operator*= (interval const &rhs) noexcept |
| constexpr bool | is_fully_inside (interval const &other) const noexcept |
| Check if the current interval is fully inside the other interval. | |
Static Public Member Functions | |
| static constexpr interval | raw (bound_type bounds) noexcept |
| Construct an interval from a bound_type value. | |
Data Fields | |
| bound_type | v |
Friends | |
| constexpr interval | reciprocal (interval const &rhs) noexcept |
| constexpr interval | abs (interval const &rhs) noexcept |
| constexpr interval | square (interval const &rhs) noexcept |
| constexpr bool | operator== (value_type const &lhs, interval const &rhs) noexcept |
| constexpr auto | operator<=> (value_type const &lhs, interval const &rhs) noexcept |
Interval arithmetic.
Based on: "INTERVAL ARITHMETIC USING SSE-2 (DRAFT)" - BRANIMIR LAMBOV
This interval is implemented with a negated upper bound, this allows the rounding direction to negative infinity.
| T | A type for which std::numeric_limits<T> is implemented. |
|
inlineconstexprnoexcept |
Default construct an interval.
The interval includes all values of the value_type.
|
inlineconstexprnoexcept |
Construct an interval from a lower and upper bounds.
| lower | The lower bound. |
| upper | The upper bound. |
|
inlineconstexprnoexcept |
The distance between lower and upper bound.
|
inlineconstexprnoexcept |
Check if the current interval is fully inside the other interval.
| other | The other interval. |
|
inlineconstexprnoexcept |
Check if the interval is a range of values.
|
inlineconstexprnoexcept |
Check if the interval is one value.
|
inlineconstexprnoexcept |
Get the lower bound of the interval.
|
inlinenoexcept |
Check if the interval is true.
|
inlineconstexprnoexcept |
Multiply two positive intervals.
|
inlineconstexprnoexcept |
Check if all the values in a type is inside the interval.
|
inlinestaticconstexprnoexcept |
Construct an interval from a bound_type value.
| bounds | The bounds x=lower, y=-upper. |
|
inlineconstexprnoexcept |
Check if a given type can hold all values in the interval.
|
inlineconstexprnoexcept |
Get the upper bound of the interval.