This page contains links to the documentation of the functionality in libsemigroups for matrices.
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:
- those whose dimension and arithmetic operations can be defined at compile time: StaticMatrix;
- those whose arithmetic operation can be defined at compile time but whose dimensions can be set at run time: DynamicMatrix (with compile-time arithmetic);
- those whose arithmetic operations and dimensions can be set at run time: DynamicMatrix (with run-time arithmetic).
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).
- Warning
- All of the matrices in libsemigroups have entries that are integer types, and the code does not currently attempt to detect overflows.
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:
Adapters
There are various specialisations of the adapters described on this page for the matrices described on this page:
|
| template<typename Mat> |
| auto | operator* (typename Mat::scalar_type a, Mat const &x) -> std::enable_if_t< IsMatrix< Mat >, Mat > |
| | Multiply a matrix by a scalar.
|
| template<typename Mat> |
| auto | operator+ (typename Mat::scalar_type a, Mat const &x) -> std::enable_if_t< IsMatrix< Mat >, Mat > |
| | Add a scalar to a matrix.
|
| template<typename Mat, typename Subclass> |
| std::ostringstream & | operator<< (std::ostringstream &os, detail::RowViewCommon< Mat, Subclass > const &x) |
| | Insertion operator for row views.
|
| template<typename Mat> |
| auto | operator<< (std::ostringstream &os, Mat const &x) -> std::enable_if_t< IsMatrix< Mat >, std::ostringstream & > |
| | Insertion operator for matrices.
|
| template<typename Mat> |
| auto | to_human_readable_repr (Mat const &x, std::string const &prefix, std::string const &short_name="", std::string const &braces="{}", size_t max_width=72) -> std::enable_if_t< IsMatrix< Mat >, std::string > |
| | Returns a human readable representation of a matrix.
|
|
| template<typename T> |
| constexpr bool | IsDynamicMatrix = IsMatrix<T> && !IsStaticMatrix<T> |
| | Helper variable template.
|
| template<typename T> |
| static constexpr bool | IsIntMat = detail::IsIntMatHelper<T>::value |
| | Helper variable template.
|
| template<typename T> |
| constexpr bool | IsMatrix = detail::IsMatrixHelper<T>::value |
| | Helper variable template.
|
| template<typename T> |
| static constexpr bool | IsMatWithSemiring = detail::IsMatWithSemiringHelper<T>::value |
| | Helper variable template.
|
| template<typename T> |
| static constexpr bool | IsMaxPlusMat = detail::IsMaxPlusMatHelper<T>::value |
| | Helper variable template.
|
| template<typename T> |
| static constexpr bool | IsMinPlusMat = detail::IsMinPlusMatHelper<T>::value |
| | Helper variable template.
|
| template<typename T> |
| constexpr bool | IsStaticMatrix = detail::IsStaticMatrixHelper<T>::value |
| | Helper variable template.
|