libsemigroups  v3.0.0
C++ library for semigroups and monoids
Loading...
Searching...
No Matches
MaxPlusPlus< Scalar >
template<typename Scalar>
struct libsemigroups::MaxPlusPlus< Scalar >

Defined in matrix.hpp.

Template Parameters
Scalarthe type of the values in the semiring (must be signed integer type).

This is a stateless struct with a single call operator of signature: Scalar operator()(Scalar x, Scalar y) const noexcept that returns \(x \oplus y\) which is defined by

\[ x\oplus y = \begin{cases} \max\{x, y\} & \text{if } x \neq -\infty\text{ and }y \neq -\infty \\ \mbox{} -\infty & \text{if } x = -\infty \text{ or }y = -\infty; \end{cases} \]

representing addition in the max-plus semiring.

Public Member Functions

Scalar operator() (Scalar x, Scalar y) const noexcept
 Call operator for addition.
 

Member Function Documentation

◆ operator()()

template<typename Scalar>
Scalar operator() ( Scalar x,
Scalar y ) const
inlinenoexcept

This function returns the sum of its arguments in the max-plus semiring.

Parameters
xthe first value.
ythe second value.
Returns
The sum of x and y in the max-plus semiring.
Exceptions
This function is noexcept and is guaranteed never to throw.

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