libsemigroups
Public Member Functions | Protected Member Functions | List of all members
libsemigroups::PBR Class Reference

Class for partitioned binary relations (PBR). More...

#include <elements.h>

Inheritance diagram for libsemigroups::PBR:
Inheritance graph
Collaboration diagram for libsemigroups::PBR:
Collaboration graph

Public Member Functions

size_t complexity () const override
 Returns the approximate time complexity of multiplying PBRs. More...
 
size_t degree () const override
 Returns the degree of a PBR. More...
 
Elementidentity () const override
 Returns the identity PBR with degree equal to that of this. More...
 
void redefine (Element const *x, Element const *y, size_t const &thread_id) override
 Multiply x and y and stores the result in this. More...
 
- Public Member Functions inherited from libsemigroups::ElementWithVectorData< std::vector< u_int32_t >, PBR >
 ElementWithVectorData ()
 A constructor. More...
 
 ElementWithVectorData (std::vector< std::vector< u_int32_t > > *vector)
 A constructor. More...
 
 ElementWithVectorData (std::vector< std::vector< u_int32_t > > const &vector)
 A constructor. More...
 
std::vector< u_int32_t > at (size_t pos) const
 Returns the pos entry in the vector containing the defining data. More...
 
std::vector< std::vector< u_int32_t > >::iterator begin () const
 Returns an iterator. More...
 
std::vector< std::vector< u_int32_t > >::iterator cbegin () const
 Returns a const iterator. More...
 
std::vector< std::vector< u_int32_t > >::iterator cend () const
 Returns a const iterator. More...
 
void copy (Element const *x) override
 Copy another Element into this. More...
 
std::vector< std::vector< u_int32_t > >::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...
 
std::vector< u_int32_t > operator[] (size_t pos) const
 Returns the pos entry in the vector containing the defining data. More...
 
Elementreally_copy (size_t increase_deg_by=0) const override
 Returns a pointer to a copy of this. 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)
 Multiplies x and y and stores the result in this. More...
 

Protected Member Functions

void cache_hash_value () const override
 Calculate and cache a hash value. More...
 
- Protected Member Functions inherited from libsemigroups::Element
void reset_hash_value () const
 Reset the cached value used by Element::hash_value. More...
 

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...
 
- Static Protected Member Functions inherited from libsemigroups::ElementWithVectorData< std::vector< u_int32_t >, PBR >
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< std::vector< u_int32_t >, PBR >
std::vector< std::vector< u_int32_t > > * _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

Class for partitioned binary relations (PBR).

Partitioned binary relations (PBRs) are a generalisation of bipartitions, which were introduced by Martin and Mazorchuk.

Member Function Documentation

§ cache_hash_value()

void libsemigroups::PBR::cache_hash_value ( ) const
overrideprotectedvirtual

Calculate and cache a hash value.

This method is used to compute and cache the hash value of this.

Implements libsemigroups::Element.

§ complexity()

size_t libsemigroups::PBR::complexity ( ) const
overridevirtual

Returns the approximate time complexity of multiplying PBRs.

The approximate time complexity of multiplying PBRs is \(2n ^ 3\) where \(n\) is the degree.

Implements libsemigroups::Element.

§ degree()

size_t libsemigroups::PBR::degree ( ) const
overridevirtual

Returns the degree of a PBR.

The degree of a PBR is half the number of points in the PBR, which is also half the length of the underlying vector ElementWithVectorData::_vector.

Implements libsemigroups::Element.

§ identity()

Element * libsemigroups::PBR::identity ( ) const
overridevirtual

Returns the identity PBR with degree equal to that of this.

This method returns a new PBR with degree equal to the degree of this where every value is adjacent to its negative. Equivalently, \(i\) is adjacent \(i + n\) and vice versa for every \(i\) less than the degree \(n\).

Implements libsemigroups::Element.

§ redefine()

void libsemigroups::PBR::redefine ( Element const *  x,
Element const *  y,
size_t const &  thread_id 
)
overridevirtual

Multiply x and y and stores the result in this.

This method redefines this to be the product of the parameters x and y. This method asserts that the degrees of x, y, and this, are all equal, and that neither x nor y equals this.

The parameter thread_id is required since some temporary storage is required to find the product of x and y. Note that if different threads call this method with the same value of thread_id then bad things will happen.

Reimplemented from libsemigroups::Element.


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