StaticMatrix static member functions¶
-
static StaticMatrix identity()¶
Construct the identity matrix.
- Parameters:
(None)
- Returns:
The identity matrix with
R = Crows and columns.- Exceptions:
this function guarantees not to throw a
LibsemigroupsException.- Complexity:
\(O(n ^ 2)\) where \(n\) is the template parameter
RandC.
Warning
This only works when the template parameters
RandCare equal (i.e. for square matrices).
-
static StaticMatrix make(std::initializer_list<std::initializer_list<scalar_type>> il)¶
Validates the arguments, constructs a matrix and validates it.
- Parameters:
il – the values to be copied into the matrix.
- Returns:
the constructed matrix if valid.
- Throws:
LibsemigroupsExceptionifildoes not represent a matrix of the correct dimensions.- Throws:
LibsemigroupsExceptionif the constructed matrix contains values that do not belong to the underlying semiring.- Complexity:
\(O(mn)\) where \(m\) is the number of rows and \(n\) is the number of columns of the matrix.
-
static StaticMatrix make(std::initializer_list<scalar_type> il)¶
Constructs a row and validates it.
- Parameters:
il – the values to be copied into the row.
- Returns:
the constructed row if valid.
- Throws:
LibsemigroupsExceptionif the constructed row contains values that do not belong to the underlying semiring.- Complexity:
\(O(n)\) where \(n\) is the number of columns of the matrix.
Warning
This constructor only works for rows, i.e. when the template parameter
Ris1.