[Previous] [Next] [Contents]

## `Dom::MaxPlusSemiRing` -- MaxPlus semi-ring

#### Introduction

`Dom::MaxPlusSemiRing` creates a domain for the MaxPlus semi-ring.

#### Details

- The domain element `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.

#### Creating Elements

``Dom::MaxPlusSemiRing`(x)`

#### Parameters

`x` | - | real number or -infinity.

#### Categories

`Cat::SemiRing`

#### Related Domains

`Dom::MaxMinSemiRing`, `Dom::MinMaxSemiRing`, `Dom::MinPlusSemiRing`

#### Entries

zero

the constant -infinity.

one

the constant 0.

#### Method _plus: sum of MaxPlus

- `_plus(dom a1...)`

- The sum `a1+a2+...+ak` is defined to be the biggest of real numbers or -infinity `a1,a2,...,ak`.
- This method overloads the function `_plus`.

#### Method _mult: product of MaxPlus

- `_mult(dom a1...)`

- The sum `a1*a2*...*ak` is defined to be `a1+a2+...+ak`.
- This method overloads the function `_mult`.

#### Method _power: power of MaxPlus

- `_power(dom a,Dom::Integer n)`

- The nth power `a^n` of the MaxPlus scalar `a`.
- This method overloads the function `_power`.

#### Method convert: conversion of an object into a MaxPlus scalar

- `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.

#### Method convert_to: conversion of a MaxPlus scalar into another type

- `convert_to(dom a, any T)`

- Tries to convert `a` into type `T`. Currently, only a conversion into a type of scalars.

#### Method expr: convert a MaxPlus scalar into a real number or -infinity.

- `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`.

#### Example 1

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

#### Example 2

We can use real number and constants:

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

                                   -1.240702573

#### Example 3

We can change the domain of scalars:

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

                                         3

#### Super-Domain

`Dom::BaseDomain`

#### Axioms

`Ax::canonicalRep, Ax::normalRep`

#### Changes

- `Dom::MaxPlusSemiRing` is a new function

[Previous] [Next] [Contents]

MuPAD Combinat, an open source algebraic combinatorics package