![]() |
Elementa v8.0.0
Minimalistic library for any C++ application (C++11 and up)
|

Classes | |
| class | elementa::math::Interval< ELEMTYPE > |
| A numeric interval, either closed, opened or semi-closed. More... | |
Functions | |
| static Interval | elementa::math::Interval< ELEMTYPE >::fromWidth (ELEMTYPE mi, ELEMTYPE width, IntervalCl cl=IntervalCl::CLOSED) |
| Factory constructor from the minimum and width of the interval. More... | |
| elementa::math::Interval< ELEMTYPE >::Interval (void) | |
| Default constructor: empty interval. More... | |
| elementa::math::Interval< ELEMTYPE >::Interval (ELEMTYPE mi, ELEMTYPE ma, IntervalCl cl=IntervalCl::CLOSED) | |
| Constructor from the minimum and maximum of the interval. More... | |
| elementa::math::Interval< ELEMTYPE >::Interval (const Interval &o) | |
| elementa::math::Interval< ELEMTYPE >::Interval (Interval &&o) | |
| Interval & | elementa::math::Interval< ELEMTYPE >::operator= (const Interval &o) |
| Interval & | elementa::math::Interval< ELEMTYPE >::operator= (Interval &&o) |
| ELEMTYPE | elementa::math::Interval< ELEMTYPE >::minimum (void) const noexcept |
| Return the minimum value. More... | |
| ELEMTYPE | elementa::math::Interval< ELEMTYPE >::maximum (void) const noexcept |
| Return the maximum value. More... | |
| ELEMTYPE | elementa::math::Interval< ELEMTYPE >::width (void) const noexcept |
| Return the distance from the minimum to the maximum. More... | |
| IntervalCl | elementa::math::Interval< ELEMTYPE >::closedness (void) const noexcept |
| < Return the closedness of the interval. More... | |
| bool | elementa::math::Interval< ELEMTYPE >::closedMin (void) const noexcept |
| Return the closedness of the minimum bound. More... | |
| bool | elementa::math::Interval< ELEMTYPE >::closedMax (void) const noexcept |
| Return the closedness of the maximum bound. More... | |
| bool | elementa::math::Interval< ELEMTYPE >::empty (void) const noexcept |
| Return true if the interval is empty. More... | |
| Interval | elementa::math::Interval< ELEMTYPE >::intersect (const Interval &oth) const noexcept |
| < Return the interval that is the intersection of both, or empty if none. More... | |
| bool | elementa::math::Interval< ELEMTYPE >::containPoint (ELEMTYPE e) const noexcept |
| < Return true if E is inside the interval. More... | |
| std::string | elementa::math::Interval< ELEMTYPE >::to_string (void) const |
| < Return a string describing the interval. More... | |
| enum class | elementa::math::IntervalCl : uint8_t { CLOSED , OPENED , LEFT_CLOSED , RIGHT_CLOSED } |
| Kinds of closedness for numeric intervals. More... | |
| class elementa::math::Interval |
A numeric interval, either closed, opened or semi-closed.
ELEMTYPE must have minus, < , - and == operators, and + if the min-width ctor is used.
Definition at line 61 of file intervals.h.
Static Public Member Functions | |
| static Interval | fromWidth (ELEMTYPE mi, ELEMTYPE width, IntervalCl cl=IntervalCl::CLOSED) |
| Factory constructor from the minimum and width of the interval. More... | |
Public Member Functions | |
| Interval (void) | |
| Default constructor: empty interval. More... | |
| Interval (ELEMTYPE mi, ELEMTYPE ma, IntervalCl cl=IntervalCl::CLOSED) | |
| Constructor from the minimum and maximum of the interval. More... | |
| Interval (const Interval &o) | |
| Interval (Interval &&o) | |
| Interval & | operator= (const Interval &o) |
| Interval & | operator= (Interval &&o) |
| ELEMTYPE | minimum (void) const noexcept |
| Return the minimum value. More... | |
| ELEMTYPE | maximum (void) const noexcept |
| Return the maximum value. More... | |
| ELEMTYPE | width (void) const noexcept |
| Return the distance from the minimum to the maximum. More... | |
| IntervalCl | closedness (void) const noexcept |
| < Return the closedness of the interval. More... | |
| bool | closedMin (void) const noexcept |
| Return the closedness of the minimum bound. More... | |
| bool | closedMax (void) const noexcept |
| Return the closedness of the maximum bound. More... | |
| bool | empty (void) const noexcept |
| Return true if the interval is empty. More... | |
| Interval | intersect (const Interval &oth) const noexcept |
| < Return the interval that is the intersection of both, or empty if none. More... | |
| bool | containPoint (ELEMTYPE e) const noexcept |
| < Return true if E is inside the interval. More... | |
| std::string | to_string (void) const |
| < Return a string describing the interval. More... | |
|
strong |
#include <elementa/math/intervals.h>
Kinds of closedness for numeric intervals.
Definition at line 43 of file intervals.h.
|
inlinestatic |
#include <elementa/math/intervals.h>
Factory constructor from the minimum and width of the interval.
Throw if the minimum + width yields a number smaller than the minimum.
| aux,aux2 | are needed to differ from the min-max constructor. Their values are ignored. |
Definition at line 69 of file intervals.h.
References elementa::math::Interval< ELEMTYPE >::width().
|
inline |
#include <elementa/math/intervals.h>
Default constructor: empty interval.
Definition at line 75 of file intervals.h.
|
inline |
#include <elementa/math/intervals.h>
Constructor from the minimum and maximum of the interval.
Definition at line 82 of file intervals.h.
References ELE_CODE_INVARG.
|
inline |
#include <elementa/math/intervals.h>
Definition at line 98 of file intervals.h.
|
inline |
#include <elementa/math/intervals.h>
Definition at line 99 of file intervals.h.
|
inline |
#include <elementa/math/intervals.h>
Definition at line 100 of file intervals.h.
|
inline |
#include <elementa/math/intervals.h>
Definition at line 101 of file intervals.h.
|
inlinenoexcept |
#include <elementa/math/intervals.h>
Return the minimum value.
Definition at line 104 of file intervals.h.
|
inlinenoexcept |
#include <elementa/math/intervals.h>
Return the maximum value.
Definition at line 107 of file intervals.h.
|
inlinenoexcept |
#include <elementa/math/intervals.h>
Return the distance from the minimum to the maximum.
Definition at line 110 of file intervals.h.
Referenced by elementa::math::Interval< ELEMTYPE >::fromWidth().
|
inlinenoexcept |
#include <elementa/math/intervals.h>
< Return the closedness of the interval.
Definition at line 113 of file intervals.h.
|
inlinenoexcept |
#include <elementa/math/intervals.h>
Return the closedness of the minimum bound.
Definition at line 117 of file intervals.h.
|
inlinenoexcept |
#include <elementa/math/intervals.h>
Return the closedness of the maximum bound.
Definition at line 120 of file intervals.h.
|
inlinenoexcept |
#include <elementa/math/intervals.h>
Return true if the interval is empty.
Closed intervals will never be empty because they include both extremes even when they are equal.
Definition at line 123 of file intervals.h.
|
inlinenoexcept |
#include <elementa/math/intervals.h>
< Return the interval that is the intersection of both, or empty if none.
Definition at line 127 of file intervals.h.
|
inlinenoexcept |
#include <elementa/math/intervals.h>
< Return true if E is inside the interval.
Definition at line 153 of file intervals.h.
|
inline |
#include <elementa/math/intervals.h>
< Return a string describing the interval.
Definition at line 159 of file intervals.h.