Defined in matrix.hpp.
This class represents the min-plus truncated semiring consists of the integers \(\{0, \ldots , t\}\) for some value \(t\) (called the threshold of the semiring) and \(\infty\). Instances of this class can be used to define the value of the threshold \(t\) at run time.
| Scalar | the type of the elements of the semiring. This must be an integral type. |
Public Member Functions | |
| MinPlusTruncSemiring ()=delete | |
| Deleted default constructor. | |
| MinPlusTruncSemiring (MinPlusTruncSemiring &&) noexcept=default | |
| Default move constructor. | |
| MinPlusTruncSemiring (MinPlusTruncSemiring const &) noexcept=default | |
| Default copy constructor. | |
| MinPlusTruncSemiring (Scalar threshold) | |
| Construct from threshold. | |
| MinPlusTruncSemiring & | operator= (MinPlusTruncSemiring &&) noexcept=default |
| Default move assignment operator. | |
| MinPlusTruncSemiring & | operator= (MinPlusTruncSemiring const &) noexcept=default |
| Default copy assignment operator. | |
| Scalar | plus_no_checks (Scalar x, Scalar y) const noexcept |
| Addition in a truncated min-plus semiring. | |
| Scalar | product_no_checks (Scalar x, Scalar y) const noexcept |
| Multiplication in a truncated min-plus semiring. | |
| Scalar | threshold () const noexcept |
| Get the threshold. | |
Static Public Member Functions | |
| static constexpr Scalar | scalar_one () noexcept |
| Get the multiplicative identity. | |
| static constexpr Scalar | scalar_zero () noexcept |
| Get the additive identity. | |
|
delete |
Deleted default constructor.
|
defaultnoexcept |
Default copy constructor.
|
defaultnoexcept |
Default move constructor.
|
inlineexplicit |
Construct from threshold.
| threshold | the threshold. |
| LibsemigroupsException | if threshold is less than zero. |
|
defaultnoexcept |
Default move assignment operator.
|
defaultnoexcept |
Default copy assignment operator.
|
inlinenoexcept |
Returns \(x \oplus y\) which is defined by
\[ x\oplus y = \begin{cases} \min\{x, y\} & \text{if } x \neq \infty\text{ and }y \neq \infty \\ \mbox{} \infty & \text{if } x = \infty \text{ or }y = \infty; \end{cases} \]
representing addition in the min-plus truncated semiring (and its quotient).
| x | scalar. |
| y | scalar. |
Scalar.noexcept and is guaranteed never to throw.
|
inlinenoexcept |
Returns \(x \otimes y\) which is defined by
\[ x\otimes y = \begin{cases} \min\{x + y, t\} & \text{if } x \neq \infty\text{ and }y \neq \infty \\ \mbox{} \infty & \text{if } x = \infty \text{ or }y = \infty; \end{cases} \]
where \(t\) is the threshold; representing multiplication in the quotient of the min-plus semiring.
| x | scalar. |
| y | scalar. |
Scalar.noexcept and is guaranteed never to throw.
|
inlinestaticconstexprnoexcept |
This function returns the multiplicative identity in a truncated min-plus semiring.
0).noexcept and is guaranteed never to throw.
|
inlinestaticconstexprnoexcept |
This function returns the additive identity in a truncated min-plus semiring.
POSITIVE_INFINITY).noexcept and is guaranteed never to throw.
|
inlinenoexcept |
Returns the threshold value used to construct MinPlusTruncSemiring instance.
Scalar.noexcept and is guaranteed never to throw.