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
x
to the containerresult
.- Template Parameters
Mat – a type such that the value of
IsMatrix
istrue
.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
x
and \(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
IsDynamicMatrix
istrue
.- Parameters
x – the matrix.
- Returns
A
std::vector
ofMat::RowView
.- Exceptions
This function guarantees not to throw a
LibsemigroupsException
.- Complexity
\(O(r ^ 2 c)\) where \(r\) is the number of rows in
x
and \(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
IsStaticMatrix
istrue
.- 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
x
and \(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
views
to 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_type
must beMat::RowView
, or ifMat
isBMat<N>
for someN
, thenContainer::value_type
can additionally beBitSet<M>
orstd::bitset<M>
whereM
is 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
views
and \(c\) is the size of each row view or bit set inviews
.