libsemigroups
Public Member Functions | Friends | List of all members
libsemigroups::BooleanMat Class Reference

Matrices over the boolean semiring. More...

#include <elements.h>

Inheritance diagram for libsemigroups::BooleanMat:
Inheritance graph
Collaboration diagram for libsemigroups::BooleanMat:
Collaboration graph

Public Member Functions

 BooleanMat (std::vector< bool > *matrix)
 A constructor. More...
 
 BooleanMat (std::vector< std::vector< bool >> const &matrix)
 A constructor. More...
 
void redefine (Element const *x, Element const *y) final
 Multiplies x and y and stores the result in this. More...
 
- Public Member Functions inherited from libsemigroups::MatrixOverSemiringBase< bool, BooleanMat >
 MatrixOverSemiringBase (std::vector< bool > *matrix, Semiring< bool > const *semiring)
 A constructor. More...
 
 MatrixOverSemiringBase (std::vector< std::vector< bool >> const &matrix, Semiring< bool > const *semiring)
 A constructor. More...
 
size_t complexity () const override
 Returns the approximate time complexity of multiplying two matrices. More...
 
size_t degree () const override
 Returns the dimension of the matrix. More...
 
Elementidentity () const override
 Returns the identity matrix with dimension of this. More...
 
Elementreally_copy (size_t increase_deg_by=0) const override
 Returns a pointer to a copy of this. More...
 
void redefine (Element const *x, Element const *y) override
 Multiply x and y and stores the result in this. More...
 
Semiring< bool > const * semiring () const
 Returns a pointer to the Semiring over which the matrix is defined. More...
 
- Public Member Functions inherited from libsemigroups::ElementWithVectorData< bool, BooleanMat >
 ElementWithVectorData ()
 A constructor. More...
 
 ElementWithVectorData (std::vector< bool > *vector)
 A constructor. More...
 
 ElementWithVectorData (std::vector< bool > const &vector)
 A constructor. More...
 
bool at (size_t pos) const
 Returns the pos entry in the vector containing the defining data. More...
 
std::vector< bool >::iterator begin () const
 Returns an iterator. More...
 
std::vector< bool >::iterator cbegin () const
 Returns a const iterator. More...
 
std::vector< bool >::iterator cend () const
 Returns a const iterator. More...
 
void copy (Element const *x) override
 Copy another Element into this. More...
 
std::vector< bool >::iterator end () const
 Returns an iterator. More...
 
bool operator< (Element const &that) const override
 Returns true if this is less than that. More...
 
bool operator== (Element const &that) const override
 Returns true if this equals that. More...
 
bool operator[] (size_t pos) const
 Returns the pos entry in the vector containing the defining data. More...
 
void really_delete () override
 Deletes the defining data of an ElementWithVectorData. More...
 
void swap (Element *x) override
 Swap another Element with this. More...
 
- Public Member Functions inherited from libsemigroups::Element
 Element (elm_t type=Element::elm_t::NOT_RWSE)
 A constructor. More...
 
virtual ~Element ()
 A default destructor. More...
 
elm_t get_type () const
 Returns the type libsemigroups::Element::elm_t of an Element object. More...
 
size_t hash_value () const
 Return the hash value of an Element. More...
 
virtual void redefine (Element const *x, Element const *y, size_t const &thread_id)
 Multiplies x and y and stores the result in this. More...
 

Friends

class MatrixOverSemiringBase< bool, BooleanMat >
 

Additional Inherited Members

- Public Types inherited from libsemigroups::Element
enum  elm_t { RWSE = 0, NOT_RWSE = 1 }
 This enum contains some different types of Element. More...
 
- Protected Member Functions inherited from libsemigroups::MatrixOverSemiringBase< bool, BooleanMat >
 MatrixOverSemiringBase (std::vector< bool > *matrix)
 Constructs a MatrixOverSemiringBase with whose underlying semiring is not defined. The underlying semiring must be set by any class deriving from this one. More...
 
- Protected Member Functions inherited from libsemigroups::ElementWithVectorDataDefaultHash< bool, BooleanMat >
void cache_hash_value () const override
 This method implements the default hash function for an ElementWithVectorData, which uses ElementWithVectorData::vector_hash. Derive from this class if you are defining a class derived from ElementWithVectorData and there is a specialization of std::hash for the template parameter TValueType, and you do not want to define a hash function explicitly in your derived class. More...
 
- Protected Member Functions inherited from libsemigroups::Element
void reset_hash_value () const
 Reset the cached value used by Element::hash_value. More...
 
- Static Protected Member Functions inherited from libsemigroups::ElementWithVectorData< bool, BooleanMat >
static size_t vector_hash (std::vector< T > const *vec)
 Returns a hash value for a vector provided there is a specialization of std::hash for the template type T. More...
 
- Protected Attributes inherited from libsemigroups::ElementWithVectorData< bool, BooleanMat >
std::vector< bool > * _vector
 The vector containing the defining data of this. More...
 
- Static Protected Attributes inherited from libsemigroups::Element
static size_t const UNDEFINED = std::numeric_limits<size_t>::max()
 UNDEFINED value. More...
 

Detailed Description

Matrices over the boolean semiring.

A boolean matrix is a square matrix over the boolean semiring, under the usual multiplication of matrices.

Every boolean matrix is defined over a single static copy of the boolean semiring.

Constructor & Destructor Documentation

§ BooleanMat() [1/2]

libsemigroups::BooleanMat::BooleanMat ( std::vector< bool > *  matrix)
inlineexplicit

A constructor.

Constructs a boolean matrix defined by matrix, matrix is not copied, and should be deleted using ElementWithVectorData::really_delete.

The parameter matrix should be a vector of boolean values of length \(n ^ 2\) for some integer \(n\), so that the value in position \(ni + j\) is the entry in row \(i\) and column \(j\) of the constructed matrix.

§ BooleanMat() [2/2]

libsemigroups::BooleanMat::BooleanMat ( std::vector< std::vector< bool >> const &  matrix)
inlineexplicit

A constructor.

Constructs a boolean matrix defined by matrix, which is copied into the constructed boolean matrix; see BooleanMat::BooleanMat for more details.

Member Function Documentation

§ redefine()

void libsemigroups::BooleanMat::redefine ( Element const *  x,
Element const *  y 
)
finalvirtual

Multiplies x and y and stores the result in this.

This method asserts that the dimensions of x, y, and this, are all equal, and that neither x nor y equals this.

Reimplemented from libsemigroups::Element.


The documentation for this class was generated from the following files: