Dom::MaxPlusSemiRing – MaxPlus semi-ring
Dom::MaxPlusSemiRing creates a domain for the MaxPlus semi-ring.
Creating Elements
MaxPlusSemiRing(x)
Parameters:
x: |
real number or -infinity. |
Superdomain
Categories
Axioms
Ax::canonicalRep, Ax::normalRep
Related Domains:
Dom::MaxMinSemiRing, Dom::MinMaxSemiRing, Dom::MinPlusSemiRing
Details:
The domain element Dom::MaxPlusSemiRing(x) represents the constant in the MaxPlus semi-ring if is a real number or real constant, or if is -infinity.
Entries
"zero" |
the constant -infinity. |
"one" |
the constant . |
Mathematical Methods
_plus – sum of MaxPlus
Dom::MaxPlusSemiRing::_plus(dom , ...)
The sum is defined to be the biggest of real numbers .
This method overloads the function _plus.
_mult – product of MaxPlus
Dom::MaxPlusSemiRing::_mult(dom , ...)
The sum is defined to be .
This method overloads the function _mult.
_power – power of MaxPlus
Dom::MaxPlusSemiRing::_power(dom a, Dom::Integer n)
The nth power of the MaxPlus scalar a.
This method overloads the function _power.
Conversion Methods
convert – conversion of an object into a MaxPlus scalar
Dom::MaxPlusSemiRing::convert(any x)
This method tries to convert x into a MaxPlus scalar. This is only possible if x is a real number or -infinity.
convert_to – conversion of a MaxPlus scalar into another type
Dom::MaxPlusSemiRing::convert_to(dom a, any T)
Tries to convert a into type T. Currently, only a conversion into a type of scalars.
expr – convert a MaxPlus scalar into a real number or -infinity.
Dom::MaxPlusSemiRing::expr(dom a)
This method returns a real number or -infinity such that generating a MaxPlus scalar from that real number or -infinity would result in a.
This example shows the idempotency of the MaxPlus semi-ring:
T:=Dom::MaxPlusSemiRing:
T(-infinity) + T(-infinity);
T(3) + T(3)
T(6) + T(-infinity);
T(6) + T(3);
T(6)*T(-infinity);
T(6)*T(3)
We can use real number and constants:
T(sin(2))*T(-2.15) + T(-PI)
We can change the domain of scalars:
T::convert_to(T(1), Dom::Integer) + T::convert_to(T(2), Dom::Integer)