![]() |
libsemigroups
v3.0.0
C++ library for semigroups and monoids
|
Defined in bmat8.hpp
.
This namespace contains various helper functions for the class BMat8. These functions could be functions of BMat8 but they only use public member functions of BMat8, and so they are declared as free functions instead.
Functions | |
BMat8 | col_space_basis (BMat8 const &x) noexcept |
Find a basis for the column space of a BMat8. | |
size_t | col_space_size (BMat8 const &x) |
Returns the size of the column space of a BMat8. | |
bool | is_regular_element (BMat8 const &x) noexcept |
Checks whether a BMat8 is regular in the monoid of all BMat8 objects. | |
size_t | minimum_dim (BMat8 const &x) noexcept |
Returns the minimum dimension of a BMat8. | |
constexpr size_t | number_of_cols (BMat8 const &x) noexcept |
Returns the number of non-zero columns in a BMat8. | |
constexpr size_t | number_of_rows (BMat8 const &x) noexcept |
Returns the number of non-zero rows in a BMat8. | |
template<typename T> | |
constexpr T | one (size_t dim=8) noexcept |
Returns the identity boolean matrix of a given dimension. | |
constexpr BMat8 | one (size_t dim=8) noexcept |
Returns the identity BMat8 of a given dimension. | |
template<typename Container> | |
void | push_back_rows (Container &rows, BMat8 const &x) |
Push the rows of a BMat8 into the back of a container. | |
BMat8 | random () |
Construct a random BMat8. | |
BMat8 | random (size_t dim) |
Construct a random BMat8 of dimension at most dim . | |
BMat8 | row_space_basis (BMat8 const &x) noexcept |
Find a basis for the row space of a BMat8. | |
size_t | row_space_size (BMat8 const &x) |
Returns the size of the row space of a BMat8. | |
std::vector< uint8_t > | rows (BMat8 const &x) |
Returns a vector of the rows of a BMat8. | |
std::vector< bool > | to_vector (uint8_t row) |
Convert a uint8_t to a vector. | |
constexpr BMat8 | transpose (BMat8 const &x) noexcept |
Returns the transpose of a BMat8. | |
|
inlinenodiscard |
x | the matrix. |
x
.
|
nodiscardnoexcept |
Check whether x
is a regular element of the full boolean matrix monoid of appropriate dimension.
x | the matrix. |
true
if there exists a boolean matrix y
such that x * y * x = x
where x
, and false
otherwise.noexcept
and is guaranteed never to throw.
|
nodiscardnoexcept |
This function returns the maximal n
such that row n
or column n
contains a 1
. Equivalent to the maximum of number_of_rows and number_of_cols.
x | the matrix. |
x
.noexcept
and is guaranteed never to throw.
|
nodiscardconstexprnoexcept |
BMat8s do not know their "dimension" - in effect they are all of dimension 8. However, this function can be used to obtain the number of non-zero rows of a BMat8.
x | the matrix. |
noexcept
and is guaranteed never to throw.
|
nodiscardconstexprnoexcept |
BMat8s do not know their "dimension" - in effect they are all of dimension 8. However, this function can be used to obtain the number of non-zero rows of a BMat8.
x | the matrix. |
noexcept
and is guaranteed never to throw.
|
nodiscardconstexprnoexcept |
Returns the identity boolean matrix of a given dimension.
T | the type of the boolean matrix being constructed, should be BMat8 or HPCombi::BMat8. |
dim | the dimension of the identity matrix, must be at most 8. |
T
with the first dim
values on the main diagonal equal to 1 and every other entry equal to 0.noexcept
and is guaranteed never to throw.
|
nodiscardconstexprnoexcept |
void push_back_rows | ( | Container & | rows, |
BMat8 const & | x ) |
This function adds the uint8_t
values representing the rows of x
to the container rows
using its push_back
member function.
Container | the type of the container. Must support push_back and have Container::value_type equal to uint8_t . |
rows | the container. |
x | the matrix. |
|
nodiscard |
This function returns a BMat8 chosen at random.
|
nodiscard |
This function returns a BMat8 chosen at random, where only the top-left dim
x dim
entries can be non-zero.
dim | the dimension. |
|
nodiscard |
x | the matrix. |
x
.
|
nodiscard |
This function returns a std::vector
of uint8_t
representing the rows of x
. The returned vector always has length 8, even if x
was constructed with fewer rows.
x | the matrix. |
std::vector<uint8_t>
.std::vector< bool > to_vector | ( | uint8_t | row | ) |
This function converts its argument row
to a std::vector<bool>
such that the item with index i
is true
if the bit with index i
in row
is 1
, and false
if the corresponding bit is 0
.
row | the matrix. |