libsemigroups
Public Member Functions | Protected Member Functions | List of all members
libsemigroups::Transformation< T > Class Template Reference

Template class for transformations. More...

#include <elements.h>

Inheritance diagram for libsemigroups::Transformation< T >:
Inheritance graph
Collaboration diagram for libsemigroups::Transformation< T >:
Collaboration graph

Public Member Functions

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...
 
- Public Member Functions inherited from libsemigroups::PartialTransformation< T, Transformation< T > >
size_t complexity () const override
 Returns the approximate time complexity of multiplying two partial transformations. More...
 
size_t crank () const
 Returns the rank of a partial transformation. More...
 
size_t degree () const override
 Returns the degree of a partial transformation. More...
 
Elementidentity () const override
 Returns the identity transformation with degrees of this. More...
 
- Public Member Functions inherited from libsemigroups::ElementWithVectorData< T, Transformation< T > >
 ElementWithVectorData ()
 A constructor. More...
 
 ElementWithVectorData (std::vector< T > *vector)
 A constructor. More...
 
 ElementWithVectorData (std::vector< T > const &vector)
 A constructor. More...
 
at (size_t pos) const
 Returns the pos entry in the vector containing the defining data. More...
 
std::vector< T >::iterator begin () const
 Returns an iterator. More...
 
std::vector< T >::iterator cbegin () const
 Returns a const iterator. More...
 
std::vector< T >::iterator cend () const
 Returns a const iterator. More...
 
void copy (Element const *x) override
 Copy another Element into this. More...
 
std::vector< 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...
 
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, size_t const &thread_id)
 Multiplies x and y and stores the result in this. More...
 

Protected Member Functions

void cache_hash_value () const override
 This method is included because it seems to give superior performance in some benchmarks. More...
 
- Protected Member Functions inherited from libsemigroups::ElementWithVectorDataDefaultHash< T, Transformation< T > >
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...
 

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 Public Attributes inherited from libsemigroups::PartialTransformation< T, Transformation< T > >
static T const UNDEFINED
 Undefined image value. More...
 
- Static Protected Member Functions inherited from libsemigroups::ElementWithVectorData< T, Transformation< T > >
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< T, Transformation< T > >
std::vector< 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

template<typename T>
class libsemigroups::Transformation< T >

Template class for transformations.

The value of the template parameter T can be used to reduce the amount of memory required by instances of this class; see PartialTransformation and ElementWithVectorData for more details.

A transformation \(f\) is just a function defined on the whole of \(\{0, 1, \ldots, n - 1\}\) for some integer \(n\) called the degree of \(f\). A transformation is stored as a vector of the images of \(\{0, 1, \ldots, n - 1\}\), i.e. \(\{(0)f, (1)f, \ldots, (n - 1)f\}\).

Member Function Documentation

§ cache_hash_value()

template<typename T>
void libsemigroups::Transformation< T >::cache_hash_value ( ) const
inlineoverrideprotectedvirtual

This method is included because it seems to give superior performance in some benchmarks.

Implements libsemigroups::Element.

§ really_copy()

template<typename T>
Element* libsemigroups::Transformation< T >::really_copy ( size_t  increase_deg_by = 0) const
inlineoverridevirtual

Returns a pointer to a copy of this.

See Element::really_copy for more details about this method.

The copy returned by this method fixes all the values between the Transformation::degree of this and increase_deg_by.

Implements libsemigroups::Element.

§ redefine()

template<typename T>
void libsemigroups::Transformation< T >::redefine ( Element const *  x,
Element const *  y 
)
inlineoverridevirtual

Multiply x and y and stores the result in this.

See Element::redefine for more details about this method.

This method asserts that the degrees 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 file: