libsemigroups
Public Member Functions | List of all members
libsemigroups::TropicalMinPlusSemiring Class Reference

The tropical min-plus semiring consists of the integers \(\{0, \ldots , t\}\) for some value \(t\) (called the threshold of the semiring) and \(\infty\). Infinity is represented by Semiring<int64_t>::INFTY. More...

#include <semiring.h>

Inheritance diagram for libsemigroups::TropicalMinPlusSemiring:
Inheritance graph
Collaboration diagram for libsemigroups::TropicalMinPlusSemiring:
Collaboration graph

Public Member Functions

 TropicalMinPlusSemiring (int64_t threshold)
 Construct from threshold. More...
 
int64_t one () const override
 Returns the integer 0. More...
 
int64_t plus (int64_t x, int64_t y) const override
 Returns Semiring<int64_t>::INFTY if either of x and y is Semiring<int64_t>::INFTY, and otherwise the minimum of x, y, and the threshold of the semiring. More...
 
int64_t prod (int64_t x, int64_t y) const override
 Returns Semiring<int64_t>::INFTY if x or y equals Semiring<int64_t>::INFTY, otherwise return the minimum of x + y and the threshold of the semiring. More...
 
int64_t zero () const override
 Returns the Semiring<int64_t>::INFTY. More...
 
- Public Member Functions inherited from libsemigroups::SemiringWithThreshold
 SemiringWithThreshold (int64_t threshold)
 A class for semirings with a threshold. More...
 
int64_t threshold () const
 Returns the threshold of a semiring with threshold. More...
 
- Public Member Functions inherited from libsemigroups::Semiring< int64_t >
virtual ~Semiring ()
 A default destructor. More...
 

Additional Inherited Members

- Static Public Attributes inherited from libsemigroups::Semiring< int64_t >
static const int64_t INFTY
 Value representing \(\infty\). More...
 
static const int64_t MINUS_INFTY
 Value representing \(-\infty\). More...
 
static const int64_t UNDEFINED
 Value representing an undefined quantity. More...
 

Detailed Description

The tropical min-plus semiring consists of the integers \(\{0, \ldots , t\}\) for some value \(t\) (called the threshold of the semiring) and \(\infty\). Infinity is represented by Semiring<int64_t>::INFTY.

Constructor & Destructor Documentation

◆ TropicalMinPlusSemiring()

libsemigroups::TropicalMinPlusSemiring::TropicalMinPlusSemiring ( int64_t  threshold)
inlineexplicit

Construct from threshold.

The threshold is the largest integer in the semiring.

Member Function Documentation

◆ one()

int64_t libsemigroups::TropicalMinPlusSemiring::one ( ) const
inlineoverridevirtual

Returns the integer 0.

Implements libsemigroups::Semiring< int64_t >.

◆ plus()

int64_t libsemigroups::TropicalMinPlusSemiring::plus ( int64_t  x,
int64_t  y 
) const
inlineoverridevirtual

Returns Semiring<int64_t>::INFTY if either of x and y is Semiring<int64_t>::INFTY, and otherwise the minimum of x, y, and the threshold of the semiring.

Implements libsemigroups::Semiring< int64_t >.

◆ prod()

int64_t libsemigroups::TropicalMinPlusSemiring::prod ( int64_t  x,
int64_t  y 
) const
inlineoverridevirtual

Returns Semiring<int64_t>::INFTY if x or y equals Semiring<int64_t>::INFTY, otherwise return the minimum of x + y and the threshold of the semiring.

Implements libsemigroups::Semiring< int64_t >.

◆ zero()

int64_t libsemigroups::TropicalMinPlusSemiring::zero ( ) const
inlineoverridevirtual

The documentation for this class was generated from the following file: