Dom::MaxPlusSemiRing
--
MaxPlus semi-ring
Dom::MaxPlusSemiRing
creates a domain for the MaxPlus semi-ring.
Dom::MaxPlusSemiRing
(x)
represents the constant x in the
MaxPlus semi-ring if x is a real number or real constant, or -∞ if
x is -infinity.
Dom::MaxPlusSemiRing
(x)
x | - | real number or -infinity. |
Cat::SemiRing
Dom::MaxMinSemiRing
, Dom::MinMaxSemiRing
, Dom::MinPlusSemiRing
the constant -infinity.
the constant 0.
_plus(dom a1...)
a1+a2+...+ak
is defined to be the biggest
of real numbers or -infinity a1,a2,...,ak
._plus
.
_mult(dom a1...)
a1*a2*...*ak
is defined to be a1+a2+...+ak
._mult
.
_power(dom a,Dom::Integer n)
a^n
of the MaxPlus scalar a
._power
.
convert(any x)
x
into a MaxPlus scalar. This is
only possible if x
is a real number 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
.This example shows the idempotency of the MaxPlus semi-ring:
>> T:=Dom::MaxPlusSemiRing():
>> 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)
6 6 -infinity 9
We can use real number and constants:
>> T(sin(2))*T(-2.15) + T(-PI)
-1.240702573
We can change the domain of scalars:
>> T::convert_to(T(1), Dom::Integer) + T::convert_to(T(2), Dom::Integer)
3
Ax::canonicalRep, Ax::normalRep
Dom::MaxPlusSemiRing
is a new function
MuPAD Combinat, an open source algebraic combinatorics package