libsemigroups  v3.0.0
C++ library for semigroups and monoids
Loading...
Searching...
No Matches
Projective max-plus matrices

Defined in matrix.hpp.

This page describes the functionality for \(n \times n\) projective matrices over the max-plus semiring. Projective max-plus matrices belong to the quotient of the monoid of all max-plus matrices by the congruence where two matrices are related if they differ by a scalar multiple; see MaxPlusMat.

There are two types of such matrices those whose dimension is known at compile-time, and those where it is not. Both types can be accessed via the alias template ProjMaxPlusMat : if R or C has value 0, then the dimensions can be set at run time, otherwise R and C are the dimensions. The default value of R is 0, C is R, and Scalar is int.

Matrices in both these classes are modified when constructed to be in a normal form which is obtained by subtracting the maximum finite entry in the matrix from the every finite entry.

A ProjMaxPlusMat is neither a StaticMatrix nor a DynamicMatrix, but has the same interface as each of these types. Every instance of ProjMaxPlusMat wraps a MaxPlusMat.

Note
The types RowView and Row are the same as those in the wrapped matrix. This means that a Row object for a projective max-plus matrix is never normalised, because if they were they would be normalised according to their entries, and this might not correspond to the normalised entries of the matrix.

Please refer to the documentation of these class templates for more details. The only substantial difference in the interface of static and dynamic matrices is that the former can be default constructed and the latter should be constructed using the dimensions.

Example
// default construct an uninitialized 3 x 3 static matrix
// construct an uninitialized 4 x 4 dynamic matrix
std::conditional_t< R==0||C==0, DynamicProjMaxPlusMat< Scalar >, StaticProjMaxPlusMat< R, C, Scalar > > ProjMaxPlusMat
Alias template for projective max-plus matrices.
Definition matrix.hpp:7024

Typedefs

template<typename Scalar>
using DynamicProjMaxPlusMat = detail::ProjMaxPlusMat<DynamicMaxPlusMat<Scalar>>
 Alias for dynamic projective max-plus matrices with run-time dimensions.
 
template<size_t R = 0, size_t C = R, typename Scalar = int>
using ProjMaxPlusMat
 Alias template for projective max-plus matrices.
 
template<size_t R, size_t C, typename Scalar>
using StaticProjMaxPlusMat = detail::ProjMaxPlusMat<StaticMaxPlusMat<R, C, Scalar>>
 Alias for static projective max-plus matrices with compile-time arithmetic and dimensions.
 

Variables

template<typename T>
static constexpr bool IsProjMaxPlusMat = detail::IsProjMaxPlusMatHelper<T>::value
 Helper to check if a type is ProjMaxPlusMat.
 

Typedef Documentation

◆ DynamicProjMaxPlusMat

template<typename Scalar>
using DynamicProjMaxPlusMat = detail::ProjMaxPlusMat<DynamicMaxPlusMat<Scalar>>

Defined in matrix.hpp.

Alias for the type of dynamic projective max-plus matrices where the dimensions of the matrices can be defined at run time.

Template Parameters
Scalarthe type of the entries in the matrix.

◆ ProjMaxPlusMat

template<size_t R = 0, size_t C = R, typename Scalar = int>
using ProjMaxPlusMat
Initial value:
std::conditional_t<R == 0 || C == 0,
detail::ProjMaxPlusMat< DynamicMaxPlusMat< Scalar > > DynamicProjMaxPlusMat
Alias for dynamic projective max-plus matrices with run-time dimensions.
Definition matrix.hpp:7007
detail::ProjMaxPlusMat< StaticMaxPlusMat< R, C, Scalar > > StaticProjMaxPlusMat
Alias for static projective max-plus matrices with compile-time arithmetic and dimensions.
Definition matrix.hpp:6993

Defined in matrix.hpp.

Alias template for projective max-plus matrices.

Template Parameters
Rthe number of rows. A value of 0 indicates that the value will be set at run time (default: 0).
Cthe number of columns. A value of 0 indicates that the value will be set at run time (default: R).
ScalarThe type of the entries in the matrix (default: int).

◆ StaticProjMaxPlusMat

template<size_t R, size_t C, typename Scalar>
using StaticProjMaxPlusMat = detail::ProjMaxPlusMat<StaticMaxPlusMat<R, C, Scalar>>

Defined in matrix.hpp.

Alias for static projective max-plus matrices whose arithmetic and dimensions are defined at compile-time.

Template Parameters
Rthe number of rows.
Cthe number of columns.
Scalarthe type of the entries in the matrix.

Variable Documentation

◆ IsProjMaxPlusMat

template<typename T>
bool IsProjMaxPlusMat = detail::IsProjMaxPlusMatHelper<T>::value
staticconstexpr

Defined in matrix.hpp.

This variable has value true if the template parameter T is the same as ProjMaxPlusMat<R, C, Scalar> for some values of R, C, and Scalar; and false if it is not.

Template Parameters
Tthe type to check.