![]() |
libsemigroups
v3.0.0
C++ library for semigroups and monoids
|
Defined in matrix.hpp
.
This class represents the truncated max-plus 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 a signed integer type (defaults to int ). |
Public Member Functions | |
MaxPlusTruncSemiring ()=delete | |
Deleted default constructor. | |
MaxPlusTruncSemiring (MaxPlusTruncSemiring &&) noexcept=default | |
Default move constructor. | |
MaxPlusTruncSemiring (MaxPlusTruncSemiring const &) noexcept=default | |
Default copy constructor. | |
MaxPlusTruncSemiring (Scalar threshold) | |
Construct from threshold. | |
MaxPlusTruncSemiring & | operator= (MaxPlusTruncSemiring &&) noexcept=default |
Default move assignment operator. | |
MaxPlusTruncSemiring & | operator= (MaxPlusTruncSemiring const &) noexcept=default |
Default copy assignment operator. | |
Scalar | plus_no_checks (Scalar x, Scalar y) const noexcept |
Addition in a truncated max-plus semiring. | |
Scalar | product_no_checks (Scalar x, Scalar y) const noexcept |
Multiplication in a truncated max-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} \max\{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 max-plus semiring (and its quotient).
x | scalar. |
y | scalar. |
Scalar
.noexcept
and is guaranteed never to throw.
|
inlinenoexcept |
This function 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 max-plus semiring.
x | scalar. |
y | scalar. |
Scalar
.noexcept
and is guaranteed never to throw.
|
inlinestaticconstexprnoexcept |
This function returns the multiplicative identity in a truncated max-plus semiring.
0
).noexcept
and is guaranteed never to throw.
|
inlinestaticconstexprnoexcept |
This function returns the additive identity in a truncated max-plus semiring.
NEGATIVE_INFINITY
).noexcept
and is guaranteed never to throw.
|
inlinenoexcept |
Returns the threshold value used to construct MaxPlusTruncSemiring instance.
Scalar
.noexcept
and is guaranteed never to throw.