libsemigroups  v3.0.0
C++ library for semigroups and monoids
Loading...
Searching...
No Matches
template<size_t T, size_t P, typename Scalar>
struct libsemigroups::NTPProd< T, P, Scalar >

Defined in matrix.hpp.

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

\[ x\otimes y = \begin{cases} xy & \text{if } xy \leq T \\ \mbox{} T + ((xy - T) \pmod{P}) & \text{if } xy > T \end{cases} \]

representing multiplication in the quotient of the semiring natural numbers by the congruence \((T = T + P)\).

Template Parameters
Tthe threshold.
Pthe period.
Scalarthe type of the values in the semiring.

Public Member Functions

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

Member Function Documentation

◆ operator()()

template<size_t T, size_t P, typename Scalar>
Scalar operator() ( Scalar x,
Scalar y ) const
inlineconstexprnoexcept

Defined in matrix.hpp.

This function returns the product of its arguments in an ntp semiring.

Parameters
xthe first value.
ythe second value.
Returns
The product of x and y in an ntp semiring.
Exceptions
This function is noexcept and is guaranteed never to throw.

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