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.
Classes | |
| struct | BooleanOne |
| Function object for returning the multiplicative identity. More... | |
| struct | BooleanPlus |
| Function object for addition in the boolean semiring. More... | |
| struct | BooleanProd |
| Function object for multiplication in the boolean semiring. More... | |
| struct | BooleanZero |
| Function object for returning the additive identity. More... | |
Typedefs | |
| template<size_t R = 0, size_t C = R> | |
| using | BMat = std::conditional_t<R == 0 || C == 0, DynamicBMat, StaticBMat<R, C>> |
| Alias template for boolean matrices. | |
| using | DynamicBMat = DynamicMatrix<BooleanPlus, BooleanProd, BooleanZero, BooleanOne, int> |
| Alias for dynamic boolean matrices. | |
| template<size_t R, size_t C> | |
| using | StaticBMat |
| Alias for static boolean matrices. | |
Functions | |
| template<typename Mat> | |
| auto | throw_if_bad_entry (Mat const &, typename Mat::scalar_type val) -> std::enable_if_t< IsBMat< Mat > > |
| Check an entry in a boolean matrix is valid. | |
| template<typename Mat> | |
| auto | throw_if_bad_entry (Mat const &m) -> std::enable_if_t< IsBMat< Mat > > |
| Check the entries in a boolean matrix are valid. | |
Variables | |
| template<typename T> | |
| static constexpr bool | IsBMat = detail::IsBMatHelper<T>::value |
| Helper to check if a type is BMat. | |
| using BMat = std::conditional_t<R == 0 || C == 0, DynamicBMat, StaticBMat<R, C>> |
Defined in matrix-class.hpp.
Alias template for boolean matrices.
| 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). |
| using DynamicBMat = DynamicMatrix<BooleanPlus, BooleanProd, BooleanZero, BooleanOne, int> |
Defined in matrix-class.hpp.
Alias for the type of dynamic boolean matrices where the dimensions of the matrices can be defined at run time.
| using StaticBMat |
Defined in matrix-class.hpp.
Alias for the type of static boolean matrices where the dimensions of the matrices are defined at compile time.
| R | the number of rows. |
| C | the number of columns. |
| auto throw_if_bad_entry | ( | Mat const & | , |
| typename Mat::scalar_type | val ) -> std::enable_if_t< IsBMat< Mat > > |
Defined in matrix-exceptions.hpp.
This function can be used to check that a matrix contains values in the underlying semiring.
| Mat | the type of the 1st argument, must satisfy IsBMat<Mat>. |
| val | the entry to check. |
| 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. |
| auto throw_if_bad_entry | ( | Mat const & | m | ) | -> std::enable_if_t< IsBMat< Mat > > |
Defined in matrix-exceptions.hpp.
This function can be used to check that a matrix contains values in the underlying semiring.
| Mat | the type of m, must satisfy IsBMat<Mat>. |
| m | the boolean matrix to check. |
| 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. |
|
staticconstexpr |
Defined in is-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.
| T | the type to check. |