[Previous] [Next] [Contents]

Dom::MaxMinSemiRing -- MaxMin semi-ring

Introduction

Dom::MaxMinSemiRing creates a domain for the MaxMin semi-ring.

Details

Creating Elements


Dom::MaxMinSemiRing(x)

Parameters

x- real number, infinity or -infinity.

Categories

Cat::SemiRing

Related Domains

Dom::MaxPlusSemiRing, Dom::MinPlusSemiRing, Dom::MinMaxSemiRing

Entries

zero

the constant infinity.

one

the constant -infinity.

Method _plus: sum of MaxMin

Method _mult: product of MaxMin

Method _power: power of MaxMin

Method convert: conversion of an object into a MaxMin scalar

Method convert_to: conversion of a MaxMin scalar into another type

Method expr: convert a MaxMin scalar into a real number, infinity or -infinity.

Example 1

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

>> T:=Dom::MaxMinSemiRing():
     

>> 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)
     
                                 infinity
      
                                     6
      
                                 -infinity
      
                                     3

Example 2

We can use real number and constants:

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

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