libsemigroups
|
Subclass of Element that wraps an libsemigroups::rws_word_t. More...
#include <rwse.h>
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... | |
Element * | identity () 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... | |
Element * | really_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... | |
![]() | |
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 | |
![]() | |
enum | elm_t { RWSE = 0, NOT_RWSE = 1 } |
This enum contains some different types of Element. More... | |
![]() | |
void | reset_hash_value () const |
Reset the cached value used by Element::hash_value. More... | |
![]() | |
static size_t const | UNDEFINED = std::numeric_limits<size_t>::max() |
UNDEFINED value. More... | |
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.
|
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.
|
inline |
Constructor from a rewriting system and a letter.
Calls RWSE::RWSE with RWS::uint_to_rws_word of a
.
Constructor from a rewriting system and a word.
Calls RWSE::RWSE with RWS::word_to_rws_word of w
.
|
inlineoverridevirtual |
Calculates a hash value for this object which is cached.
Implements libsemigroups::Element.
|
inlineoverridevirtual |
Returns the approximate time complexity of multiplying two RWSE's.
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.
|
overridevirtual |
Copy x
into this
.
This method copies the RWSE pointed to by x
into this
by changing this
in-place.
Implements libsemigroups::Element.
|
inlineoverridevirtual |
Returns the degree of an RWSE.
Returns the integer 0 since the notion of degree is not really meaningful in this context.
Implements libsemigroups::Element.
|
inline |
Returns a pointer to the rws_word_t used to create this
.
|
inlineoverridevirtual |
Return the identity RWSE.
Returns a new RWSE wrapping the empty word and over the same rewriting system as this
.
Implements libsemigroups::Element.
|
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.
|
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.
|
overridevirtual |
Returns a pointer to a copy of this
.
The parameter increase_deg_by
is not used
Implements libsemigroups::Element.
|
inlineoverridevirtual |
Deletes the underlying rws_word_t that this object wraps.
Implements libsemigroups::Element.
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.
|
overridevirtual |
Swap another Element with this
.
This method swaps the defining data of x
and this
.
Implements libsemigroups::Element.