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

Subclass of Element that wraps an libsemigroups::rws_word_t. More...

#include <rwse.h>

Inheritance diagram for libsemigroups::RWSE:
Inheritance graph
Collaboration diagram for libsemigroups::RWSE:
Collaboration graph

Public Member Functions

 RWSE (RWS *rws, rws_word_t *w)
 Constructor from a rewriting system and a word. More...
 
 RWSE (RWS &rws, rws_word_t const &w)
 Constructor from a rewriting system and a word. More...
 
 RWSE (RWS &rws, letter_t const &a)
 Constructor from a rewriting system and a letter. More...
 
 RWSE (RWS &rws, word_t const &w)
 Constructor from a rewriting system and a word. More...
 
void cache_hash_value () const override
 Calculates a hash value for this object which is cached. More...
 
size_t complexity () const override
 Returns the approximate time complexity of multiplying two RWSE's. More...
 
void copy (Element const *x) override
 Copy x into this. More...
 
size_t degree () const override
 Returns the degree of an RWSE. More...
 
rws_word_t const * get_rws_word () const
 Returns a pointer to the rws_word_t used to create this. More...
 
Elementidentity () const override
 Return the identity RWSE. More...
 
bool operator< (const Element &that) const override
 Returns true if this is less than that and false if it is not. More...
 
bool operator== (Element const &that) const override
 Returns true if this equals that. More...
 
Elementreally_copy (size_t increase_deg_by) const override
 Returns a pointer to a copy of this. More...
 
void really_delete () override
 Deletes the underlying rws_word_t that this object wraps. More...
 
void redefine (Element const *x, Element const *y) override
 Multiply x and y and stores the result in this. 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...
 

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::Element
void reset_hash_value () const
 Reset the cached value used by Element::hash_value. More...
 
- Static Protected Attributes inherited from libsemigroups::Element
static size_t const UNDEFINED = std::numeric_limits<size_t>::max()
 UNDEFINED value. More...
 

Detailed Description

Subclass of Element that wraps an libsemigroups::rws_word_t.

This class is used to wrap libsemigroups::rws_word_t into an Element so that it is possible to use them as generators for a Semigroup object.

Constructor & Destructor Documentation

§ RWSE() [1/4]

libsemigroups::RWSE::RWSE ( RWS rws,
rws_word_t *  w 
)
inline

Constructor from a rewriting system and a word.

Constructs a RWSE which is essentially the word w, whose multiplication with other RWSE's is defined with respect to the rewriting system rws.

The rws_word_t w is not copied, and should be deleted using ElementWithVectorData::really_delete.

The rewriting system rws is not copied either, and it is the responsibility of the caller to delete it.

§ RWSE() [2/4]

libsemigroups::RWSE::RWSE ( RWS rws,
rws_word_t const &  w 
)
inline

Constructor from a rewriting system and a word.

Constructs a RWSE which is essentially the word w, whose multiplication with other RWSE's is defined with respect to the rewriting system rws.

The rws_word_t w is copied, but the rewriting system rws is not.

§ RWSE() [3/4]

libsemigroups::RWSE::RWSE ( RWS rws,
letter_t const &  a 
)
inline

Constructor from a rewriting system and a letter.

Calls RWSE::RWSE with RWS::uint_to_rws_word of a.

§ RWSE() [4/4]

libsemigroups::RWSE::RWSE ( RWS rws,
word_t const &  w 
)
inline

Constructor from a rewriting system and a word.

Calls RWSE::RWSE with RWS::word_to_rws_word of w.

Member Function Documentation

§ cache_hash_value()

void libsemigroups::RWSE::cache_hash_value ( ) const
inlineoverridevirtual

Calculates a hash value for this object which is cached.

See also
Element::hash_value and Element::cache_hash_value.

Implements libsemigroups::Element.

§ complexity()

size_t libsemigroups::RWSE::complexity ( ) const
inlineoverridevirtual

Returns the approximate time complexity of multiplying two RWSE's.

See also
Element::complexity.

Returns Semigroup::LIMIT_MAX since the complexity of multiplying words in a rewriting system is higher than the cost of tracing a path in the left or right Cayley graph of a Semigroup.

Implements libsemigroups::Element.

§ copy()

void libsemigroups::RWSE::copy ( Element const *  x)
overridevirtual

Copy x into this.

This method copies the RWSE pointed to by x into this by changing this in-place.

Implements libsemigroups::Element.

§ degree()

size_t libsemigroups::RWSE::degree ( ) const
inlineoverridevirtual

Returns the degree of an RWSE.

See also
Element::degree.

Returns the integer 0 since the notion of degree is not really meaningful in this context.

Implements libsemigroups::Element.

§ get_rws_word()

rws_word_t const* libsemigroups::RWSE::get_rws_word ( ) const
inline

Returns a pointer to the rws_word_t used to create this.

§ identity()

Element* libsemigroups::RWSE::identity ( ) const
inlineoverridevirtual

Return the identity RWSE.

See also
Element::identity.

Returns a new RWSE wrapping the empty word and over the same rewriting system as this.

Implements libsemigroups::Element.

§ operator<()

bool libsemigroups::RWSE::operator< ( const Element that) const
overridevirtual

Returns true if this is less than that and false if it is not.

This defines a total order on RWSEs that is the short-lex order on all words.

Implements libsemigroups::Element.

§ operator==()

bool libsemigroups::RWSE::operator== ( Element const &  that) const
inlineoverridevirtual

Returns true if this equals that.

This method checks the mathematical equality of two RWSE, in other words whether or not they represent that the same reduced word of the rewriting system they are defined over.

Implements libsemigroups::Element.

§ really_copy()

Element * libsemigroups::RWSE::really_copy ( size_t  increase_deg_by) const
overridevirtual

Returns a pointer to a copy of this.

The parameter increase_deg_by is not used

See also
Element::really_copy.

Implements libsemigroups::Element.

§ really_delete()

void libsemigroups::RWSE::really_delete ( )
inlineoverridevirtual

Deletes the underlying rws_word_t that this object wraps.

See also
Element::really_delete.

Implements libsemigroups::Element.

§ redefine()

void libsemigroups::RWSE::redefine ( Element const *  x,
Element const *  y 
)
overridevirtual

Multiply x and y and stores the result in this.

Redefine this to be a reduced word with respect to the rewriting system of x and y which is equivalent to the concatenation of x and y. This method asserts that x and y have the same rewriting system.

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.

§ swap()

void libsemigroups::RWSE::swap ( Element x)
overridevirtual

Swap another Element with this.

This method swaps the defining data of x and this.

Implements libsemigroups::Element.


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