row_basis¶
This page contains details of the function templates for finding the row basis
of certain types of matrix in the namespace matrix_helper.
-
template<typename Mat, typename Container, typename = std::enable_if_t<IsMatrix<Mat>>>
void row_basis(Mat const &x, Container &result)¶ Appends a basis (consisting of row views) for the row space of the matrix
xto the containerresult.- Template Parameters:
Mat – a type such that the value of
IsMatrixistrue.Container – a container type (such as
std::vector, for example).
- Parameters:
x – the matrix.
result – the container to append the basis to the row space to.
- Returns:
(None)
- Exceptions:
This function guarantees not to throw a
LibsemigroupsException.- Complexity:
\(O(r ^ 2 c)\) where \(r\) is the number of rows in
xand \(c\) is the number of columns inx.
-
template<typename Mat, typename = std::enable_if_t<IsDynamicMatrix<Mat>>>
std::vector<typename Mat::RowView> row_basis(Mat const &x)¶ Returns a vector (consisting of row views) that is a basis for the row space of the non-static matrix
x.- Template Parameters:
Mat – a type such that the value of
IsDynamicMatrixistrue.- Parameters:
x – the matrix.
- Returns:
A
std::vectorofMat::RowView.- Exceptions:
This function guarantees not to throw a
LibsemigroupsException.- Complexity:
\(O(r ^ 2 c)\) where \(r\) is the number of rows in
xand \(c\) is the number of columns inx.
-
template<typename Mat, typename = std::enable_if_t<IsStaticMatrix<Mat>>>
detail::StaticVector1<typename Mat::RowView, Mat::nr_rows> row_basis(Mat const &x)¶ Returns a static vector (consisting of row views) that is a basis for the row space of the static matrix
x.- Template Parameters:
Mat – a type such that the value of
IsStaticMatrixistrue.- Parameters:
x – the matrix.
- Returns:
A static vector of
Mat::RowView.- Exceptions:
This function guarantees not to throw a
LibsemigroupsException.- Complexity:
\(O(r ^ 2 c)\) where \(r\) is the number of rows in
xand \(c\) is the number of columns inx.
-
template<typename Mat, typename Container>
void row_basis(Container &views, Container &result)¶ Appends a basis for the space spanned by the row views or bit sets in
viewsto the containerresult.- Template Parameters:
Mat – a type such that the value of
IsMaxPlusTruncMat<Mat>orIsBMat<Mat>istrue.Container – a container type (such as
std::vector, for example). TheContainer::value_typemust beMat::RowView, or ifMatisBMat<N>for someN, thenContainer::value_typecan additionally beBitSet<M>orstd::bitset<M>whereMis greater than or equal toN.
- Parameters:
views – container of spanning row views or bit sets
result – container for the resulting row basis
- Returns:
(None)
- Exceptions:
This function guarantees not to throw a
LibsemigroupsException.- Complexity:
\(O(r ^ 2 c)\) where \(r\) is the size of
viewsand \(c\) is the size of each row view or bit set inviews.