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

Template class for permutations. More...

#include <elements.h>

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

Public Member Functions

Permutationinverse ()
 Returns the inverse of a permutation. More...
 
- Public Member Functions inherited from libsemigroups::Transformation< T >
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...
 

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...
 
- Protected Member Functions inherited from libsemigroups::Transformation< T >
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...
 
- 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::Permutation< T >

Template class for permutations.

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 permutation \(f\) is an injective transformation defined on the whole of \(\{0, 1, \ldots, n - 1\}\) for some integer \(n\) called the degree of \(f\). A permutation 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

◆ inverse()

template<typename T >
Permutation* libsemigroups::Permutation< T >::inverse ( )
inline

Returns the inverse of a permutation.

The inverse of a permutation \(f\) is the permutation \(g\) such that \(fg = gf\) is the identity permutation of degree \(n\).


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