This page describes the functionality for \(m \times n\) boolean matrices for arbitrary dimensions \(m\) and \(n\). There are two types of such boolean matrices those whose dimension is known at compile-time, and those where it is not. Both types can be accessed via the alias template BMat<R, C>
: if R
or C
has value 0
, then the dimensions can be set at run time, otherwise the dimensions are R
and C
. The default value of R
is 0
and of C
is R
.
The alias BMat<R, C>
is either StaticMatrix, DynamicMatrix (compile-time arithmetic), or DynamicMatrix (run-time arithmetic), please refer to the documentation of these class templates for more details. The only substantial difference in the interface of static and dynamic is that the former can be default constructed and the latter should be constructed using the dimensions.
Adapters for BMat objects are documented here.
- Example
std::conditional_t< R==0||C==0, DynamicBMat, StaticBMat< R, C > > BMat
Alias template for boolean matrices.
Definition matrix.hpp:3963
|
template<typename Mat> |
std::enable_if_t< IsBMat< Mat > > | throw_if_bad_entry (Mat const &, typename Mat::scalar_type val) |
| Check an entry in a boolean matrix is valid.
|
|
template<typename Mat> |
std::enable_if_t< IsBMat< Mat > > | throw_if_bad_entry (Mat const &m) |
| Check the entries in a boolean matrix are valid.
|
|
|
template<typename T> |
static constexpr bool | IsBMat = detail::IsBMatHelper<T>::value |
| Helper to check if a type is BMat.
|
|
◆ BMat
template<size_t R = 0, size_t C = R>
Defined in matrix.hpp
.
Alias template for boolean matrices.
- Template Parameters
-
R | the number of rows of the matrix. A value of 0 (the default value) indicates that the dimensions will be set at run time. |
C | the number of columns of the matrix. A value of 0 indicates that the dimensions will be set at run time (the default value is R ). |
◆ DynamicBMat
Defined in matrix.hpp
.
Alias for the type of dynamic boolean matrices where the dimensions of the matrices can be defined at run time.
◆ StaticBMat
template<size_t R, size_t C>
Initial value:
R,
C,
int>
Static matrix class.
Definition matrix.hpp:1859
Function object for returning the multiplicative identity.
Definition matrix.hpp:3874
Function object for addition in the boolean semiring.
Definition matrix.hpp:3820
Function object for multiplication in the boolean semiring.
Definition matrix.hpp:3847
Function object for returning the additive identity.
Definition matrix.hpp:3899
Defined in matrix.hpp
.
Alias for the type of static boolean matrices where the dimensions of the matrices are defined at compile time.
- Template Parameters
-
R | the number of rows. |
C | the number of columns. |
◆ throw_if_bad_entry() [1/2]
template<typename Mat>
std::enable_if_t< IsBMat< Mat > > throw_if_bad_entry |
( |
Mat const & | , |
|
|
typename Mat::scalar_type | val ) |
Defined in matrix.hpp
.
This function can be used to check that a matrix contains values in the underlying semiring.
- Template Parameters
-
Mat | the type of the 1st argument, must satisfy IsBMat<Mat>. |
- Parameters
-
- Exceptions
-
LibsemigroupsException | if val is not 0 or 1 . The values in a boolean matrix are of type int , but a matrix shouldn't contain values except 0 and 1 . |
◆ throw_if_bad_entry() [2/2]
template<typename Mat>
std::enable_if_t< IsBMat< Mat > > throw_if_bad_entry |
( |
Mat const & | m | ) |
|
Defined in matrix.hpp
.
This function can be used to check that a matrix contains values in the underlying semiring.
- Template Parameters
-
- Parameters
-
m | the boolean matrix to check. |
- Exceptions
-
LibsemigroupsException | if any of the entries in the matrix are not 0 or 1 . The values in a boolean matrix are of type int , but a matrix shouldn't contain values except 0 and 1 . |
◆ IsBMat
template<typename T>
bool IsBMat = detail::IsBMatHelper<T>::value |
|
staticconstexpr |
Defined in matrix.hpp
.
This variable has value true
if the template parameter T
is the same as BMat<R, C>
for some values of R
and C
.
- Template Parameters
-