libmonaa
0.5.2
|
The implementation of the class Interval and related functions. More...
#include <cmath>
#include "zone.hh"
Go to the source code of this file.
Classes | |
struct | Interval |
Class for an interval. More... | |
Functions | |
static Interval | operator&& (const Interval &left, const Interval &right) |
The intersection of two intervals. | |
static void | land (std::vector< std::shared_ptr< Interval >> &left, const Interval &right) |
The intersection of a set of intervals and an interval. More... | |
static void | land (std::vector< std::shared_ptr< Interval >> &left, const std::vector< std::shared_ptr< Interval >> &right) |
The intersection of two sets of intervals. More... | |
static Interval | operator+ (Interval left, const Interval &right) |
The sum of two intervals. The formal definition is as follows. More... | |
static void | operator+= (std::vector< std::shared_ptr< Interval >> &left, const std::vector< std::shared_ptr< Interval >> &right) |
The sum of two sets of intervals. More... | |
void | plus (std::vector< std::shared_ptr< Interval >> &intervals) |
static std::ostream & | operator<< (std::ostream &stream, const Interval &interval) |
The implementation of the class Interval and related functions.
|
inlinestatic |
The intersection of a set of intervals and an interval.
[in,out] | left | The set of intervals. We take intersection for each element of left and overwrite. |
[in] | right | The interval. |
We have the following relation between the input and the overwritten value of \(\texttt{left}\).
\[t \in \bigcup_{I \in \texttt{left}_{\mathrm{post}}} I \iff t \in \bigcup_{I \in \texttt{left}_{\mathrm{pre}}} (I \cap \texttt{right})\]
|
inlinestatic |
The intersection of two sets of intervals.
[in,out] | left | The set of intervals. We take intersection for each element of left and overwrite. |
[in] | right | A set of interval. This is not overwritten. |
We have the following relation between the input and the overwritten value of \(\texttt{left}\).
\[t \in \bigcup_{I \in \texttt{left}_{\mathrm{post}}} I \iff t \in \bigcup_{I \in \texttt{left}_{\mathrm{pre}}, I' \in \texttt{right}} (I \cap I')\]
The sum of two intervals. The formal definition is as follows.
\[I + I' = \{t + t' \mid \exists t \in I, t' \in I'\}\]
|
inlinestatic |
The sum of two sets of intervals.
[in,out] | left | The set of intervals. We take sum for each element of left and overwrite. |
[in] | right | A set of interval. This is not overwritten. |
We have the following for any \(t \in \mathbb{R}\).
\[t \in \bigcup_{I \in \texttt{left}_{\mathrm{post}}} I \iff \exists t' \in \bigcup_{I \in \texttt{left}_{\mathrm{pre}}}, \exists t'' \in \bigcup_{I' \in \texttt{right}}. t = t' + t'' \]