![]() |
libsemigroups
v3.0.0
C++ library for semigroups and monoids
|
Defined in bmat8.hpp
.
This class represents 8 x 8 matrices over the boolean semiring. The functions for these small matrices over the boolean semiring are more optimised than the generic functions for boolean matrices. Note that all BMat8 are represented internally as an 8 x 8 matrix; any entries not defined by the user are taken to be 0. This does not affect the results of any calculations.
Public Member Functions | |
BMat8 () noexcept=default | |
Default constructor. | |
constexpr | BMat8 (BMat8 &&) noexcept=default |
Default move constructor. | |
constexpr | BMat8 (BMat8 const &) noexcept=default |
Default copy constructor. | |
BMat8 (std::vector< std::vector< bool > > const &mat) | |
A constructor. | |
constexpr | BMat8 (uint64_t mat) noexcept |
Construct from an integer. | |
uint8_t | at (size_t r) const |
Access a row of a BMat8 (with bound checks). | |
BitRef | at (size_t r, size_t c) |
Access entries in a matrix (with bound checks). | |
bool | at (size_t r, size_t c) const |
Access entries in a matrix (with bound checks). | |
constexpr bool | operator!= (BMat8 const &that) const noexcept |
Inequality operator. | |
constexpr uint8_t | operator() (size_t r) const noexcept |
Access a row of a BMat8 (no bound checks). | |
constexpr BitRef | operator() (size_t r, size_t c) |
Access entries in a matrix (no bound checks). | |
constexpr bool | operator() (size_t r, size_t c) const noexcept |
Access entries in a matrix (no bound checks). | |
BMat8 | operator* (BMat8 const &that) const noexcept |
Returns the matrix product of this and that . | |
constexpr BMat8 | operator* (bool scalar) const noexcept |
Multiply a BMat8 by a scalar. | |
BMat8 & | operator*= (BMat8 const &that) noexcept |
Multiply this by that in-place. | |
constexpr BMat8 & | operator*= (bool scalar) noexcept |
Multiply a BMat8 by a scalar (in-place). | |
constexpr BMat8 | operator+ (BMat8 const &that) const noexcept |
Sum BMat8 objects. | |
constexpr BMat8 & | operator+= (BMat8 const &that) noexcept |
Sum BMat8 objects (in-place). | |
constexpr bool | operator< (BMat8 const &that) const noexcept |
Less than operator. | |
constexpr bool | operator<= (BMat8 const &that) const noexcept |
Less than or equal operator. | |
constexpr BMat8 & | operator= (BMat8 &&) noexcept=default |
Default move assignment operator. | |
constexpr BMat8 & | operator= (BMat8 const &) noexcept=default |
Default copy assignment operator. | |
constexpr bool | operator== (BMat8 const &that) const noexcept |
Equality operator. | |
constexpr bool | operator> (BMat8 const &that) const noexcept |
Greater than operator. | |
constexpr bool | operator>= (BMat8 const &that) const noexcept |
Greater than or equal operator. | |
void | swap (BMat8 &that) noexcept |
Swaps this with that . | |
constexpr uint64_t | to_int () const noexcept |
Returns the integer representation of this . | |
|
defaultnoexcept |
There is no guarantee about the contents of the matrix constructed.
noexcept
and is guaranteed never to throw.
|
inlineexplicitconstexprnoexcept |
This constructor initializes a BMat8 to have rows equal to the 8 chunks, of 8 bits each, of the binary representation of mat
.
mat | the integer representation of the matrix being constructed. |
noexcept
and is guaranteed never to throw.
|
explicit |
This constructor initializes a matrix where the rows of the matrix are the vectors in mat
.
mat | the vector of vectors representation of the matrix being constructed. |
LibsemigroupsException | if mat has 0 rows. |
LibsemigroupsException | if mat has more than 8 rows. |
LibsemigroupsException | if the rows of mat are not all of the same length. |
noexcept
and is guaranteed never to throw.noexcept
and is guaranteed never to throw.
|
nodiscard |
Returns the row with index r
in the matrix represented as a uint8_t
.
r | the index of the row. |
LibsemigroupsException | if r is out of bounds (i.e. \(>=
8\)). |
|
nodiscard |
Returns a reference to the entry in the row r
and column c
.
r | the row. |
c | the column. |
LibsemigroupsException | if r or c is out of bounds. |
|
nodiscard |
Returns the value of the entry in the row r
and column c
.
r | the row. |
c | the column. |
LibsemigroupsException | if r or c is out of bounds. |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
Returns the row with index r
in the matrix represented as a uint8_t
.
r | the index of the row. |
noexcept
and is guaranteed never to throw.r
are performed.
|
inlinenodiscardconstexpr |
Returns a reference to the entry in the matrix in row r
and column c
.
r | the index of the row. |
c | the index of the column. |
noexcept
and is guaranteed never to throw.r
and c
are performed, if r
or c
is greater than 7, then bad things will happen.
|
inlinenodiscardconstexprnoexcept |
Returns the entry in the matrix in row r
and column c
.
r | the index of the row. |
c | the index of the column. |
bool
.noexcept
and is guaranteed never to throw.r
and c
are performed, if r
or c
is greater than 7, then bad things will happen.
|
inlinenodiscardconstexprnoexcept |
This function replaces the value of this
by the standard matrix product (over the boolean semiring) of this
and that
.
that | the matrix we want to multiply by this . |
*this
.noexcept
and is guaranteed never to throw.
|
inlineconstexprnoexcept |
This function returns the product of a BMat8 object and the boolean scalar value scalar
.
scalar | the scalar. |
this
.noexcept
and is guaranteed never to throw.This function adds that
to *this
in-place.
that | the BMat8 to add. |
*this
.noexcept
and is guaranteed never to throw.
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
noexcept
and is guaranteed never to throw.noexcept
and is guaranteed never to throw.
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
Returns true
if this
is greater than or equal to that
.
This function checks whether a BMat8 objects is greater or equal than another; where the order is defined by to_int.
that | the BMat8 for comparison. |
noexcept
and is guaranteed never to throw.
|
inlinenoexcept |
This function swaps the values of this
and that
.
that | the BMat8 to swap this with. |
noexcept
and is guaranteed never to throw.
|
inlinenodiscardconstexprnoexcept |
Returns an unsigned integer obtained by interpreting an 8 x 8 BMat8 as a sequence of 64 bits (reading rows left to right, from top to bottom) and then realising this sequence as an unsigned int.
uint64_t
.noexcept
and is guaranteed never to throw.