[Previous] [Next] [Contents]

Dom::MinPlusSemiRing -- MinPlus semi-ring

Introduction

Dom::MinPlusSemiRing creates a domain for the MinPlus semi-ring.

Details

Creating Elements


Dom::MinPlusSemiRing(x)

Parameters

x- real number or infinity.

Categories

Cat::SemiRing

Related Domains

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

Entries

zero

the constant infinity.

one

the constant 0.

Method _plus: sum of MinPlus

Method _mult: product of MinPlus

Method _power: power of MinPlus

Method convert: conversion of an object into a MinPlus scalar

Method convert_to: conversion of a MinPlus scalar into another type

Method expr: convert a MinPlus scalar into a real number or infinity.

Example 1

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

>> T:=Dom::MinPlusSemiRing():
     

>> 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
      
                                     3
      
                                 infinity
      
                                     9
        

Example 2

We can use real number and constants:

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

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

[Previous] [Next] [Contents]


MuPAD Combinat, an open source algebraic combinatorics package