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

The max-plus semiring consists of the integers together with negative infinity with operations max and plus. Negative infinity is represented by Semiring<int64_t>::MINUS_INFTY. More...

#include <semiring.h>

Inheritance diagram for libsemigroups::MaxPlusSemiring:
Inheritance graph
Collaboration diagram for libsemigroups::MaxPlusSemiring:
Collaboration graph

Public Member Functions

int64_t one () const override
 Returns the integer 0. More...
 
int64_t plus (int64_t x, int64_t y) const override
 Returns the maximum of x and y. More...
 
int64_t prod (int64_t x, int64_t y) const override
 Returns Semiring<int64_t>::MINUS_INFTY if x or y equals Semiring<int64_t>::MINUS_INFTY, otherwise returns x + y. More...
 
int64_t zero () const override
 Returns Semiring<int64_t>::MINUS_INFTY. 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 max-plus semiring consists of the integers together with negative infinity with operations max and plus. Negative infinity is represented by Semiring<int64_t>::MINUS_INFTY.

Member Function Documentation

◆ one()

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

Returns the integer 0.

Implements libsemigroups::Semiring< int64_t >.

◆ plus()

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

Returns the maximum of x and y.

Implements libsemigroups::Semiring< int64_t >.

◆ prod()

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

Returns Semiring<int64_t>::MINUS_INFTY if x or y equals Semiring<int64_t>::MINUS_INFTY, otherwise returns x + y.

Implements libsemigroups::Semiring< int64_t >.

◆ zero()

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

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