Dom::MaxMinSemiRing --
MaxMin semi-ring
IntroductionDom::MaxMinSemiRing creates a domain for the MaxMin semi-ring.
DetailsDom::MaxMinSemiRing(x) represents the constant x in the
MaxMin semi-ring if x is a real number or real constant, or ±∞ if
x is infinity or -infinity.
Creating Elements
Dom::MaxMinSemiRing(x)
Parametersx | - | real number, infinity or -infinity. |
Cat::SemiRing
Related DomainsDom::MaxPlusSemiRing, Dom::MinPlusSemiRing, Dom::MinMaxSemiRing
the constant infinity.
the constant -infinity.
_plus(dom a1...)a1+a2+...+ak is defined to be the biggest
of real numbers, infinity or -infinity a1,a2,...,ak._plus.
_mult(dom a1...)a1*a2*...*ak is defined to be the smallest of real
numbers, infinity or -infinity a1,a2,...,ak._mult.
_power(dom a,Dom::Integer n)a^n of the MaxMin scalar a._power.
convert(any x)x into a MaxMin scalar. This is
only possible if x is a real number, infinity or -infinity.
convert_to(dom a, any T)a into type T. Currently, only a
conversion into a type of scalars.
expr(dom a)a.
Example 1This example shows the idempotency of the MaxMin semi-ring:
>> T:=Dom::MaxMinSemiRing():
>> T(infinity) + T(infinity);
T(3) + T(3)
infinity
3
>> T(6) + T(infinity);
T(6) + T(3);
T(6)*T(-infinity);
T(6)*T(3)
infinity
6
-infinity
3
Example 2We can use real number and constants:
>> T(sin(2)) + T(-2.15)*T(PI)
sin(2)
Example 3We can change the domain of scalars:
>> T::convert_to(T(1), Dom::Integer) + T::convert_to(T(2), Dom::Integer)
3
Super-DomainAx::canonicalRep, Ax::normalRep
Dom::MaxMinSemiRing is a new function
MuPAD Combinat, an open source algebraic combinatorics package