Dom::MinPlusSemiRing – MinPlus semi-ring

Dom::MinPlusSemiRing creates a domain for the MinPlus semiring.

→ Examples

Creating Elements

MinPlusSemiRing(x)

Parameters:

x

real number or infinity.

Superdomain

Dom::BaseDomain

Categories

Cat::SemiRing

Axioms

Ax::canonicalRep, Ax::normalRep

Related Domains:

Dom::MaxMinSemiRing, Dom::MaxPlusSemiRing, Dom::MinMaxSemiRing

Details:

The domain element Dom::MinPlusSemiRing(x) represents the constant math in the MinPlus semiring if math is a real number or real constant, or math if math is infinity.

Entries

"zero"

the constant infinity.

"one"

the constant math.

Mathematical Methods

_plus – sum of MinPlus

Dom::MinPlusSemiRing::_plus(dom math, ...)

The sum math is defined to be the smallest of real numbers math.

This method overloads the function _plus.

_mult – product of MinPlus

Dom::MinPlusSemiRing::_mult(dom math, ...)

The sum math is defined to be math.

This method overloads the function _mult.

_power – power of MinPlus

Dom::MinPlusSemiRing::_power(dom a, Dom::Integer n)

The nth power math of the MinPlus scalar a.

This method overloads the function _power.

Conversion Methods

convert – conversion of an object into a MinPlus scalar

Dom::MinPlusSemiRing::convert(any x)

This method tries to convert x into a MinPlus scalar. This is only possible if x is a real number or infinity.

convert_to – conversion of a MinPlus scalar into another type

Dom::MinPlusSemiRing::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 MinPlus scalar into a real number or infinity.

Dom::MinPlusSemiRing::expr(dom a)

This method returns a real number or infinity such that generating a MinPlus scalar from that real number or infinity would result in a.

Example 1:

This example shows the idempotency of the MinPlus semi-ring:

T:=Dom::MinPlusSemiRing:

T(infinity) + T(infinity);

T(3) + T(3)

math

math

T(6) + T(infinity);

T(6) + T(3);

T(6)*T(infinity);

T(6)*T(3)

math

math

math

math

Example 2:

We can use real number and constants:

T(sin(2))*T(-2.15) + T(-PI)

math

Example 3:

We can change the domain of scalars:

T::convert_to(T(1), Dom::Integer) + T::convert_to(T(2), Dom::Integer)

math