Matrix

There are several different classes in libsemigroups for representing matrices over various semirings. There are up to three different representations for every type of matrix:

  1. those whose dimension and arithmetic operations can be defined at compile time: StaticMatrix.

  2. those whose arithmetic operation can be defined at compile time but whose dimensions can be set at run time: DynamicMatrix

  3. those whose arithmetic operations and dimensions can be set at run time: DynamicMatrix

It’s unlikely that you will want to use the classes described on this page directly, but rather through the aliases described on the other matrix pages (such as, for example, BMat).

Over specific semirings

The following matrix classes are provided which define matrices over some specific semirings:

Over arbitrary semirings

The following general matrix classes are provided which can be used to define matrices over arbitrary semirings:

Row views

A row view is a lightweight representation of a row of a matrix. The following row view classes are provided:

Helpers

The namespace matrix_helpers contains a number of helper functions for certain types of matrices:

Adapters

There are various specialisations of the adapters described on this page<Adapters> for the matrices described on this page: