Matrix helpers
This page contains the documentation for various helper functions for
manipulating Matrix objects. All these functions are contained in the
submodule matrix.
Contents
| Returns the period of an ntp matrix. | |
| Returns a row space basis of a matrix as a list of lists. | |
| Returns the size of the row space of a boolean matrix. | |
| Returns the threshold of a matrix over a truncated semiring. | 
Full API
This page contains the documentation for the matrix subpackage, that
contains helper functions for the Matrix class.
- matrix.period(x: Matrix) int
- Returns the period of an ntp matrix. This function returns the period of the ntp matrix x using its underlying semiring. 
- matrix.row_basis(x: Matrix) list[list[int | PositiveInfinity | NegativeInfinity]]
- Returns a row space basis of a matrix as a list of lists. The matrix x which must be one of: - This function returns a row space basis of the matrix x as a list of lists of rows. - Parameters:
- x (Matrix) – the matrix. 
- Returns:
- A basis for the row space of x. 
- Return type:
- Complexity:
- \(O(r ^ 2 c)\) where \(r\) is the number of rows in x and \(c\) is the number of columns in x. 
 
- matrix.row_space_size(x: Matrix) int
- Returns the size of the row space of a boolean matrix. This function returns the size of the row space of the boolean matrix x. - Parameters:
- x (Matrix) – the matrix. 
- Returns:
- The size of the row space of the matrix x. 
- Return type:
- Complexity:
- \(O(mn)\) where \(m\) is the size of the row basis of x and \(n\) is the size of the row space. 
 - >>> from libsemigroups_pybind11 import Matrix, MatrixKind, matrix >>> x = Matrix(MatrixKind.Boolean, [[1, 0, 0], [0, 0, 1], [0, 1, 0]]) >>> matrix.row_space_size(x) 7