diff --git a/adapters_8hpp.html b/adapters_8hpp.html deleted file mode 100644 index 6124dc0d2..000000000 --- a/adapters_8hpp.html +++ /dev/null @@ -1,134 +0,0 @@ - - -
- - - - -
- libsemigroups
-
- |
-
This file contains function templates for adapting a user-defined type so that it can be used with libsemigroups. -More...
-#include <algorithm>
#include <utility>
#include <vector>
#include "libsemigroups-config.hpp"
Go to the source code of this file.
--Namespaces | |
libsemigroups | |
Namespace for everything in the libsemigroups library. | |
This file contains function templates for adapting a user-defined type so that it can be used with libsemigroups.
-To use the TODO(now)
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
▼Nlibsemigroups | Namespace for everything in the libsemigroups library |
CBipartition | Class for bipartitions |
CBlocks | Class for signed partitions of the set \(\{0, \ldots, n - 1\}\) |
CBooleanMat | Matrices over the boolean semiring |
CBooleanSemiring | The usual Boolean semiring |
CCongruence | Class for congruence on a semigroup or fintely presented semigroup |
▼CElement | Abstract base class for semigroup elements |
CEqual | Provides a call operator for comparing Elements via pointers |
CHash | Provides a call operator returning a hash value for an Element via a pointer |
CElementWithVectorData | Abstract base class for elements using a vector to store their defining data |
CElementWithVectorDataDefaultHash | Abstract base class for elements using a vector to store their defining data and the default hash function for that underlying vector |
CIntegers | The usual ring of integers |
CMatrixOverSemiring | Matrices over a semiring |
CMatrixOverSemiringBase | Matrices over a semiring |
CMaxPlusSemiring | The max-plus semiring consists of the integers together with negative infinity with operations max and plus. Negative infinity is represented by Semiring<int64_t>::MINUS_INFTY |
CMinPlusSemiring | The min-plus semiring consists of the integers together with infinity with operations min and plus. Infinity is represented by Semiring<int64_t>::INFTY |
CNaturalSemiring | This class implements the semiring consisting of \(\{0, 1, ..., t, t + 1, ..., t + p - 1\}\) for some threshold \(t\) and period \(p\) with operations addition and multiplication modulo the congruence \(t = t + p\) |
CPartialPerm | Template class for partial permutations |
CPartialTransformation | Abstract class for partial transformations |
CPartition | Class for partitions of a set used by Congruence::nontrivial_classes |
CPBR | Class for partitioned binary relations (PBR) |
CPermutation | Template class for permutations |
CProjectiveMaxPlusMatrix | Class for projective max-plus matrices |
CReductionOrdering | This class provides a call operator which can be used to compare libsemigroups::rws_word_t |
CRWS | This class is used to represent a string rewriting system defining a finitely presented monoid or semigroup |
CRWSE | Subclass of Element that wraps an libsemigroups::rws_word_t |
CSemigroup | Class for semigroups generated by instances of Element |
CSemiring | This class its subclasses provide very basic functionality for creating semirings |
CSemiringWithThreshold | This abstract class provides common methods for its subclasses TropicalMaxPlusSemiring, TropicalMinPlusSemiring, and NaturalSemiring |
CSHORTLEX | This class implements the shortlex reduction ordering derived from an ordering on libsemigroups::rws_letter_t's |
CTransformation | Template class for transformations |
CTropicalMaxPlusSemiring | The tropical max-plus semiring consists of the integers \(\{0, \ldots , t\}\) for some value \(t\) (called the threshold of the semiring) and \(-\infty\). Negative infinity is represented by Semiring<int64_t>::MINUS_INFTY |
CTropicalMinPlusSemiring | The tropical min-plus semiring consists of the integers \(\{0, \ldots , t\}\) for some value \(t\) (called the threshold of the semiring) and \(\infty\). Infinity is represented by Semiring<int64_t>::INFTY |
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::ActionDigraph< TIntType >, including all inherited members.
-ActionDigraph(TIntType nr_ndes=0, TIntType dgree=0) | libsemigroups::ActionDigraph< TIntType > | inlineexplicit |
ActionDigraph(ActionDigraph const &)=default (defined in libsemigroups::ActionDigraph< TIntType >) | libsemigroups::ActionDigraph< TIntType > | |
ActionDigraph(ActionDigraph &&)=default (defined in libsemigroups::ActionDigraph< TIntType >) | libsemigroups::ActionDigraph< TIntType > | |
add_edge(node_type i, node_type j, label_type lbl) | libsemigroups::ActionDigraph< TIntType > | inline |
add_nodes(size_t nr) | libsemigroups::ActionDigraph< TIntType > | inline |
add_to_out_degree(size_t nr) | libsemigroups::ActionDigraph< TIntType > | inline |
cbegin_edges(node_type i) const (defined in libsemigroups::ActionDigraph< TIntType >) | libsemigroups::ActionDigraph< TIntType > | inline |
cbegin_nodes() const (defined in libsemigroups::ActionDigraph< TIntType >) | libsemigroups::ActionDigraph< TIntType > | inline |
cbegin_scc(scc_index_type i) const (defined in libsemigroups::ActionDigraph< TIntType >) | libsemigroups::ActionDigraph< TIntType > | inline |
cbegin_scc_roots() const (defined in libsemigroups::ActionDigraph< TIntType >) | libsemigroups::ActionDigraph< TIntType > | inline |
cbegin_sccs() const (defined in libsemigroups::ActionDigraph< TIntType >) | libsemigroups::ActionDigraph< TIntType > | inline |
cend_edges(node_type i) const (defined in libsemigroups::ActionDigraph< TIntType >) | libsemigroups::ActionDigraph< TIntType > | inline |
cend_nodes() const (defined in libsemigroups::ActionDigraph< TIntType >) | libsemigroups::ActionDigraph< TIntType > | inline |
cend_scc(scc_index_type i) const (defined in libsemigroups::ActionDigraph< TIntType >) | libsemigroups::ActionDigraph< TIntType > | inline |
cend_scc_roots() const (defined in libsemigroups::ActionDigraph< TIntType >) | libsemigroups::ActionDigraph< TIntType > | inline |
cend_sccs() const (defined in libsemigroups::ActionDigraph< TIntType >) | libsemigroups::ActionDigraph< TIntType > | inline |
const_iterator_edges typedef | libsemigroups::ActionDigraph< TIntType > | |
const_iterator_nodes typedef | libsemigroups::ActionDigraph< TIntType > | |
const_iterator_scc typedef | libsemigroups::ActionDigraph< TIntType > | |
const_iterator_scc_roots typedef | libsemigroups::ActionDigraph< TIntType > | |
const_iterator_sccs typedef | libsemigroups::ActionDigraph< TIntType > | |
label_type typedef | libsemigroups::ActionDigraph< TIntType > | |
neighbor(node_type v, label_type lbl) const | libsemigroups::ActionDigraph< TIntType > | inline |
node_type typedef | libsemigroups::ActionDigraph< TIntType > | |
nr_edges() const noexcept | libsemigroups::ActionDigraph< TIntType > | inline |
nr_nodes() const noexcept | libsemigroups::ActionDigraph< TIntType > | inline |
nr_scc() const | libsemigroups::ActionDigraph< TIntType > | inline |
operator=(ActionDigraph const &)=default (defined in libsemigroups::ActionDigraph< TIntType >) | libsemigroups::ActionDigraph< TIntType > | |
operator=(ActionDigraph &&)=default (defined in libsemigroups::ActionDigraph< TIntType >) | libsemigroups::ActionDigraph< TIntType > | |
out_degree() const noexcept | libsemigroups::ActionDigraph< TIntType > | inline |
random(TIntType nr_ndes, TIntType dgree, std::mt19937 mt=std::mt19937()) (defined in libsemigroups::ActionDigraph< TIntType >) | libsemigroups::ActionDigraph< TIntType > | inlinestatic |
reserve(TIntType nr_ndes, TIntType out_dgree) const noexcept | libsemigroups::ActionDigraph< TIntType > | inline |
reverse_spanning_forest() const (defined in libsemigroups::ActionDigraph< TIntType >) | libsemigroups::ActionDigraph< TIntType > | inline |
root_of_scc(node_type nd) const (defined in libsemigroups::ActionDigraph< TIntType >) | libsemigroups::ActionDigraph< TIntType > | inline |
scc_id(node_type nd) const | libsemigroups::ActionDigraph< TIntType > | inline |
scc_index_type typedef | libsemigroups::ActionDigraph< TIntType > | |
spanning_forest() const | libsemigroups::ActionDigraph< TIntType > | inline |
validate() const noexcept | libsemigroups::ActionDigraph< TIntType > | inline |
~ActionDigraph()=default (defined in libsemigroups::ActionDigraph< TIntType >) | libsemigroups::ActionDigraph< TIntType > |
- libsemigroups
-
- |
-
Class for out-regular digraphs. - More...
- -#include <digraph.hpp>
-Public Types | |
using | const_iterator_edges = typename internal::RecVec< TIntType >::const_iterator |
Alias for the type of an iterator pointing to the out-edges of a node in a digraph. More... | |
using | const_iterator_nodes = typename IntegralRange< TIntType >::const_iterator |
Alias for the type of an iterator pointing to the nodes of a digraph. More... | |
using | const_iterator_scc = typename std::vector< TIntType >::const_iterator |
Alias for the type of an iterator pointing to the nodes in a strongly connected component of a digraph. More... | |
using | const_iterator_scc_roots = internal::iterator_base< std::vector< TIntType >, node_type const *, node_type const &, node_type, iterator_methods_scc_roots > |
Alias for the type of an iterator pointing to the roots of a strongly connected components of a digraph. More... | |
using | const_iterator_sccs = typename std::vector< std::vector< TIntType > >::const_iterator |
Alias for the type of an iterator pointing to the strongly connected components of a digraph. More... | |
using | label_type = TIntType |
Alias for the type of edge labels in a digraph. More... | |
using | node_type = TIntType |
Alias for the type of nodes in a digraph. More... | |
using | scc_index_type = TIntType |
Alias for the type of an index in a strongly connected component of a digraph. More... | |
-Public Member Functions | |
Modifiers | |
void | add_nodes (size_t nr) |
Adds nr nodes to this . More... | |
void | add_to_out_degree (size_t nr) |
Adds nr to the out-degree of this . More... | |
void | add_edge (node_type i, node_type j, label_type lbl) |
Add an edge from i to j labelled lbl . More... | |
void | reserve (TIntType nr_ndes, TIntType out_dgree) const noexcept |
Reserve capacity. More... | |
Nodes, edges, neighbors | |
TIntType | neighbor (node_type v, label_type lbl) const |
Returns the node adjacent to v via the edge labelled lbl . If there is no such node, then Libsemigroups::UNDEFINED is returned. More... | |
TIntType | nr_nodes () const noexcept |
Returns the number of nodes of this . More... | |
size_t | nr_edges () const noexcept |
Returns the number of edges of this . More... | |
TIntType | out_degree () const noexcept |
Returns the out-degree of this . More... | |
bool | validate () const noexcept |
Check every node has exactly out_degree() out-edges. More... | |
-const_iterator_nodes | cbegin_nodes () const |
-const_iterator_nodes | cend_nodes () const |
-const_iterator_edges | cbegin_edges (node_type i) const |
-const_iterator_edges | cend_edges (node_type i) const |
Strongly connected components | |
TIntType | scc_id (node_type nd) const |
Returns the id of the strongly connected component of a node. More... | |
TIntType | nr_scc () const |
Returns the number of strongly connected components in this . More... | |
-node_type | root_of_scc (node_type nd) const |
-const_iterator_sccs | cbegin_sccs () const |
-const_iterator_sccs | cend_sccs () const |
-const_iterator_scc | cbegin_scc (scc_index_type i) const |
-const_iterator_scc | cend_scc (scc_index_type i) const |
-const_iterator_scc_roots | cbegin_scc_roots () const |
-const_iterator_scc_roots | cend_scc_roots () const |
Spanning forests of strongly connected components | |
Forest const & | spanning_forest () const |
Returns a Forest comprised of spanning trees for each SCC. More... | |
-Forest const & | reverse_spanning_forest () const |
-Constructors and destructor | |
ActionDigraph (TIntType nr_ndes=0, TIntType dgree=0) | |
Constructor. More... | |
- | ActionDigraph (ActionDigraph const &)=default |
- | ActionDigraph (ActionDigraph &&)=default |
-ActionDigraph & | operator= (ActionDigraph const &)=default |
-ActionDigraph & | operator= (ActionDigraph &&)=default |
- | ~ActionDigraph ()=default |
-static ActionDigraph | random (TIntType nr_ndes, TIntType dgree, std::mt19937 mt=std::mt19937()) |
Class for out-regular digraphs.
-This class represents out-regular digraphs. If the digraph has n
nodes, they are represented by the numbers {0, ..., n - 1}.
These graphs are principally designed to be used those associated to the action of a semigroup. The template parameter TIntType
should be an unsigned integer type, which is the type of nodes in the digraph.
using libsemigroups::ActionDigraph< TIntType >::const_iterator_edges = typename internal::RecVec<TIntType>::const_iterator | -
Alias for the type of an iterator pointing to the out-edges of a node in a digraph.
- -using libsemigroups::ActionDigraph< TIntType >::const_iterator_nodes = typename IntegralRange<TIntType>::const_iterator | -
Alias for the type of an iterator pointing to the nodes of a digraph.
- -using libsemigroups::ActionDigraph< TIntType >::const_iterator_scc = typename std::vector<TIntType>::const_iterator | -
Alias for the type of an iterator pointing to the nodes in a strongly connected component of a digraph.
- -using libsemigroups::ActionDigraph< TIntType >::const_iterator_scc_roots = internal::iterator_base<std::vector<TIntType>, node_type const*, node_type const&, node_type, iterator_methods_scc_roots> | -
Alias for the type of an iterator pointing to the roots of a strongly connected components of a digraph.
- -using libsemigroups::ActionDigraph< TIntType >::const_iterator_sccs = typename std::vector<std::vector<TIntType> >::const_iterator | -
Alias for the type of an iterator pointing to the strongly connected components of a digraph.
- -using libsemigroups::ActionDigraph< TIntType >::label_type = TIntType | -
Alias for the type of edge labels in a digraph.
- -using libsemigroups::ActionDigraph< TIntType >::node_type = TIntType | -
Alias for the type of nodes in a digraph.
- -using libsemigroups::ActionDigraph< TIntType >::scc_index_type = TIntType | -
Alias for the type of an index in a strongly connected component of a digraph.
- -
-
|
- -inlineexplicit | -
Constructor.
-Constructs an ActionDigraph instance with nr_ndes
nodes and out-degree dgree
.
-
|
- -inline | -
Add an edge from i
to j
labelled lbl
.
If i
and j
are nodes in this
, and lbl
is in the range [0, out_degree()), then this method adds an edge edge from i
to j
labelled lbl
.
this
, any iterators, pointers or references pointing into this
are invalidated by a call to this function.Throws | a LibsemigroupsException if i , j , or lbl is not valid. |
-
|
- -inline | -
Adds nr
nodes to this
.
this
, any iterators, pointers or references pointing into this
are invalidated by a call to this function.this
is guaranteed not to be modified.
-
|
- -inline | -
Adds nr
to the out-degree of this
.
this
, any iterators, pointers or references pointing into this
are invalidated by a call to this function.this
is guaranteed not to be modified.
-
|
- -inline | -
Returns the node adjacent to v
via the edge labelled lbl
. If there is no such node, then Libsemigroups::UNDEFINED is returned.
Throws | a LibsemigroupsException if v or lbl is not valid. |
-
|
- -inlinenoexcept | -
Returns the number of edges of this
.
Returns the total number of edges of this
-
|
- -inlinenoexcept | -
Returns the number of nodes of this
.
-
|
- -inline | -
Returns the number of strongly connected components in this
.
Every node in this
lies in a strongly connected component (SCC). This function returns the id number of the SCC containing node
.
-
|
- -inlinenoexcept | -
Returns the out-degree of this
.
-
|
- -inlinenoexcept | -
Reserve capacity.
-Ensures that this
has capacity for nr_ndes
nodes each with out_dgree
out-edges.
this
, any iterators, pointers or references pointing into this
are invalidated by a call to this function.this
is guaranteed not to be modified.
-
|
- -inline | -
Returns the id of the strongly connected component of a node.
-Every node in this
lies in a strongly connected component (SCC). This function returns the id number of the SCC containing node
.
-
|
- -inline | -
Returns a Forest comprised of spanning trees for each SCC.
-This function returns a Forest which contains the nodes of this
, where the forest contains a spanning tree for each strongly connected component, rooted on the minimum element index of that component.
-
|
- -inlinenoexcept | -
Check every node has exactly out_degree() out-edges.
- -
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::BMat8, including all inherited members.
-BMat8()=default | libsemigroups::BMat8 | |
BMat8(uint64_t mat) | libsemigroups::BMat8 | inlineexplicit |
BMat8(std::vector< std::vector< bool >> const &mat) | libsemigroups::BMat8 | explicit |
BMat8(BMat8 const &)=default | libsemigroups::BMat8 | |
BMat8(BMat8 &&)=default | libsemigroups::BMat8 | |
one() | libsemigroups::BMat8 | inlinestatic |
operator!=(BMat8 const &that) const | libsemigroups::BMat8 | inline |
operator()(size_t i, size_t j) const | libsemigroups::BMat8 | inline |
operator*(BMat8 const &that) const | libsemigroups::BMat8 | inline |
operator<(BMat8 const &that) const | libsemigroups::BMat8 | inline |
operator<<(std::ostringstream &os, BMat8 const &bm) | libsemigroups::BMat8 | friend |
operator<<(std::ostream &os, BMat8 const &bm) | libsemigroups::BMat8 | friend |
operator=(BMat8 const &)=default | libsemigroups::BMat8 | |
operator=(BMat8 &&)=default | libsemigroups::BMat8 | |
operator==(BMat8 const &that) const | libsemigroups::BMat8 | inline |
operator>(BMat8 const &that) const | libsemigroups::BMat8 | inline |
random() | libsemigroups::BMat8 | static |
random(size_t dim) | libsemigroups::BMat8 | static |
set(size_t i, size_t j, bool val) | libsemigroups::BMat8 | inline |
swap(BMat8 &that) (defined in libsemigroups::BMat8) | libsemigroups::BMat8 | inline |
to_int() const | libsemigroups::BMat8 | inline |
transpose() const | libsemigroups::BMat8 | inline |
~BMat8()=default | libsemigroups::BMat8 |
- libsemigroups
-
- |
-
Class for fast boolean matrices of dimension up to 8 x 8. - More...
- -#include <bmat8.hpp>
-Public Member Functions | |
BMat8 ()=default | |
A default constructor. More... | |
BMat8 (uint64_t mat) | |
A constructor. More... | |
BMat8 (std::vector< std::vector< bool >> const &mat) | |
A constructor. More... | |
BMat8 (BMat8 const &)=default | |
A constructor. More... | |
BMat8 (BMat8 &&)=default | |
A constructor. More... | |
~BMat8 ()=default | |
A default destructor. More... | |
bool | operator!= (BMat8 const &that) const |
Returns true if this does not equal that . More... | |
bool | operator() (size_t i, size_t j) const |
Returns the entry in the (i , j )th position. More... | |
BMat8 | operator* (BMat8 const &that) const |
Returns the matrix product of this and that . More... | |
bool | operator< (BMat8 const &that) const |
Returns true if this is less than that . More... | |
BMat8 & | operator= (BMat8 const &)=default |
A constructor. More... | |
BMat8 & | operator= (BMat8 &&)=default |
A constructor. More... | |
bool | operator== (BMat8 const &that) const |
Returns true if this equals that . More... | |
bool | operator> (BMat8 const &that) const |
Returns true if this is greater than that . More... | |
void | set (size_t i, size_t j, bool val) |
Sets the (i , j )th position to val . More... | |
-void | swap (BMat8 &that) |
uint64_t | to_int () const |
Returns the integer representation of this . More... | |
BMat8 | transpose () const |
Returns the transpose of this . More... | |
-Static Public Member Functions | |
static BMat8 | one () |
Returns the identity BMat8. More... | |
static BMat8 | random () |
Returns a random BMat8. More... | |
static BMat8 | random (size_t dim) |
Returns a random square BMat8 up to dimension dim . More... | |
-Friends | |
std::ostringstream & | operator<< (std::ostringstream &os, BMat8 const &bm) |
Insertion operator. More... | |
std::ostream & | operator<< (std::ostream &os, BMat8 const &bm) |
Insertion operator. More... | |
Class for fast boolean matrices of dimension up to 8 x 8.
-The methods for these small matrices over the boolean semiring are more optimised than the generic methods for boolean matrices. Note that all BMat8 are represented internally as an 8 x 8 matrix; any entries not defined by the user are taken to be 0. This does not affect the results of any calculations.
-BMat8 is a trivial class.
-
-
|
- -default | -
A default constructor.
-This constructor gives no guarantees on what the matrix will contain.
- -
-
|
- -inlineexplicit | -
A constructor.
-This constructor initializes a BMat8 to have rows equal to the 8 chunks, of 8 bits each, of the binary representation of mat
.
-
|
- -explicit | -
A constructor.
-This constructor initializes a matrix where the rows of the matrix are the vectors in mat
.
-
|
- -default | -
A constructor.
-This is the copy constructor.
- -
-
|
- -default | -
A constructor.
-This is the move constructor.
- -
-
|
- -default | -
A default destructor.
- -
-
|
- -inlinestatic | -
-
|
- -inline | -
Returns true
if this
does not equal that
.
This method checks the mathematical inequality of two BMat8 objects.
- -
-
|
- -inline | -
Returns the entry in the (i
, j
)th position.
This method returns the entry in the (i
, j
)th position. Note that since all matrices are internally represented as 8 x 8, it is possible to access entries that you might not believe exist.
-
|
- -inline | -
A constructor.
-This is the copy assignement constructor.
- -A constructor.
-This is the move assignment constructor.
- -
-
|
- -inline | -
Returns true
if this
equals that
.
This method checks the mathematical equality of two BMat8 objects.
- -
-
|
- -inline | -
-
|
- -static | -
-
|
- -static | -
-
|
- -inline | -
Sets the (i
, j
)th position to val
.
This method sets the (i
, j
)th entry of this
to val
. Uses the bit twiddle for setting bits found here.
-
|
- -inline | -
Returns the integer representation of this
.
Returns an unsigned integer obtained by interpreting an 8 x 8 BMat8 as a sequence of 64 bits (reading rows left to right, from top to bottom) and then this sequence as an unsigned int.
- -
-
|
- -inline | -
Returns the transpose of this
.
Returns the standard matrix transpose of a BMat8. Uses the technique found in Knuth AoCP Vol. 4 Fasc. 1a, p. 15.
- -
-
|
- -friend | -
Insertion operator.
-This method allows BMat8 objects to be inserted into an ostringstream
- -
-
|
- -friend | -
Insertion operator.
-This method allows BMat8 objects to be inserted into a ostream.
- -
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::Bipartition, including all inherited members.
-_vector | libsemigroups::ElementWithVectorData< u_int32_t, Bipartition > | protected |
at(size_t pos) const | libsemigroups::ElementWithVectorData< u_int32_t, Bipartition > | inline |
begin() const | libsemigroups::ElementWithVectorData< u_int32_t, Bipartition > | inline |
Bipartition(size_t degree) | libsemigroups::Bipartition | inlineexplicit |
Bipartition(std::vector< u_int32_t > *blocks) | libsemigroups::Bipartition | inlineexplicit |
Bipartition(std::vector< u_int32_t > const &blocks) | libsemigroups::Bipartition | inlineexplicit |
cache_hash_value() const override | libsemigroups::ElementWithVectorDataDefaultHash< u_int32_t, Bipartition > | inlineprotectedvirtual |
cbegin() const | libsemigroups::ElementWithVectorData< u_int32_t, Bipartition > | inline |
cend() const | libsemigroups::ElementWithVectorData< u_int32_t, Bipartition > | inline |
complexity() const override | libsemigroups::Bipartition | virtual |
const_nr_blocks() const | libsemigroups::Bipartition | |
copy(Element const *x) override | libsemigroups::ElementWithVectorData< u_int32_t, Bipartition > | inlinevirtual |
degree() const override | libsemigroups::Bipartition | virtual |
Element(elm_t type=Element::elm_t::NOT_RWSE) | libsemigroups::Element | inlineexplicit |
ElementWithVectorData() | libsemigroups::ElementWithVectorData< u_int32_t, Bipartition > | inline |
ElementWithVectorData(std::vector< u_int32_t > *vector) | libsemigroups::ElementWithVectorData< u_int32_t, Bipartition > | inlineexplicit |
ElementWithVectorData(std::vector< u_int32_t > const &vector) | libsemigroups::ElementWithVectorData< u_int32_t, Bipartition > | inlineexplicit |
elm_t enum name | libsemigroups::Element | |
end() const | libsemigroups::ElementWithVectorData< u_int32_t, Bipartition > | inline |
get_type() const | libsemigroups::Element | inline |
hash_value() const | libsemigroups::Element | inline |
identity() const override | libsemigroups::Bipartition | virtual |
is_transverse_block(size_t index) | libsemigroups::Bipartition | |
left_blocks() | libsemigroups::Bipartition | |
NOT_RWSE enum value | libsemigroups::Element | |
nr_blocks() | libsemigroups::Bipartition | |
nr_left_blocks() | libsemigroups::Bipartition | |
nr_right_blocks() | libsemigroups::Bipartition | |
operator<(Element const &that) const override | libsemigroups::ElementWithVectorData< u_int32_t, Bipartition > | inlinevirtual |
operator==(Element const &that) const override | libsemigroups::ElementWithVectorData< u_int32_t, Bipartition > | inlinevirtual |
operator[](size_t pos) const | libsemigroups::ElementWithVectorData< u_int32_t, Bipartition > | inline |
rank() | libsemigroups::Bipartition | |
really_copy(size_t increase_deg_by=0) const override | libsemigroups::ElementWithVectorData< u_int32_t, Bipartition > | inlinevirtual |
really_delete() override | libsemigroups::ElementWithVectorData< u_int32_t, Bipartition > | inlinevirtual |
redefine(Element const *x, Element const *y, size_t const &thread_id) override | libsemigroups::Bipartition | virtual |
ElementWithVectorDataDefaultHash< u_int32_t, Bipartition >::redefine(Element const *x, Element const *y) | libsemigroups::Element | inlinevirtual |
reset_hash_value() const | libsemigroups::Element | inlineprotected |
right_blocks() | libsemigroups::Bipartition | |
RWSE enum value | libsemigroups::Element | |
set_nr_blocks(size_t nr_blocks) | libsemigroups::Bipartition | inline |
set_nr_left_blocks(size_t nr_left_blocks) | libsemigroups::Bipartition | inline |
set_rank(size_t rank) | libsemigroups::Bipartition | inline |
swap(Element *x) override | libsemigroups::ElementWithVectorData< u_int32_t, Bipartition > | inlinevirtual |
vector_hash(std::vector< T > const *vec) | libsemigroups::ElementWithVectorData< u_int32_t, Bipartition > | inlineprotectedstatic |
~Element() | libsemigroups::Element | inlinevirtual |
- libsemigroups
-
- |
-
Class for bipartitions. - More...
- -#include <elements.h>
-Public Member Functions | |
Bipartition (size_t degree) | |
A constructor. More... | |
Bipartition (std::vector< u_int32_t > *blocks) | |
A constructor. More... | |
Bipartition (std::vector< u_int32_t > const &blocks) | |
A constructor. More... | |
size_t | complexity () const override |
Returns the approximate time complexity of multiplication. More... | |
u_int32_t | const_nr_blocks () const |
Returns the number of blocks in a bipartition. More... | |
size_t | degree () const override |
Returns the degree of the bipartition. More... | |
Element * | identity () const override |
Returns an identity bipartition. More... | |
bool | is_transverse_block (size_t index) |
Returns true if the block with index index is transverse. More... | |
Blocks * | left_blocks () |
Return the left blocks of a bipartition. More... | |
u_int32_t | nr_blocks () |
Returns the number of blocks in a bipartition. More... | |
u_int32_t | nr_left_blocks () |
Returns the number of blocks containing a positive integer. More... | |
u_int32_t | nr_right_blocks () |
Returns the number of blocks containing a negative integer. More... | |
size_t | rank () |
Returns the number of transverse blocks. 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... | |
Blocks * | right_blocks () |
Return the left blocks of a bipartition. More... | |
void | set_nr_blocks (size_t nr_blocks) |
Set the cached number of blocks. More... | |
void | set_nr_left_blocks (size_t nr_left_blocks) |
Set the cached number of left blocks. More... | |
void | set_rank (size_t rank) |
Set the cached rank. More... | |
Public Member Functions inherited from libsemigroups::ElementWithVectorData< u_int32_t, Bipartition > | |
ElementWithVectorData () | |
A constructor. More... | |
ElementWithVectorData (std::vector< u_int32_t > *vector) | |
A constructor. More... | |
ElementWithVectorData (std::vector< u_int32_t > const &vector) | |
A constructor. More... | |
u_int32_t | at (size_t pos) const |
Returns the pos entry in the vector containing the defining data. More... | |
std::vector< u_int32_t >::iterator | begin () const |
Returns an iterator. More... | |
std::vector< u_int32_t >::iterator | cbegin () const |
Returns a const iterator. More... | |
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< 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... | |
u_int32_t | operator[] (size_t pos) const |
Returns the pos entry in the vector containing the defining data. More... | |
Element * | really_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... | |
-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::ElementWithVectorDataDefaultHash< u_int32_t, Bipartition > | |
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< u_int32_t, Bipartition > | |
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< u_int32_t, Bipartition > | |
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... | |
Class for bipartitions.
-A bipartition is a partition of the set \(\{0, ..., 2n - 1\}\) for some integer \(n\); see the Semigroups package for GAP documentation for more details. The Bipartition class is more complex (i.e. has more methods) than strictly required by the algorithms for a Semigroup object because the extra methods are used in the GAP package Semigroups package for GAP.
-
-
|
- -inlineexplicit | -
A constructor.
-Constructs a uninitialised bipartition of degree degree
.
-
|
- -inlineexplicit | -
A constructor.
-The parameter blocks
must have length 2n for some positive integer n, consist of non-negative integers, and have the property that if i, i > 0, occurs in blocks
, then i - 1 occurs earlier in blocks. None of this is checked.
The parameter blocks
is not copied, and should be deleted using ElementWithVectorData::really_delete.
-
|
- -inlineexplicit | -
A constructor.
-The parameter blocks
must have length 2n for some positive integer n, consist of non-negative integers, and have the property that if i, i > 0, occurs in blocks
, then i - 1 occurs earlier in blocks. None of this is checked.
The parameter blocks
is not copied, and should be deleted using ElementWithVectorData::really_delete.
-
|
- -overridevirtual | -
Returns the approximate time complexity of multiplication.
-In the case of a Bipartition of degree n the value 2n ^ 2 is returned.
- -Implements libsemigroups::Element.
- -u_int32_t libsemigroups::Bipartition::const_nr_blocks | -( | -) | -const | -
Returns the number of blocks in a bipartition.
-This method differs for Bipartition::nr_blocks in that the number of blocks is not cached if it has not been previously computed.
- -
-
|
- -overridevirtual | -
Returns the degree of the bipartition.
-A bipartition is of degree n if it is a partition of \(\{0, \ldots, 2n - 1\}\).
- -Implements libsemigroups::Element.
- -
-
|
- -overridevirtual | -
Returns an identity bipartition.
-The identity bipartition of degree \(n\) has blocks \(\{i, -i\}\) for all \(i\in \{0, \ldots, n - 1\}\). This method returns a new identity bipartition of degree equal to the degree of this
.
Implements libsemigroups::Element.
- -bool libsemigroups::Bipartition::is_transverse_block | -( | -size_t | -index | ) | -- |
Returns true
if the block with index index
is transverse.
A block of a biparition is transverse if it contains integers less than and greater than \(n\), which is the degree of the bipartition. This method asserts that the parameter index
is less than the number of blocks in the bipartition.
Blocks * libsemigroups::Bipartition::left_blocks | -( | -) | -- |
Return the left blocks of a bipartition.
-The left blocks of a bipartition is the partition of \(\{0, \ldots, n - 1\}\) induced by the bipartition. This method returns a Blocks object representing this partition.
- -u_int32_t libsemigroups::Bipartition::nr_blocks | -( | -) | -- |
Returns the number of blocks in a bipartition.
-This value is cached the first time it is computed.
- -u_int32_t libsemigroups::Bipartition::nr_left_blocks | -( | -) | -- |
Returns the number of blocks containing a positive integer.
-The left blocks of a bipartition is the partition of \(\{0, \ldots, n - 1\}\) induced by the bipartition. This method returns the number of blocks in this partition.
- -u_int32_t libsemigroups::Bipartition::nr_right_blocks | -( | -) | -- |
Returns the number of blocks containing a negative integer.
-The right blocks of a bipartition is the partition of \(\{n, \ldots, 2n - 1\}\) induced by the bipartition. This method returns the number of blocks in this partition.
- -size_t libsemigroups::Bipartition::rank | -( | -) | -- |
Returns the number of transverse blocks.
-The rank of a bipartition is the number of blocks containing both positive and negative values. This value is cached after it is first computed.
- -
-
|
- -overridevirtual | -
Multiply x
and y
and stores the result in this
.
This method redefines this
to be the product (as defined at the top of this page) 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.
- -Blocks * libsemigroups::Bipartition::right_blocks | -( | -) | -- |
Return the left blocks of a bipartition.
-The right blocks of a bipartition is the partition of \(\{n, \ldots, 2n - 1\}\) induced by the bipartition. This method returns a Blocks object representing this partition.
- -
-
|
- -inline | -
Set the cached number of blocks.
-This method sets the cached value of the number of blocks of this
to nr_blocks
. It asserts that either there is no existing cached value or nr_blocks
equals the existing cached value.
-
|
- -inline | -
Set the cached number of left blocks.
-This method sets the cached value of the number of left blocks of this
to nr_left_blocks
. It asserts that either there is no existing cached value or nr_left_blocks
equals the existing cached value.
-
|
- -inline | -
Set the cached rank.
-This method sets the cached value of the rank of this
to rank
. It asserts that either there is no existing cached value or rank
equals the existing cached value.
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::Blocks, including all inherited members.
-block(size_t pos) const | libsemigroups::Blocks | inline |
Blocks() | libsemigroups::Blocks | inline |
Blocks(std::vector< u_int32_t > *blocks, std::vector< bool > *lookup) | libsemigroups::Blocks | inline |
Blocks(std::vector< u_int32_t > *blocks, std::vector< bool > *lookup, u_int32_t nr_blocks) | libsemigroups::Blocks | inline |
Blocks(Blocks const ©) | libsemigroups::Blocks | |
cbegin() const | libsemigroups::Blocks | inline |
cend() const | libsemigroups::Blocks | inline |
degree() const | libsemigroups::Blocks | inline |
hash_value() const | libsemigroups::Blocks | |
is_transverse_block(size_t index) const | libsemigroups::Blocks | inline |
lookup() const | libsemigroups::Blocks | inline |
nr_blocks() const | libsemigroups::Blocks | inline |
operator<(const Blocks &that) const | libsemigroups::Blocks | |
operator=(Blocks const ©)=delete | libsemigroups::Blocks | |
operator==(const Blocks &that) const | libsemigroups::Blocks | |
rank() | libsemigroups::Blocks | |
~Blocks() | libsemigroups::Blocks | inline |
- libsemigroups
-
- |
-
Class for signed partitions of the set \(\{0, \ldots, n - 1\}\). - More...
- -#include <blocks.h>
-Public Member Functions | |
Blocks () | |
A constructor. More... | |
Blocks (std::vector< u_int32_t > *blocks, std::vector< bool > *lookup) | |
A constructor. More... | |
Blocks (std::vector< u_int32_t > *blocks, std::vector< bool > *lookup, u_int32_t nr_blocks) | |
A constructor. More... | |
Blocks (Blocks const ©) | |
Copy constructor. More... | |
~Blocks () | |
Default destructor. More... | |
u_int32_t | block (size_t pos) const |
Returns the index of the block containing pos. More... | |
std::vector< u_int32_t >::const_iterator | cbegin () const |
Returns a const_iterator pointing to the index of the first block. More... | |
std::vector< u_int32_t >::const_iterator | cend () const |
Returns a const_iterator referring to past-the-end of the last block. More... | |
u_int32_t | degree () const |
Returns the degree of a Blocks object. More... | |
size_t | hash_value () const |
Returns a hash value for a this . More... | |
bool | is_transverse_block (size_t index) const |
Returns true if the block with index index is transverse. More... | |
std::vector< bool > const * | lookup () const |
Returns a pointer to the lookup table for block indices. More... | |
u_int32_t | nr_blocks () const |
Returns the number of blocks in the Blocks object. More... | |
bool | operator< (const Blocks &that) const |
Returns true if this is less than that . More... | |
Blocks & | operator= (Blocks const ©)=delete |
The assignment operator is deleted for Blocks to avoid unintended copying. More... | |
bool | operator== (const Blocks &that) const |
Returns true if this equals that . More... | |
u_int32_t | rank () |
Returns the number of signed (transverse) blocks in this . More... | |
Class for signed partitions of the set \(\{0, \ldots, n - 1\}\).
-It is possible to associate to every Bipartition a pair of blocks, Bipartition::left_blocks and Bipartition::right_blocks, which determine the Green's \(\mathscr{L}\)- and \(\mathscr{R}\)-classes of the Bipartition in the monoid of all bipartitions. This is the purpose of this class.
-The Blocks class is not currently used by any of the methods for the Semigroup class but the extra methods are used in the GAP package Semigroups package for GAP.
-
-
|
- -inline | -
A constructor.
-Constructs a blocks object of size 0.
- -
-
|
- -inline | -
A constructor.
-The parameter blocks
must be non-empty, consist of non-negative integers, and have the property that if some positive \(i\) occurs in blocks
, then \(i - 1\) occurs earlier in blocks
. None of this is checked. The parameter blocks
is not copied, and is deleted by the destructor Blocks::~Blocks.
The parameter lookup
must have length equal to the number of different values in blocks
(or one more than the maximum value in the list); this is equal to the number of blocks in the partition. A value true
in position \(i\) indicates that the \(i\)th block is signed (transverse) and false
that it is unsigned.
-
|
- -inline | -
A constructor.
-The parameter blocks
must have length \(n\) for some integer \(n > 0\), consist of non-negative integers, and have the property that if \(i\), \(i > 0\) occurs in blocks
, then \(i - 1\) occurs earlier in blocks
. None of this is checked. The parameter blocks
is not copied, and is deleted by the destructor Blocks::~Blocks.
The parameter lookup
must have length equal to the number of different values in blocks
(or one more than the maximum value in the list); this is equal to the number of blocks in the partition. A value true
in position \(i\) indicates that the \(i\)th block is signed (transverse) and false
that it is unsigned.
The parameter nr_blocks
must be the number of blocks (i.e. one more than the maximum value in blocks
).
This constructor is provided for the situation where the number of blocks in blocks is known a priori and so does not need to be calculated in the constructor.
- -libsemigroups::Blocks::Blocks | -( | -Blocks const & | -copy | ) | -- |
Copy constructor.
-Copies all the information in copy and returns a new instance of Blocks.
- -
-
|
- -inline | -
Default destructor.
-Deletes the blocks and lookup provided at construction time.
- -
-
|
- -inline | -
Returns the index of the block containing pos.
-This method asserts that pos
is valid, i.e. that it is less than the degree of this
.
-
|
- -inline | -
Returns a const_iterator pointing to the index of the first block.
-This method asserts that degree is not 0.
- -
-
|
- -inline | -
Returns a const_iterator referring to past-the-end of the last block.
-This method asserts that degree is not 0.
- -
-
|
- -inline | -
size_t libsemigroups::Blocks::hash_value | -( | -) | -const | -
Returns a hash value for a this
.
This method returns a hash value for an instance of Blocks. This value is recomputed every time this method is called.
- -
-
|
- -inline | -
Returns true
if the block with index index
is transverse.
This method returns true
if the block with index index
is a transverse (or signed) block and it returns false
if it is not transverse (or unsigned). This method asserts that the parameter index
is valid, i.e. that it is less than the degree of this
.
-
|
- -inline | -
Returns a pointer to the lookup table for block indices.
-The vector pointed to by the return value of this method has value true
in position i
if the i
th block of this
is a transverse block; the entry in position i
is false
otherwise.
-
|
- -inline | -
Returns the number of blocks in the Blocks object.
-This method returns the number of parts in the partition that instances of this class represent.
- -bool libsemigroups::Blocks::operator< | -( | -const Blocks & | -that | ) | -const | -
Returns true
if this
is less than that
.
This operator defines a total order on the set of all Blocks objects (including those of different degree).
- -
-
|
- -delete | -
The assignment operator is deleted for Blocks to avoid unintended copying.
- -bool libsemigroups::Blocks::operator== | -( | -const Blocks & | -that | ) | -const | -
Returns true
if this
equals that
.
Two Blocks objects are equal if and only if their underlying signed partitions are equal. It is ok to compare blocks of different degree with this operator.
- -u_int32_t libsemigroups::Blocks::rank | -( | -) | -- |
Returns the number of signed (transverse) blocks in this
.
Equivalently, this method returns the number of true
values in Blocks::lookup().
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::BooleanMat, including all inherited members.
-_vector | libsemigroups::ElementWithVectorData< bool, BooleanMat > | protected |
at(size_t pos) const | libsemigroups::ElementWithVectorData< bool, BooleanMat > | inline |
begin() const | libsemigroups::ElementWithVectorData< bool, BooleanMat > | inline |
BooleanMat(std::vector< bool > *matrix) | libsemigroups::BooleanMat | inlineexplicit |
BooleanMat(std::vector< std::vector< bool >> const &matrix) | libsemigroups::BooleanMat | inlineexplicit |
cache_hash_value() const override | libsemigroups::ElementWithVectorDataDefaultHash< bool, BooleanMat > | inlineprotectedvirtual |
cbegin() const | libsemigroups::ElementWithVectorData< bool, BooleanMat > | inline |
cend() const | libsemigroups::ElementWithVectorData< bool, BooleanMat > | inline |
complexity() const override | libsemigroups::MatrixOverSemiringBase< bool, BooleanMat > | inlinevirtual |
copy(Element const *x) override | libsemigroups::ElementWithVectorData< bool, BooleanMat > | inlinevirtual |
degree() const override | libsemigroups::MatrixOverSemiringBase< bool, BooleanMat > | inlinevirtual |
Element(elm_t type=Element::elm_t::NOT_RWSE) | libsemigroups::Element | inlineexplicit |
ElementWithVectorData() | libsemigroups::ElementWithVectorData< bool, BooleanMat > | inline |
ElementWithVectorData(std::vector< bool > *vector) | libsemigroups::ElementWithVectorData< bool, BooleanMat > | inlineexplicit |
ElementWithVectorData(std::vector< bool > const &vector) | libsemigroups::ElementWithVectorData< bool, BooleanMat > | inlineexplicit |
elm_t enum name | libsemigroups::Element | |
end() const | libsemigroups::ElementWithVectorData< bool, BooleanMat > | inline |
get_type() const | libsemigroups::Element | inline |
hash_value() const | libsemigroups::Element | inline |
identity() const override | libsemigroups::MatrixOverSemiringBase< bool, BooleanMat > | inlinevirtual |
MatrixOverSemiringBase(std::vector< bool > *matrix, Semiring< bool > const *semiring) | libsemigroups::MatrixOverSemiringBase< bool, BooleanMat > | inline |
MatrixOverSemiringBase(std::vector< std::vector< bool >> const &matrix, Semiring< bool > const *semiring) | libsemigroups::MatrixOverSemiringBase< bool, BooleanMat > | inline |
MatrixOverSemiringBase(std::vector< bool > *matrix) | libsemigroups::MatrixOverSemiringBase< bool, BooleanMat > | inlineexplicitprotected |
MatrixOverSemiringBase< bool, BooleanMat > (defined in libsemigroups::BooleanMat) | libsemigroups::BooleanMat | friend |
NOT_RWSE enum value | libsemigroups::Element | |
operator<(Element const &that) const override | libsemigroups::ElementWithVectorData< bool, BooleanMat > | inlinevirtual |
operator==(Element const &that) const override | libsemigroups::ElementWithVectorData< bool, BooleanMat > | inlinevirtual |
operator[](size_t pos) const | libsemigroups::ElementWithVectorData< bool, BooleanMat > | inline |
really_copy(size_t increase_deg_by=0) const override | libsemigroups::MatrixOverSemiringBase< bool, BooleanMat > | inlinevirtual |
really_delete() override | libsemigroups::ElementWithVectorData< bool, BooleanMat > | inlinevirtual |
redefine(Element const *x, Element const *y) final | libsemigroups::BooleanMat | virtual |
ElementWithVectorDataDefaultHash< bool, BooleanMat >::redefine(Element const *x, Element const *y, size_t const &thread_id) | libsemigroups::Element | inlinevirtual |
reset_hash_value() const | libsemigroups::Element | inlineprotected |
RWSE enum value | libsemigroups::Element | |
semiring() const | libsemigroups::MatrixOverSemiringBase< bool, BooleanMat > | inline |
swap(Element *x) override | libsemigroups::ElementWithVectorData< bool, BooleanMat > | inlinevirtual |
UNDEFINED | libsemigroups::Element | protectedstatic |
vector_hash(std::vector< T > const *vec) | libsemigroups::ElementWithVectorData< bool, BooleanMat > | inlineprotectedstatic |
~Element() | libsemigroups::Element | inlinevirtual |
- libsemigroups
-
- |
-
Matrices over the boolean semiring. - More...
- -#include <elements.h>
-Public Member Functions | |
BooleanMat (std::vector< bool > *matrix) | |
A constructor. More... | |
BooleanMat (std::vector< std::vector< bool >> const &matrix) | |
A constructor. More... | |
void | redefine (Element const *x, Element const *y) final |
Multiplies x and y and stores the result in this . More... | |
Public Member Functions inherited from libsemigroups::MatrixOverSemiringBase< bool, BooleanMat > | |
MatrixOverSemiringBase (std::vector< bool > *matrix, Semiring< bool > const *semiring) | |
A constructor. More... | |
MatrixOverSemiringBase (std::vector< std::vector< bool >> const &matrix, Semiring< bool > const *semiring) | |
A constructor. More... | |
size_t | complexity () const override |
Returns the approximate time complexity of multiplying two matrices. More... | |
size_t | degree () const override |
Returns the dimension of the matrix. More... | |
Element * | identity () const override |
Returns the identity matrix with dimension of this . More... | |
Element * | really_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... | |
Semiring< bool > const * | semiring () const |
Returns a pointer to the Semiring over which the matrix is defined. More... | |
Public Member Functions inherited from libsemigroups::ElementWithVectorData< bool, BooleanMat > | |
ElementWithVectorData () | |
A constructor. More... | |
ElementWithVectorData (std::vector< bool > *vector) | |
A constructor. More... | |
ElementWithVectorData (std::vector< bool > const &vector) | |
A constructor. More... | |
bool | at (size_t pos) const |
Returns the pos entry in the vector containing the defining data. More... | |
std::vector< bool >::iterator | begin () const |
Returns an iterator. More... | |
std::vector< bool >::iterator | cbegin () const |
Returns a const iterator. More... | |
std::vector< bool >::iterator | cend () const |
Returns a const iterator. More... | |
void | copy (Element const *x) override |
Copy another Element into this . More... | |
std::vector< bool >::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... | |
bool | operator[] (size_t pos) const |
Returns the pos entry in the vector containing the defining data. 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... | |
-Friends | |
-class | MatrixOverSemiringBase< bool, BooleanMat > |
-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::MatrixOverSemiringBase< bool, BooleanMat > | |
MatrixOverSemiringBase (std::vector< bool > *matrix) | |
Constructs a MatrixOverSemiringBase with whose underlying semiring is not defined. The underlying semiring must be set by any class deriving from this one. More... | |
Protected Member Functions inherited from libsemigroups::ElementWithVectorDataDefaultHash< bool, BooleanMat > | |
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< bool, BooleanMat > | |
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< bool, BooleanMat > | |
std::vector< bool > * | _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... | |
Matrices over the boolean semiring.
-A boolean matrix is a square matrix over the boolean semiring, under the usual multiplication of matrices.
-Every boolean matrix is defined over a single static copy of the boolean semiring.
-
-
|
- -inlineexplicit | -
A constructor.
-Constructs a boolean matrix defined by matrix
, matrix
is not copied, and should be deleted using ElementWithVectorData::really_delete.
The parameter matrix
should be a vector of boolean values of length \(n ^ 2\) for some integer \(n\), so that the value in position \(ni + j\) is the entry in row \(i\) and column \(j\) of the constructed matrix.
-
|
- -inlineexplicit | -
A constructor.
-Constructs a boolean matrix defined by matrix, which is copied into the constructed boolean matrix; see BooleanMat::BooleanMat for more details.
- -
-
|
- -finalvirtual | -
Multiplies x
and y
and stores the result in this
.
This method asserts that the dimensions of x
, y
, and this
, are all equal, and that neither x
nor y
equals this
.
Reimplemented from libsemigroups::Element.
- -
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::BooleanSemiring, including all inherited members.
-BooleanSemiring() (defined in libsemigroups::BooleanSemiring) | libsemigroups::BooleanSemiring | inline |
INFTY | libsemigroups::Semiring< bool > | static |
MINUS_INFTY | libsemigroups::Semiring< bool > | static |
one() const override | libsemigroups::BooleanSemiring | inlinevirtual |
plus(bool x, bool y) const override | libsemigroups::BooleanSemiring | inlinevirtual |
prod(bool x, bool y) const override | libsemigroups::BooleanSemiring | inlinevirtual |
UNDEFINED | libsemigroups::Semiring< bool > | static |
zero() const override | libsemigroups::BooleanSemiring | inlinevirtual |
~Semiring() | libsemigroups::Semiring< bool > | inlinevirtual |
- libsemigroups
-
- |
-
The usual Boolean semiring. - More...
- -#include <semiring.h>
-Public Member Functions | |
bool | one () const override |
Returns the integer 1. More... | |
bool | plus (bool x, bool y) const override |
Returns the sum \(x + y\). More... | |
bool | prod (bool x, bool y) const override |
Returns the product \(xy\). More... | |
bool | zero () const override |
Returns the integer 0. More... | |
Public Member Functions inherited from libsemigroups::Semiring< bool > | |
virtual | ~Semiring () |
A default destructor. More... | |
-Additional Inherited Members | |
Static Public Attributes inherited from libsemigroups::Semiring< bool > | |
static const bool | INFTY |
Value representing \(\infty\). More... | |
static const bool | MINUS_INFTY |
Value representing \(-\infty\). More... | |
static const bool | UNDEFINED |
Value representing an undefined quantity. More... | |
The usual Boolean semiring.
-
-
|
- -inlineoverridevirtual | -
Returns the integer 1.
- -Implements libsemigroups::Semiring< bool >.
- -
-
|
- -inlineoverridevirtual | -
Returns the sum \(x + y\).
- -Implements libsemigroups::Semiring< bool >.
- -
-
|
- -inlineoverridevirtual | -
Returns the product \(xy\).
- -Implements libsemigroups::Semiring< bool >.
- -
-
|
- -inlineoverridevirtual | -
Returns the integer 0.
- -Implements libsemigroups::Semiring< bool >.
- -
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::Congruence, including all inherited members.
-class_index_t typedef | libsemigroups::Congruence | |
Congruence(std::string type, size_t nrgens, std::vector< relation_t > const &relations, std::vector< relation_t > const &extra) | libsemigroups::Congruence | |
Congruence(std::string type, Semigroup *semigroup, std::vector< relation_t > const &genpairs) | libsemigroups::Congruence | |
extra() const | libsemigroups::Congruence | inline |
force_kbfp() | libsemigroups::Congruence | |
force_kbp() | libsemigroups::Congruence | |
force_p() | libsemigroups::Congruence | |
force_tc() | libsemigroups::Congruence | |
force_tc_prefill() | libsemigroups::Congruence | |
is_done() const | libsemigroups::Congruence | inline |
is_obviously_infinite() | libsemigroups::Congruence | |
nontrivial_classes() | libsemigroups::Congruence | |
nr_classes() | libsemigroups::Congruence | inline |
relations() | libsemigroups::Congruence | inline |
set_max_threads(size_t nr_threads) | libsemigroups::Congruence | inline |
set_pack(size_t val) | libsemigroups::Congruence | inline |
set_prefill(RecVec< class_index_t > const &table) | libsemigroups::Congruence | inline |
set_relations(std::vector< relation_t > const &relations) | libsemigroups::Congruence | inline |
set_report(bool val) const | libsemigroups::Congruence | inline |
set_report_interval(size_t val) | libsemigroups::Congruence | inline |
test_equals(word_t const &w1, word_t const &w2) | libsemigroups::Congruence | inline |
test_less_than(word_t const &w1, word_t const &w2) | libsemigroups::Congruence | inline |
word_to_class_index(word_t const &word) | libsemigroups::Congruence | inline |
~Congruence() | libsemigroups::Congruence | inline |
- libsemigroups
-
- |
-
Class for congruence on a semigroup or fintely presented semigroup. - More...
- -#include <cong.h>
-Public Types | |
typedef size_t | class_index_t |
Type for indices of congruence classes in a Congruence object. More... | |
-Public Member Functions | |
Congruence (std::string type, size_t nrgens, std::vector< relation_t > const &relations, std::vector< relation_t > const &extra) | |
Constructor for congruences over a finitely presented semigroup. More... | |
Congruence (std::string type, Semigroup *semigroup, std::vector< relation_t > const &genpairs) | |
Constructor for congruences over a Semigroup object. More... | |
~Congruence () | |
A default destructor. More... | |
std::vector< relation_t > const & | extra () const |
Returns the vector of extra relations (or equivalently, generating pairs) used to define the congruence. More... | |
void | force_kbfp () |
Use the Knuth-Bendix algorithm on a rewriting system RWS with rules obtained from Congruence::relations and Congruence::extra, followed by the Froidure-Pin algorithm on the resulting semigroup. More... | |
void | force_kbp () |
Use the Knuth-Bendix algorithm on a rewriting system RWS with rules obtained from Congruence::relations followed by an elementary orbit on pairs method on the resulting semigroup. More... | |
void | force_p () |
Use an elementary orbit algorithm which enumerates pairs of Element objects that are related in this . More... | |
void | force_tc () |
Use the Todd-Coxeter algorithm. More... | |
void | force_tc_prefill () |
Use the Todd-Coxeter algorithm after prefilling the table. More... | |
bool | is_done () const |
Returns true if the structure of the congruence is known. More... | |
bool | is_obviously_infinite () |
This method tries to quickly determine whether or not the Congruence has infinitely many classes. More... | |
Partition< word_t > * | nontrivial_classes () |
Returns the non-trivial classes of the congruence. More... | |
size_t | nr_classes () |
Returns the number of congruences classes of this . More... | |
std::vector< relation_t > const & | relations () |
Returns the vector of relations used to define the semigroup over which the congruence is defined. More... | |
void | set_max_threads (size_t nr_threads) |
Set the maximum number of threads for a Congruence over a Semigroup. More... | |
void | set_pack (size_t val) |
Set the maximum number of active cosets in Todd-Coxeter before entering packing phase. More... | |
void | set_prefill (RecVec< class_index_t > const &table) |
Specify a partial coset table for the Todd-Coxeter algorithm. More... | |
void | set_relations (std::vector< relation_t > const &relations) |
Define the relations defining the semigroup over which this is defined. More... | |
void | set_report (bool val) const |
Turn reporting on or off. More... | |
void | set_report_interval (size_t val) |
Sets how often the core methods of Congruence report. More... | |
bool | test_equals (word_t const &w1, word_t const &w2) |
Returns true if the words w1 and w2 belong to the same congruence class. More... | |
bool | test_less_than (word_t const &w1, word_t const &w2) |
Returns true if the congruence class of w1 is less than that of w2 . More... | |
class_index_t | word_to_class_index (word_t const &word) |
Returns the index of the congruence class corresponding to word . More... | |
Class for congruence on a semigroup or fintely presented semigroup.
-This class represents a congruence on a semigroup defined either as an instance of a Semigroup object or as a finitely presented semigroup defined by generators and relations.
-The structure of a Congruence is determined by running several different methods concurrently until one method returns an answer. The number of different threads used can be controlled, in part, by the value passed to Congruence::set_max_threads. The use of multiple threads to find the structure of a Congruence can cause the return values of certain methods to differ for different instances of mathematically equal objects.
-This class and its implemented methods are somewhat rudimentary in the current version of libsemigroups.
-typedef size_t libsemigroups::Congruence::class_index_t | -
Type for indices of congruence classes in a Congruence object.
- -libsemigroups::Congruence::Congruence | -( | -std::string | -type, | -
- | - | size_t | -nrgens, | -
- | - | std::vector< relation_t > const & | -relations, | -
- | - | std::vector< relation_t > const & | -extra | -
- | ) | -- |
Constructor for congruences over a finitely presented semigroup.
-The parameters are as follows:
-type:
a std::string describing the type of congruence, must be one of "left"
, "right"
, or "twosided"
.nrgens:
the number of generators.relations:
the defining relations of the semigroup over which the congruence being constructed is defined. Every relation_t in this parameter must consist of positive integers less than nrgens
.extra:
additional relations corresponding to the generating pairs of the congruence being constructed. Every relation_t in this parameter must consist of positive integers less than nrgens
.This constructor returns an instance of a Congruence object whose type is described by the string type
. The congruence is defined over the semigroup defined by nrgens
generators and the relations relations
and is the least congruence containing the generating pairs in extra
.
For example, to compute a congruence over the free semigroup the parameter relations
should be empty, and the relations defining the congruence to be constructed should be passed as the parameter extra
. To compute a congruence over a finitely presented semigroup the relations defining the fintely presented semigroup must be passed as the parameter relations
and the relations defining the congruence to be constructed should be passed as the parameter extra
.
libsemigroups::Congruence::Congruence | -( | -std::string | -type, | -
- | - | Semigroup * | -semigroup, | -
- | - | std::vector< relation_t > const & | -genpairs | -
- | ) | -- |
Constructor for congruences over a Semigroup object.
-The parameters are as follows:
-type:
a std::string describing the type of congruence, must be one of "left"
, "right"
, or "twosided"
.semigroup:
a pointer to an instance of Semigroup. It is the responsibility of the caller to delete semigroup
.genpairs:
additional relations corresponding to the generating pairs of the congruence being constructed. Every relation_t in this parameter must consist of positive integers less than the number of generators of semigroup
(Semigroup::nrgens()).This constructor returns an instance of a Congruence object whose type is described by the string type
. The congruence is defined over the Semigroup semigroup
and is the least congruence containing the generating pairs in extra
.
-
|
- -inline | -
A default destructor.
-The caller is responsible for deleting the semigroup used to construct this
, if any.
-
|
- -inline | -
Returns the vector of extra relations (or equivalently, generating pairs) used to define the congruence.
- -void libsemigroups::Congruence::force_kbfp | -( | -) | -- |
Use the Knuth-Bendix algorithm on a rewriting system RWS with rules obtained from Congruence::relations and Congruence::extra, followed by the Froidure-Pin algorithm on the resulting semigroup.
-This method forces the use of the Knuth-Bendix algorithm to compute the congruence defined by the generators, Congruence::relations, and Congruence::extra of this
followed by the Froidure-Pin algorithm on the resulting semigroup. The resulting semigroup consists of RWSE's and is enumerated using Semigroup::enumerate.
At present the Knuth-Bendix algorithm can only be applied to two-sided congruences, and this method asserts that this
is a two-sided congruence.
this
may also be affected.void libsemigroups::Congruence::force_kbp | -( | -) | -- |
Use the Knuth-Bendix algorithm on a rewriting system RWS with rules obtained from Congruence::relations followed by an elementary orbit on pairs method on the resulting semigroup.
-This method forces the use of the Knuth-Bendix algorithm to compute the congruence defined by the generators and relations of this
followed by an elementary orbit algorithm which enumerates pairs of Element objects of that semigroup which are related in this
. Knuth-Bendix is applied to a rewriting system obtained from Congruence::relations.
This method only applies to a congruence over a finitely presented semigroups, and does not apply to a congruence defined using a concrete Semigroup object.
-Note that this algorithm can be applied to left, right, and two-sided congruences (unlike KBFP).
-this
may also be affected.this
. The worst case space complexity of these algorithms is the square of the size of the semigroup over which this
is defined. void libsemigroups::Congruence::force_p | -( | -) | -- |
Use an elementary orbit algorithm which enumerates pairs of Element objects that are related in this
.
The method forced by this is unlikely to terminate, or to be faster than the other methods, unless there are a relatively few pairs of elements related by the congruence.
-This method only applies to a congruence created using a Semigroup object, and does not apply to finitely presented semigroups.
-this
may also be affected.this
is defined. void libsemigroups::Congruence::force_tc | -( | -) | -- |
Use the Todd-Coxeter algorithm.
-This methods forces the use of the Todd-Coxeter algorithm to compute the congruence. The implementation is based on one by Goetz Pfeiffer in GAP.
-this
may also be affected.void libsemigroups::Congruence::force_tc_prefill | -( | -) | -- |
Use the Todd-Coxeter algorithm after prefilling the table.
-This methods forces the use of the Todd-Coxeter algorithm to compute the congruence.
-When applied to a congruence defined over a Semigroup, this method differs from Congruence::force_tc in that the so-called coset table used in the Todd-Coxeter algorithm is initialised to contain the right (or left) Cayley graph of the semigroup over which this
is defined.
If this
is not defined over a Semigroup (i.e. it is defined over a finitely presented semigroup), then this method does the same as force_tc.
this
may also be affected.
-
|
- -inline | -
Returns true
if the structure of the congruence is known.
bool libsemigroups::Congruence::is_obviously_infinite | -( | -) | -- |
This method tries to quickly determine whether or not the Congruence has infinitely many classes.
-If true
is returned, then there are infinitely many classes in the congruence, but if false
is returned, then the method could not determine whether or not there are infinitely many classes.
Returns the non-trivial classes of the congruence.
-The elements in these classes are represented as words in the generators of the semigroup over which the congruence is defined.
-this
has infinitely many non-trivial congruence classes, then this method will only terminate when it can no longer allocate memory.
-
|
- -inline | -
Returns the number of congruences classes of this
.
This method is non-const because it may fully compute a data structure for the congruence.
-
-
|
- -inline | -
Returns the vector of relations used to define the semigroup over which the congruence is defined.
-This method is non-const since if the congruence is defined over a Semigroup object, then we may have to compute and store its relations.
- -
-
|
- -inline | -
Set the maximum number of threads for a Congruence over a Semigroup.
-This method sets the maximum number of threads to be used by any method of a Congruence object which is defined over a Semigroup. The number of threads is limited to the maximum of 1 and the minimum of nr_threads
and the number of threads supported by the hardware.
If the congruence is not defined over a Semigroup, then the number of threads is not limited by this method.
- -
-
|
- -inline | -
Set the maximum number of active cosets in Todd-Coxeter before entering packing phase.
-This method only has any effect if used after Congruence::force_tc.
- -
-
|
- -inline | -
Specify a partial coset table for the Todd-Coxeter algorithm.
-The parameter table
should be a partial coset table for use in the Todd-Coxeter algorithm:
table
should have RecVec::nr_cols equal to the number of generators of the semigroup over which this
is definedtable
must be less than the number of rows in table
.For example, table
can represent the right Cayley graph of a finite semigroup.
If this method is called after anything has been computed about the congruence, it has no effect.
- -
-
|
- -inline | -
Define the relations defining the semigroup over which this
is defined.
This method allows the relations of the semigroup over which the congruence is defined to be specified. This method asserts that the relations have not previously been specified.
- -
-
|
- -inline | -
Turn reporting on or off.
-If val
is true, then some methods for a Congruence object may report information about the progress of the computation.
-
|
- -inline | -
Sets how often the core methods of Congruence report.
-The smaller this value, the more often information will be reported.
- -
-
|
- -inline | -
Returns true
if the words w1
and w2
belong to the same congruence class.
The parameters w1
and w2
must be libsemigroups::word_t's consisting of indices of generators of the semigroup over which this
is defined.
-
|
- -inline | -
Returns true
if the congruence class of w1
is less than that of w2
.
This method returns true
if the congruence class of w1
is less than the class of w2
in a total ordering of congruence classes.
The parameters w1
and w2
should be libsemigroups::word_t's consisting of indices of the generators of the semigroup over which this
is defined.
-
|
- -inline | -
Returns the index of the congruence class corresponding to word
.
The parameter word
must be a libsemigroups::word_t consisting of indices of the generators of the semigroup over which this
is defined.
If this
is defined over a semigroup with generators \(A\), then Congruence::word_to_class_index defines a surjective function from the set of all words over \(A\) to either \(\{0, 1, \ldots, n - 1\}\), where \(n\) is the number of classes, or to the non-negative integers \(\{0, 1, \ldots\}\) if this
has infinitely many classes.
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::Element, including all inherited members.
-cache_hash_value() const =0 | libsemigroups::Element | protectedpure virtual |
complexity() const =0 | libsemigroups::Element | pure virtual |
copy(Element const *x)=0 | libsemigroups::Element | pure virtual |
degree() const =0 | libsemigroups::Element | pure virtual |
Element(elm_t type=Element::elm_t::NOT_RWSE) | libsemigroups::Element | inlineexplicit |
elm_t enum name | libsemigroups::Element | |
get_type() const | libsemigroups::Element | inline |
hash_value() const | libsemigroups::Element | inline |
identity() const =0 | libsemigroups::Element | pure virtual |
NOT_RWSE enum value | libsemigroups::Element | |
operator<(const Element &that) const =0 | libsemigroups::Element | pure virtual |
operator==(const Element &that) const =0 | libsemigroups::Element | pure virtual |
really_copy(size_t increase_deg_by=0) const =0 | libsemigroups::Element | pure virtual |
really_delete()=0 | libsemigroups::Element | pure virtual |
redefine(Element const *x, Element const *y) | libsemigroups::Element | inlinevirtual |
redefine(Element const *x, Element const *y, size_t const &thread_id) | libsemigroups::Element | inlinevirtual |
reset_hash_value() const | libsemigroups::Element | inlineprotected |
RWSE enum value | libsemigroups::Element | |
swap(Element *x)=0 | libsemigroups::Element | pure virtual |
UNDEFINED | libsemigroups::Element | protectedstatic |
~Element() | libsemigroups::Element | inlinevirtual |
- libsemigroups
-
- |
-
Abstract base class for semigroup elements. - More...
- -#include <elements.h>
-Classes | |
struct | Equal |
Provides a call operator for comparing Elements via pointers. More... | |
struct | Hash |
Provides a call operator returning a hash value for an Element via a pointer. More... | |
-Public Types | |
enum | elm_t { RWSE = 0, -NOT_RWSE = 1 - } |
This enum contains some different types of Element. More... | |
-Public Member Functions | |
Element (elm_t type=Element::elm_t::NOT_RWSE) | |
A constructor. More... | |
virtual | ~Element () |
A default destructor. More... | |
virtual size_t | complexity () const =0 |
Returns the approximate time complexity of multiplying two Element objects in a given subclass. More... | |
virtual void | copy (Element const *x)=0 |
Copy another Element into this . More... | |
virtual size_t | degree () const =0 |
Returns the degree of an Element. 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 Element * | identity () const =0 |
Returns a new copy of the identity element. More... | |
virtual bool | operator< (const Element &that) const =0 |
Returns true if this is less than that . More... | |
virtual bool | operator== (const Element &that) const =0 |
Returns true if this equals that . More... | |
virtual Element * | really_copy (size_t increase_deg_by=0) const =0 |
Returns a new element completely independent of this . More... | |
virtual void | really_delete ()=0 |
Deletes the defining data of an Element. More... | |
virtual void | redefine (Element const *x, Element const *y) |
Multiplies x and y and stores the result in this . 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... | |
virtual void | swap (Element *x)=0 |
Swap another Element with this . More... | |
-Protected Member Functions | |
virtual void | cache_hash_value () const =0 |
Calculate and cache a hash value. More... | |
void | reset_hash_value () const |
Reset the cached value used by Element::hash_value. More... | |
-Static Protected Attributes | |
static size_t const | UNDEFINED = std::numeric_limits<size_t>::max() |
UNDEFINED value. More... | |
Abstract base class for semigroup elements.
-The Semigroup class consists of Element objects. Every derived class of Element implements the deleted methods of Element, which are used by the Semigroup class.
-enum libsemigroups::Element::elm_t | -
This enum contains some different types of Element.
-This exists so that the type of a subclass of Element can be determined from a pointer to the base class. Currently, it is only necessary to distiguish RWSE objects from other Element objects and so there are only two values.
-Enumerator | |
---|---|
RWSE | Type for Element objects arising from a rewriting system RWS. - |
NOT_RWSE | Type for Element objects not arising from a rewriting system RWS. - |
-
|
- -inlineexplicit | -
A constructor.
-The parameter type
should be the type elm_t of the element being created (defaults to libsemigroups::Element::NOT_RWSE).
-
|
- -inlinevirtual | -
A default destructor.
-This does not properly delete the underlying data of the object, this should be done using Element::really_delete.
- -
-
|
- -protectedpure virtual | -
Calculate and cache a hash value.
-This method is used to compute and cache the hash value of this
.
Implemented in libsemigroups::PBR, libsemigroups::Transformation< T >, libsemigroups::ElementWithVectorDataDefaultHash< TValueType, TSubclass >, libsemigroups::ElementWithVectorDataDefaultHash< bool, BooleanMat >, libsemigroups::ElementWithVectorDataDefaultHash< T, Transformation< T > >, libsemigroups::ElementWithVectorDataDefaultHash< u_int32_t, Bipartition >, libsemigroups::ElementWithVectorDataDefaultHash< TValueType, MatrixOverSemiring< TValueType > >, libsemigroups::ElementWithVectorDataDefaultHash< int64_t, ProjectiveMaxPlusMatrix >, libsemigroups::ElementWithVectorDataDefaultHash< T, PartialPerm< T > >, and libsemigroups::RWSE.
- -
-
|
- -pure virtual | -
Returns the approximate time complexity of multiplying two Element objects in a given subclass.
-This method returns an integer which represents the approximate time complexity of multiplying two objects in the same subclass of Element which have the same Element::degree. For example, the approximate time complexity of multiplying two \(3\times 3\) matrices over a common semiring is \(O(3 ^ 3)\), and 27 is returned by MatrixOverSemiring::complexity.
-The returned value is used in, for example, Semigroup::fast_product and Semigroup::nridempotents to decide if it is better to multiply elements or follow a path in the Cayley graph.
- -Implemented in libsemigroups::PBR, libsemigroups::MatrixOverSemiringBase< TValueType, TSubclass >, libsemigroups::MatrixOverSemiringBase< bool, BooleanMat >, libsemigroups::MatrixOverSemiringBase< TValueType, MatrixOverSemiring< TValueType > >, libsemigroups::MatrixOverSemiringBase< int64_t, ProjectiveMaxPlusMatrix >, libsemigroups::Bipartition, libsemigroups::PartialTransformation< TValueType, TSubclass >, libsemigroups::PartialTransformation< T, Transformation< T > >, libsemigroups::PartialTransformation< T, PartialPerm< T > >, and libsemigroups::RWSE.
- -
-
|
- -pure virtual | -
Copy another Element into this
.
This method copies x
into this
by changing this
in-place.
Implemented in libsemigroups::ElementWithVectorData< TValueType, TSubclass >, libsemigroups::ElementWithVectorData< bool, BooleanMat >, libsemigroups::ElementWithVectorData< T, Transformation< T > >, libsemigroups::ElementWithVectorData< u_int32_t, Bipartition >, libsemigroups::ElementWithVectorData< TValueType, MatrixOverSemiring< TValueType > >, libsemigroups::ElementWithVectorData< int64_t, ProjectiveMaxPlusMatrix >, libsemigroups::ElementWithVectorData< T, PartialPerm< T > >, libsemigroups::ElementWithVectorData< std::vector< u_int32_t >, PBR >, and libsemigroups::RWSE.
- -
-
|
- -pure virtual | -
Returns the degree of an Element.
-This method returns an integer which represents the size of the element, and is used to determine whether or not two elements are compatible for multiplication. For example, two Transformation objects of different degrees cannot be multiplied, and a Bipartition of degree 10 cannot be an element of a monoid of bipartitions of degree 3.
-See the relevant subclass for the particular meaning of the return value of this method for each subclass.
- -Implemented in libsemigroups::PBR, libsemigroups::MatrixOverSemiringBase< TValueType, TSubclass >, libsemigroups::MatrixOverSemiringBase< bool, BooleanMat >, libsemigroups::MatrixOverSemiringBase< TValueType, MatrixOverSemiring< TValueType > >, libsemigroups::MatrixOverSemiringBase< int64_t, ProjectiveMaxPlusMatrix >, libsemigroups::Bipartition, libsemigroups::PartialTransformation< TValueType, TSubclass >, libsemigroups::PartialTransformation< T, Transformation< T > >, libsemigroups::PartialTransformation< T, PartialPerm< T > >, and libsemigroups::RWSE.
- -
-
|
- -inline | -
Returns the type libsemigroups::Element::elm_t of an Element object.
- -
-
|
- -inline | -
-
|
- -pure virtual | -
Returns a new copy of the identity element.
-This method returns the multiplicative identity element for an object in a subclass of Element. The returned identity belongs to the same subclass and has the same degree as this
.
Implemented in libsemigroups::PBR, libsemigroups::MatrixOverSemiringBase< TValueType, TSubclass >, libsemigroups::MatrixOverSemiringBase< bool, BooleanMat >, libsemigroups::MatrixOverSemiringBase< TValueType, MatrixOverSemiring< TValueType > >, libsemigroups::MatrixOverSemiringBase< int64_t, ProjectiveMaxPlusMatrix >, libsemigroups::Bipartition, libsemigroups::PartialTransformation< TValueType, TSubclass >, libsemigroups::PartialTransformation< T, Transformation< T > >, libsemigroups::PartialTransformation< T, PartialPerm< T > >, and libsemigroups::RWSE.
- -
-
|
- -pure virtual | -
Returns true
if this
is less than that
.
This method defines a total order on the set of objects in a given subclass of Element with a given Element::degree. The definition of this total order depends on the method for the operator < in the subclass.
- -Implemented in libsemigroups::PartialPerm< T >, libsemigroups::ElementWithVectorData< TValueType, TSubclass >, libsemigroups::ElementWithVectorData< bool, BooleanMat >, libsemigroups::ElementWithVectorData< T, Transformation< T > >, libsemigroups::ElementWithVectorData< u_int32_t, Bipartition >, libsemigroups::ElementWithVectorData< TValueType, MatrixOverSemiring< TValueType > >, libsemigroups::ElementWithVectorData< int64_t, ProjectiveMaxPlusMatrix >, libsemigroups::ElementWithVectorData< T, PartialPerm< T > >, libsemigroups::ElementWithVectorData< std::vector< u_int32_t >, PBR >, and libsemigroups::RWSE.
- -
-
|
- -pure virtual | -
Returns true
if this
equals that
.
This method checks the mathematical equality of two Element objects in the same subclass of Element.
- -Implemented in libsemigroups::ElementWithVectorData< TValueType, TSubclass >, libsemigroups::ElementWithVectorData< bool, BooleanMat >, libsemigroups::ElementWithVectorData< T, Transformation< T > >, libsemigroups::ElementWithVectorData< u_int32_t, Bipartition >, libsemigroups::ElementWithVectorData< TValueType, MatrixOverSemiring< TValueType > >, libsemigroups::ElementWithVectorData< int64_t, ProjectiveMaxPlusMatrix >, libsemigroups::ElementWithVectorData< T, PartialPerm< T > >, libsemigroups::ElementWithVectorData< std::vector< u_int32_t >, PBR >, and libsemigroups::RWSE.
- -
-
|
- -pure virtual | -
Returns a new element completely independent of this
.
If increase_deg_by
is non-zero, then the degree (the size of the container) of the defining data of this
will be increased by this amount.
This method really copies an Element. To minimise the amount of copying when Element objects are inserted in a std::unordered_map and other containers, an Element behaves somewhat like a pointer, in that the actual data in an Element is only copied when this method is called. Otherwise, if an Element is copied, then its defining data is only stored once.
-Implemented in libsemigroups::MatrixOverSemiringBase< TValueType, TSubclass >, libsemigroups::MatrixOverSemiringBase< bool, BooleanMat >, libsemigroups::MatrixOverSemiringBase< TValueType, MatrixOverSemiring< TValueType > >, libsemigroups::MatrixOverSemiringBase< int64_t, ProjectiveMaxPlusMatrix >, libsemigroups::PartialPerm< T >, libsemigroups::Transformation< T >, libsemigroups::ElementWithVectorData< TValueType, TSubclass >, libsemigroups::ElementWithVectorData< bool, BooleanMat >, libsemigroups::ElementWithVectorData< T, Transformation< T > >, libsemigroups::ElementWithVectorData< u_int32_t, Bipartition >, libsemigroups::ElementWithVectorData< TValueType, MatrixOverSemiring< TValueType > >, libsemigroups::ElementWithVectorData< int64_t, ProjectiveMaxPlusMatrix >, libsemigroups::ElementWithVectorData< T, PartialPerm< T > >, libsemigroups::ElementWithVectorData< std::vector< u_int32_t >, PBR >, and libsemigroups::RWSE.
- -
-
|
- -pure virtual | -
Deletes the defining data of an Element.
-This method really deletes an Element. To minimise the amount of copying when Elements are inserted in an std::unordered_map or other containers, an Element behaves somewhat like a pointer, in that the actual data in an Element is only deleted when this method is called. Otherwise, if an Element is deleted, then its defining data is not deleted, since it may be contained in several copies of the Element.
-Implemented in libsemigroups::ElementWithVectorData< TValueType, TSubclass >, libsemigroups::ElementWithVectorData< bool, BooleanMat >, libsemigroups::ElementWithVectorData< T, Transformation< T > >, libsemigroups::ElementWithVectorData< u_int32_t, Bipartition >, libsemigroups::ElementWithVectorData< TValueType, MatrixOverSemiring< TValueType > >, libsemigroups::ElementWithVectorData< int64_t, ProjectiveMaxPlusMatrix >, libsemigroups::ElementWithVectorData< T, PartialPerm< T > >, libsemigroups::ElementWithVectorData< std::vector< u_int32_t >, PBR >, and libsemigroups::RWSE.
- -
-
|
- -inlinevirtual | -
Multiplies x
and y
and stores the result in this
.
Redefine this
to be the product of x
and y
. This is in-place multiplication to avoid allocation of memory for products which do not need to be stored for future use.
The implementation of this method in the Element base class simply calls the 3 parameter version with third parameter 0. Any subclass of Element can implement either a two or three parameter version of this method and the base class method implements the other method.
- -Reimplemented in libsemigroups::BooleanMat, libsemigroups::MatrixOverSemiringBase< TValueType, TSubclass >, libsemigroups::MatrixOverSemiringBase< bool, BooleanMat >, libsemigroups::MatrixOverSemiringBase< TValueType, MatrixOverSemiring< TValueType > >, libsemigroups::MatrixOverSemiringBase< int64_t, ProjectiveMaxPlusMatrix >, libsemigroups::PartialPerm< T >, libsemigroups::Transformation< T >, and libsemigroups::RWSE.
- -
-
|
- -inlinevirtual | -
Multiplies x
and y
and stores the result in this
.
Redefine this
to be the product of x
and y
. This is in-place multiplication to avoid allocation of memory for products which do not need to be stored for future use.
The implementation of this method in the Element base class simply calls the 2 parameter version and ignores the third parameter thread_id
. Any subclass of Element can implement either a two or three parameter version of this method and the base class method implements the other method.
The parameter thread_id
is required in some derived classes of Element because some temporary storage is required to find the product of x
and y
.
Note that if different threads call this method on a derived class of Element where static temporary storage is used in the redefine method with the same value of thread_id
, then bad things may happen.
Reimplemented in libsemigroups::PBR, and libsemigroups::Bipartition.
- -
-
|
- -inlineprotected | -
Reset the cached value used by Element::hash_value.
-This method is used to reset the cached hash value to libsemigroups::Element::UNDEFINED. This is required after running Element::redefine, Element::copy, or any other method that changes the defining data of this
.
-
|
- -pure virtual | -
Swap another Element with this
.
This method swaps the defining data of x
and this
.
Implemented in libsemigroups::ElementWithVectorData< TValueType, TSubclass >, libsemigroups::ElementWithVectorData< bool, BooleanMat >, libsemigroups::ElementWithVectorData< T, Transformation< T > >, libsemigroups::ElementWithVectorData< u_int32_t, Bipartition >, libsemigroups::ElementWithVectorData< TValueType, MatrixOverSemiring< TValueType > >, libsemigroups::ElementWithVectorData< int64_t, ProjectiveMaxPlusMatrix >, libsemigroups::ElementWithVectorData< T, PartialPerm< T > >, libsemigroups::ElementWithVectorData< std::vector< u_int32_t >, PBR >, and libsemigroups::RWSE.
- -
-
|
- -staticprotected | -
UNDEFINED value.
-This variable is used to indicate that a value is undefined. For example, the cached hash value of an Element is initially set to this value.
- -
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::ElementWithVectorData< TValueType, TSubclass >, including all inherited members.
-_vector | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | protected |
at(size_t pos) const | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inline |
begin() const | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inline |
cache_hash_value() const =0 | libsemigroups::Element | protectedpure virtual |
cbegin() const | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inline |
cend() const | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inline |
complexity() const =0 | libsemigroups::Element | pure virtual |
copy(Element const *x) override | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlinevirtual |
degree() const =0 | libsemigroups::Element | pure virtual |
Element(elm_t type=Element::elm_t::NOT_RWSE) | libsemigroups::Element | inlineexplicit |
ElementWithVectorData() | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inline |
ElementWithVectorData(std::vector< TValueType > *vector) | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlineexplicit |
ElementWithVectorData(std::vector< TValueType > const &vector) | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlineexplicit |
elm_t enum name | libsemigroups::Element | |
end() const | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inline |
get_type() const | libsemigroups::Element | inline |
hash_value() const | libsemigroups::Element | inline |
identity() const =0 | libsemigroups::Element | pure virtual |
NOT_RWSE enum value | libsemigroups::Element | |
operator<(Element const &that) const override | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlinevirtual |
operator==(Element const &that) const override | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlinevirtual |
operator[](size_t pos) const | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inline |
really_copy(size_t increase_deg_by=0) const override | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlinevirtual |
really_delete() override | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlinevirtual |
redefine(Element const *x, Element const *y) | libsemigroups::Element | inlinevirtual |
redefine(Element const *x, Element const *y, size_t const &thread_id) | libsemigroups::Element | inlinevirtual |
reset_hash_value() const | libsemigroups::Element | inlineprotected |
RWSE enum value | libsemigroups::Element | |
swap(Element *x) override | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlinevirtual |
UNDEFINED | libsemigroups::Element | protectedstatic |
vector_hash(std::vector< T > const *vec) | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlineprotectedstatic |
~Element() | libsemigroups::Element | inlinevirtual |
- libsemigroups
-
- |
-
Abstract base class for elements using a vector to store their defining data. - More...
- -#include <elements.h>
-Public Member Functions | |
ElementWithVectorData () | |
A constructor. More... | |
ElementWithVectorData (std::vector< TValueType > *vector) | |
A constructor. More... | |
ElementWithVectorData (std::vector< TValueType > const &vector) | |
A constructor. More... | |
TValueType | at (size_t pos) const |
Returns the pos entry in the vector containing the defining data. More... | |
std::vector< TValueType >::iterator | begin () const |
Returns an iterator. More... | |
std::vector< TValueType >::iterator | cbegin () const |
Returns a const iterator. More... | |
std::vector< TValueType >::iterator | cend () const |
Returns a const iterator. More... | |
void | copy (Element const *x) override |
Copy another Element into this . More... | |
std::vector< TValueType >::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... | |
TValueType | operator[] (size_t pos) const |
Returns the pos entry in the vector containing the defining data. More... | |
Element * | really_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... | |
virtual size_t | complexity () const =0 |
Returns the approximate time complexity of multiplying two Element objects in a given subclass. More... | |
virtual size_t | degree () const =0 |
Returns the degree of an Element. 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 Element * | identity () const =0 |
Returns a new copy of the identity element. More... | |
virtual void | redefine (Element const *x, Element const *y) |
Multiplies x and y and stores the result in this . 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... | |
-Static Protected Member Functions | |
template<typename 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 | |
std::vector< TValueType > * | _vector |
The vector containing the defining data of 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 | |
virtual void | cache_hash_value () const =0 |
Calculate and cache a hash value. More... | |
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... | |
Abstract base class for elements using a vector to store their defining data.
-The template parameter TValueType
is the type entries in the vector containing the defining data.
The template parameter TSubclass
is the subclass of ElementWithVectorData used by certain methods to construct new instances of subclasses of ElementWithVectorData.
For example, Transformation<u_int128_t> is a subclass of ElementWithVectorData<u_int128_t, Transformation<u_int128_t>> so that when the identity method in this class is called it returns a Transformation and not an ElementWithVectorData.
-
-
|
- -inline | -
A constructor.
-Returns an object with an uninitialised vector.
- -
-
|
- -inlineexplicit | -
A constructor.
-The parameter vector
should be a pointer to defining data of the element.
Returns an object whose defining data is stored in vector
, which is not copied, and is deleted using Element::really_delete.
-
|
- -inlineexplicit | -
A constructor.
-The parameter vector
should be a const reference to defining data of the element.
Returns an object whose defining data is a copy of vector
.
-
|
- -inline | -
Returns the pos
entry in the vector containing the defining data.
This method returns the pos
entry in the vector used to construct this
.
-
|
- -inline | -
Returns an iterator.
-This method returns an iterator pointing at the first entry in the vector that is the underlying defining data of this
.
-
|
- -inline | -
Returns a const iterator.
-This method returns a const_iterator pointing at the first entry in the vector that is the underlying defining data of this
.
-
|
- -inline | -
Returns a const iterator.
-This method returns a const iterator referring to the past-the-end element of the vector that is the underlying defining data of this
.
-
|
- -inlineoverridevirtual | -
Copy another Element into this
.
This method copies x
into this
by changing this
in-place. This method asserts that the degrees of this
and x
are equal and then replaces the underlying vector of this
with the underlying vector of x
. Any method overriding this one must define _hash_value correctly or call Element::reset_hash_value on this
.
Implements libsemigroups::Element.
- -
-
|
- -inline | -
Returns an iterator.
-This method returns an iterator referring to the past-the-end element of the vector that is the underlying defining data of this
.
-
|
- -inlineoverridevirtual | -
Returns true
if this
is less than that
.
This method defines a total order on the set of objects in ElementWithVectorData of a given Element::degree, which is the short-lex order.
- -Implements libsemigroups::Element.
- -
-
|
- -inlineoverridevirtual | -
Returns true
if this
equals that
.
This method checks that the underlying vectors of this
and that
are equal.
Implements libsemigroups::Element.
- -
-
|
- -inline | -
Returns the pos
entry in the vector containing the defining data.
This method returns the pos
entry in the vector used to construct this
. No checks are performed that pos
in within the bounds of this vector.
-
|
- -inlineoverridevirtual | -
Returns a pointer to a copy of this
.
The size of the vector containing the defining data of this
will be increased by increase_deg_by
. If increase_deg_by
is not 0, then this method must be overridden by any subclass of ElementWithVectorData since there is no way of knowing how a subclass is defined by the data in the vector.
Implements libsemigroups::Element.
- -Reimplemented in libsemigroups::MatrixOverSemiringBase< TValueType, TSubclass >, libsemigroups::MatrixOverSemiringBase< bool, BooleanMat >, libsemigroups::MatrixOverSemiringBase< TValueType, MatrixOverSemiring< TValueType > >, and libsemigroups::MatrixOverSemiringBase< int64_t, ProjectiveMaxPlusMatrix >.
- -
-
|
- -inlineoverridevirtual | -
Deletes the defining data of an ElementWithVectorData.
- -Implements libsemigroups::Element.
- -
-
|
- -inlineoverridevirtual | -
Swap another Element with this
.
This method swaps the defining data of x
and this
. This method asserts that the degrees of this
and x
are equal and then swaps the underlying vector of this
with the underlying vector of x
. Any method overriding should swap the hash_value of this
and x
, or call Element::reset_hash_value on this
and x
.
Implements libsemigroups::Element.
- -
-
|
- -inlinestaticprotected | -
Returns a hash value for a vector provided there is a specialization of std::hash for the template type T
.
-
|
- -protected | -
The vector containing the defining data of this
.
The actual data defining of this
is stored in _vector.
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::ElementWithVectorDataDefaultHash< TValueType, TSubclass >, including all inherited members.
-_vector | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | protected |
at(size_t pos) const | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inline |
begin() const | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inline |
cache_hash_value() const override | libsemigroups::ElementWithVectorDataDefaultHash< TValueType, TSubclass > | inlineprotectedvirtual |
cbegin() const | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inline |
cend() const | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inline |
complexity() const =0 | libsemigroups::Element | pure virtual |
copy(Element const *x) override | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlinevirtual |
degree() const =0 | libsemigroups::Element | pure virtual |
Element(elm_t type=Element::elm_t::NOT_RWSE) | libsemigroups::Element | inlineexplicit |
ElementWithVectorData() | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inline |
ElementWithVectorData(std::vector< TValueType > *vector) | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlineexplicit |
ElementWithVectorData(std::vector< TValueType > const &vector) | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlineexplicit |
elm_t enum name | libsemigroups::Element | |
end() const | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inline |
get_type() const | libsemigroups::Element | inline |
hash_value() const | libsemigroups::Element | inline |
identity() const =0 | libsemigroups::Element | pure virtual |
NOT_RWSE enum value | libsemigroups::Element | |
operator<(Element const &that) const override | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlinevirtual |
operator==(Element const &that) const override | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlinevirtual |
operator[](size_t pos) const | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inline |
really_copy(size_t increase_deg_by=0) const override | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlinevirtual |
really_delete() override | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlinevirtual |
redefine(Element const *x, Element const *y) | libsemigroups::Element | inlinevirtual |
redefine(Element const *x, Element const *y, size_t const &thread_id) | libsemigroups::Element | inlinevirtual |
reset_hash_value() const | libsemigroups::Element | inlineprotected |
RWSE enum value | libsemigroups::Element | |
swap(Element *x) override | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlinevirtual |
UNDEFINED | libsemigroups::Element | protectedstatic |
vector_hash(std::vector< T > const *vec) | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlineprotectedstatic |
~Element() | libsemigroups::Element | inlinevirtual |
- libsemigroups
-
- |
-
Abstract base class for elements using a vector to store their defining data and the default hash function for that underlying vector. - More...
- -#include <elements.h>
-Protected Member Functions | |
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... | |
Public Member Functions inherited from libsemigroups::ElementWithVectorData< TValueType, TSubclass > | |
ElementWithVectorData () | |
A constructor. More... | |
ElementWithVectorData (std::vector< TValueType > *vector) | |
A constructor. More... | |
ElementWithVectorData (std::vector< TValueType > const &vector) | |
A constructor. More... | |
TValueType | at (size_t pos) const |
Returns the pos entry in the vector containing the defining data. More... | |
std::vector< TValueType >::iterator | begin () const |
Returns an iterator. More... | |
std::vector< TValueType >::iterator | cbegin () const |
Returns a const iterator. More... | |
std::vector< TValueType >::iterator | cend () const |
Returns a const iterator. More... | |
void | copy (Element const *x) override |
Copy another Element into this . More... | |
std::vector< TValueType >::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... | |
TValueType | operator[] (size_t pos) const |
Returns the pos entry in the vector containing the defining data. More... | |
Element * | really_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... | |
virtual size_t | complexity () const =0 |
Returns the approximate time complexity of multiplying two Element objects in a given subclass. More... | |
virtual size_t | degree () const =0 |
Returns the degree of an Element. 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 Element * | identity () const =0 |
Returns a new copy of the identity element. More... | |
virtual void | redefine (Element const *x, Element const *y) |
Multiplies x and y and stores the result in this . 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... | |
Static Protected Member Functions inherited from libsemigroups::ElementWithVectorData< TValueType, TSubclass > | |
template<typename 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< TValueType, TSubclass > | |
std::vector< TValueType > * | _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... | |
Abstract base class for elements using a vector to store their defining data and the default hash function for that underlying vector.
-This class is almost the same as ElementWithVectorData, except that it also implements a method for cache_hash_value, which uses ElementWithVectorData::vector_hash.
-
-
|
- -inlineoverrideprotectedvirtual | -
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.
Implements libsemigroups::Element.
- -
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >, including all inherited members.
-_degree (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_duplicate_gens (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_elements (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_enumerate_order (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_final (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_first (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_found_one (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_gens (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_id (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_idempotents (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_idempotents_found (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_is_idempotent (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_left (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_length (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_lenindex (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_letter_to_pos (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_map (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_mtx (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | mutable |
_nr (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_nr_rules (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_nrgens (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_pos (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_pos_one (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_prefix (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_reduced (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_relation_gen (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_relation_pos (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_right (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_settings (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_sorted (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_suffix (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
_tmp_product (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | mutable |
_wordlen (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
add_generator(element_type const &) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
add_generators(TCollection const &) (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
add_generators(std::initializer_list< const_element_type >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
at(element_index_type) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
batch_size() const noexcept override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
begin() const | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
cayley_graph_type typedef (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
cbegin() const | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
cbegin_idempotents() | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
cbegin_sorted() | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
cend() const | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
cend_idempotents() | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
cend_sorted() | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
closure(TCollection const &coll) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
closure(std::initializer_list< const_element_type >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
concurrency_threshold() const noexcept override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
const_element_type typedef (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
const_iterator typedef | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
const_iterator_idempotents typedef | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
const_iterator_sorted typedef | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
const_pointer typedef (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
const_reference typedef (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
const_reverse_iterator typedef | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
const_reverse_iterator_idempotents typedef | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
const_reverse_iterator_sorted typedef | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
contains(const_reference) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
copy_add_generators(TCollection const &) const | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
copy_closure(TCollection const &) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
crbegin() const | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
crbegin_sorted() | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
crend() const | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
crend_sorted() | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
current_max_word_length() const noexcept override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
current_nr_rules() const noexcept override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
current_position(const_reference x) const | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
current_size() const noexcept override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
degree() const noexcept override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
element_index_type typedef (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
element_type typedef (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
end() const | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
enumerate(size_t=LIMIT_MAX) override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
equal_to(word_type const &, word_type const &) const override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
factorisation(word_type &, element_index_type) override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
factorisation(element_index_type pos) override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
factorisation(const_reference) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
factorisation(KBE const &x) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
fast_product(element_index_type, element_index_type) const override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
final_letter(element_index_type pos) const override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
first_letter(element_index_type pos) const override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
FroidurePin(std::vector< element_type > const *) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | explicit |
FroidurePin(std::vector< element_type > const &) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | explicit |
FroidurePin(std::initializer_list< element_type >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | explicit |
FroidurePin(FroidurePin const &) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
generator(letter_type) const | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
is_idempotent(element_index_type) override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
is_monoid() override (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
left(element_index_type, letter_type) override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
length_const(element_index_type) const override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
length_non_const(element_index_type) override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
letter_to_pos(letter_type) const override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
max_threads() const noexcept override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
minimal_factorisation(word_type &, element_index_type) override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
minimal_factorisation(element_index_type) override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
minimal_factorisation(const_reference) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
next_relation(word_type &relation) override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
nr_generators() const noexcept override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
nr_idempotents() override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
nr_rules() override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
operator=(FroidurePin const &semigroup)=delete | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
operator[](element_index_type) const | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
position(const_reference) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
position_to_sorted_position(element_index_type) override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
prefix(element_index_type pos) const override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
product_by_reduction(element_index_type, element_index_type) const override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
reserve(size_t) override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
reset_next_relation() noexcept override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
right(element_index_type, letter_type) override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
run() override (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
run(size_t) (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
set_batch_size(size_t) noexcept override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
set_concurrency_threshold(size_t) noexcept override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
set_max_threads(size_t) noexcept override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
size() override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
size_type typedef (defined in libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
sorted_at(element_index_type) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
sorted_position(const_reference) | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
suffix(element_index_type pos) const override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
word_to_element(word_type const &) const | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
word_to_pos(word_type const &) const override | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
~FroidurePin() | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > | |
~FroidurePinBase() (defined in libsemigroups::FroidurePinBase) | libsemigroups::FroidurePinBase | inlinevirtual |
- libsemigroups
-
- |
-
Class for semigroups generated by instances of Element. - More...
- -#include <froidure-pin.hpp>
Inherits TTraits, and libsemigroups::FroidurePinBase.
--Public Types | |
-using | cayley_graph_type = internal::RecVec< element_index_type > |
-using | const_element_type = typename TTraits::const_element_type |
using | const_iterator = internal::iterator_base< internal_element_type, const_pointer, const_reference, element_type, iterator_methods > |
A type for const iterators through the elements of this , in the order they were enumerated (i.e. in short-lex order of the minimum word in the generators of this equal to any given element). More... | |
using | const_iterator_idempotents = const_iterator_pair_first |
A type for const iterators through the idempotents of this , in short-lex order. More... | |
using | const_iterator_sorted = const_iterator_pair_first |
A type for const iterators through the elements of this , sorted according to TTraits::less. More... | |
-using | const_pointer = typename TTraits::const_pointer |
-using | const_reference = typename TTraits::const_reference |
using | const_reverse_iterator = std::reverse_iterator< const_iterator > |
A type for const reverse iterators through the elements of this , in the reverse order of enumeration. More... | |
using | const_reverse_iterator_idempotents = const_reverse_iterator_pair_first |
A type for reverse const iterators through the idempotents of this , in short-lex order. More... | |
using | const_reverse_iterator_sorted = const_reverse_iterator_pair_first |
A type for const reverse iterators through the elements of this , sorted according to TTraits::less. More... | |
-using | element_index_type = FroidurePinBase::element_index_type |
-using | element_type = typename TTraits::element_type |
-using | size_type = FroidurePinBase::size_type |
-Public Member Functions | |
FroidurePin (std::vector< element_type > const *) | |
Construct from generators. More... | |
FroidurePin (std::vector< element_type > const &) | |
Construct from generators. More... | |
FroidurePin (std::initializer_list< element_type >) | |
Construct from generators. More... | |
FroidurePin (FroidurePin const &) | |
Copy constructor. More... | |
~FroidurePin () | |
A default destructor. More... | |
void | add_generator (element_type const &) |
Add copies of the generators coll to the generators of this . More... | |
-template<class TCollection > | |
void | add_generators (TCollection const &) |
void | add_generators (std::initializer_list< const_element_type >) |
Add copies of the generators coll to the generators of this . More... | |
const_reference | at (element_index_type) |
Returns the element of the semigroup in position pos , or a nullptr if there is no such element. More... | |
size_t | batch_size () const noexcept override |
Returns the current value of the batch size. This is the minimum number of elements enumerated in any call to FroidurePin::enumerate. More... | |
const_iterator | begin () const |
Returns a const iterator pointing to the first element of the semigroup. More... | |
const_iterator | cbegin () const |
Returns a const iterator pointing to the first element of the semigroup. More... | |
const_iterator_idempotents | cbegin_idempotents () |
Returns a const iterator pointing at the first idempotent in the semigroup. More... | |
const_iterator_sorted | cbegin_sorted () |
Returns a const iterator pointing to the first element of the semigroup when the elements are sorted by Element::operator<. More... | |
const_iterator | cend () const |
Returns a const iterator pointing to one past the last currently known element of the semigroup. More... | |
const_iterator_idempotents | cend_idempotents () |
Returns a const iterator referring to past the end of the last idempotent in the semigroup. More... | |
const_iterator_sorted | cend_sorted () |
Returns a const iterator pointing to one past the last element of the semigroup when the elements are sorted by Element::operator<. More... | |
template<class TCollection > | |
void | closure (TCollection const &coll) |
Add copies of the non-redundant generators in coll to the generators of this . More... | |
void | closure (std::initializer_list< const_element_type >) |
Add copies of the non-redundant generators in coll to the generators of this . More... | |
size_t | concurrency_threshold () const noexcept override |
Returns the current value of. More... | |
bool | contains (const_reference) |
Returns true if x is an element of this and false if it is not. More... | |
template<class TCollection > | |
FroidurePin * | copy_add_generators (TCollection const &) const |
Returns a new semigroup generated by this and coll . More... | |
template<class TCollection > | |
FroidurePin * | copy_closure (TCollection const &) |
Returns a new semigroup generated by this and copies of the non-redundant elements of coll . More... | |
const_reverse_iterator | crbegin () const |
Returns a const reverse iterator pointing to the last currently known element of the semigroup. More... | |
const_reverse_iterator_sorted | crbegin_sorted () |
Returns a const iterator pointing to the last element of the semigroup when the elements are sorted by Element::operator<. More... | |
const_reverse_iterator | crend () const |
Returns a const reverse iterator pointing to one before the first element of the semigroup. More... | |
const_reverse_iterator_sorted | crend_sorted () |
Returns a const iterator pointing to one before the first element of the semigroup when the elements are sorted by Element::operator<. More... | |
size_t | current_max_word_length () const noexcept override |
Returns the maximum length of a word in the generators so far computed. More... | |
size_t | current_nr_rules () const noexcept override |
Returns the number of relations in the presentation for the semigroup that have been found so far. More... | |
element_index_type | current_position (const_reference x) const |
Returns the position of the element x in the semigroup if it is already known to belong to the semigroup. More... | |
size_t | current_size () const noexcept override |
Returns the number of elements in the semigroup that have been enumerated so far. More... | |
size_t | degree () const noexcept override |
Returns the degree of any (and all) Element's in the semigroup. More... | |
const_iterator | end () const |
Returns a const iterator pointing to one past the last currently known element of the semigroup. More... | |
void | enumerate (size_t=LIMIT_MAX) override |
Enumerate the semigroup until limit elements are found or killed is true . More... | |
bool | equal_to (word_type const &, word_type const &) const override |
Returns true if the parameters represent the same element of the semigroup and false otherwise. More... | |
template<> | |
word_type | factorisation (KBE const &x) |
Returns a libsemigroups::word_type which evaluates to x . More... | |
void | factorisation (word_type &, element_index_type) override |
Changes word in-place to contain a word in the generators equal to the pos element of the semigroup. More... | |
word_type | factorisation (element_index_type pos) override |
Returns a libsemigroups::word_type which evaluates to the Element in position pos of this . More... | |
word_type | factorisation (const_reference) |
Returns a libsemigroups::word_type which evaluates to x . More... | |
element_index_type | fast_product (element_index_type, element_index_type) const override |
Returns the position in this of the product of this->at(i) and this->at(j) . More... | |
letter_type | final_letter (element_index_type pos) const override |
Returns the last letter of the element in position pos . More... | |
letter_type | first_letter (element_index_type pos) const override |
Returns the first letter of the element in position pos . More... | |
const_reference | generator (letter_type) const |
Returns a const reference to the generator with index pos . More... | |
bool | is_idempotent (element_index_type) override |
Returns true if the element in position pos is an idempotent and false if it is not. More... | |
-bool | is_monoid () override |
element_index_type | left (element_index_type, letter_type) override |
Returns the index of the product of the generator with index j and the element in position i . More... | |
size_t | length_const (element_index_type) const override |
Returns the length of the element in position pos of the semigroup. More... | |
size_t | length_non_const (element_index_type) override |
Returns the length of the element in position pos of the semigroup. More... | |
element_index_type | letter_to_pos (letter_type) const override |
Returns the position in this of the generator with index i . More... | |
size_t | max_threads () const noexcept override |
Returns the current value of. More... | |
void | minimal_factorisation (word_type &, element_index_type) override |
Changes word in-place to contain a minimal word with respect to the short-lex ordering in the generators equal to the pos element of the semigroup. More... | |
word_type | minimal_factorisation (element_index_type) override |
Returns a minimal libsemigroups::word_type which evaluates to the Element in position pos of this . More... | |
word_type | minimal_factorisation (const_reference) |
Returns a minimal libsemigroups::word_type which evaluates to x . More... | |
void | next_relation (word_type &relation) override |
This method changes relation in-place to contain the next relation of the presentation defining this . More... | |
size_t | nr_generators () const noexcept override |
Returns the number of generators of the semigroup. More... | |
size_t | nr_idempotents () override |
Returns the total number of idempotents in the semigroup. More... | |
size_t | nr_rules () override |
Returns the total number of relations in the presentation defining the semigroup. More... | |
FroidurePin & | operator= (FroidurePin const &semigroup)=delete |
Deleted. More... | |
const_reference | operator[] (element_index_type) const |
Returns the element of the semigroup in position pos . More... | |
element_index_type | position (const_reference) |
Returns the position of x in this , or FroidurePin::UNDEFINED if x is not an element of this . More... | |
element_index_type | position_to_sorted_position (element_index_type) override |
Returns the position of this->at(pos) in the sorted array of elements of the semigroup, or FroidurePin::UNDEFINED if pos is greater than the size of the semigroup. More... | |
element_index_type | prefix (element_index_type pos) const override |
Returns the position of the prefix of the element x in position pos (of the semigroup) of length one less than the length of x . More... | |
element_index_type | product_by_reduction (element_index_type, element_index_type) const override |
Returns the position in this of the product of this->at(i) and this->at(j) by following a path in the Cayley graph. More... | |
void | reserve (size_t) override |
Requests that the capacity (i.e. number of elements) of the semigroup be at least enough to contain n elements. More... | |
void | reset_next_relation () noexcept override |
This method resets FroidurePin::next_relation so that when it is next called the resulting relation is the first one. More... | |
element_index_type | right (element_index_type, letter_type) override |
Returns the index of the product of the element in position i with the generator with index j . More... | |
-void | run () override |
-void | run (size_t) |
void | set_batch_size (size_t) noexcept override |
Set a new value for the batch size. More... | |
void | set_concurrency_threshold (size_t) noexcept override |
Returns the current value of. More... | |
void | set_max_threads (size_t) noexcept override |
Set the maximum number of threads that any method of an instance of FroidurePin can use. More... | |
size_t | size () override |
Returns the size of the semigroup. More... | |
const_reference | sorted_at (element_index_type) |
Returns the element of the semigroup in position pos of the sorted array of elements, or nullptr in pos is not valid (i.e. too big). More... | |
element_index_type | sorted_position (const_reference) |
Returns the position of x in the sorted array of elements of the semigroup, or FroidurePin::UNDEFINED if x is not an element of this . More... | |
element_index_type | suffix (element_index_type pos) const override |
Returns the position of the suffix of the element x in position pos (of the semigroup) of length one less than the length of x . More... | |
element_type | word_to_element (word_type const &) const |
Returns a copy of the element of this represented by the word w . More... | |
element_index_type | word_to_pos (word_type const &) const override |
Returns the position in the semigroup corresponding to the element represented by the word w . More... | |
-Public Attributes | |
-size_t | _degree |
-std::vector< std::pair< letter_type, letter_type > > | _duplicate_gens |
-std::vector< internal_element_type > | _elements |
-std::vector< element_index_type > | _enumerate_order |
-std::vector< letter_type > | _final |
-std::vector< letter_type > | _first |
-bool | _found_one |
-std::vector< internal_element_type > | _gens |
-internal_element_type | _id |
-std::vector< internal_idempotent_pair > | _idempotents |
-bool | _idempotents_found |
-std::vector< bool > | _is_idempotent |
-cayley_graph_type | _left |
-std::vector< size_type > | _length |
-std::vector< enumerate_index_type > | _lenindex |
-std::vector< element_index_type > | _letter_to_pos |
-std::unordered_map< internal_const_element_type, element_index_type, internal_hash, internal_equal_to > | _map |
-std::mutex | _mtx |
-size_type | _nr |
-size_t | _nr_rules |
-letter_type | _nrgens |
-enumerate_index_type | _pos |
-element_index_type | _pos_one |
-std::vector< element_index_type > | _prefix |
-internal::RecVec< bool > | _reduced |
-letter_type | _relation_gen |
-enumerate_index_type | _relation_pos |
-cayley_graph_type | _right |
-struct libsemigroups::FroidurePin::Settings | _settings |
-std::vector< std::pair< internal_element_type, element_index_type > > | _sorted |
-std::vector< element_index_type > | _suffix |
-internal_element_type | _tmp_product |
-size_t | _wordlen |
Class for semigroups generated by instances of Element.
-FroidurePins are defined by a generating set, and the main method here is FroidurePin::enumerate, which implements the Froidure-Pin Algorithm. When the enumeration of the semigroup is complete, the size, the left and right Cayley graphs are determined, and a confluent terminating presentation for the semigroup is known.
-using libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::const_iterator = internal::iterator_base<internal_element_type, const_pointer, const_reference, element_type, iterator_methods> | -
A type for const iterators through the elements of this
, in the order they were enumerated (i.e. in short-lex order of the minimum word in the generators of this
equal to any given element).
using libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::const_iterator_idempotents = const_iterator_pair_first | -
A type for const iterators through the idempotents of this
, in short-lex order.
using libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::const_iterator_sorted = const_iterator_pair_first | -
A type for const iterators through the elements of this
, sorted according to TTraits::less.
using libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::const_reverse_iterator = std::reverse_iterator<const_iterator> | -
A type for const reverse iterators through the elements of this
, in the reverse order of enumeration.
using libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::const_reverse_iterator_idempotents = const_reverse_iterator_pair_first | -
A type for reverse const iterators through the idempotents of this
, in short-lex order.
using libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::const_reverse_iterator_sorted = const_reverse_iterator_pair_first | -
A type for const reverse iterators through the elements of this
, sorted according to TTraits::less.
-
|
- -explicit | -
Construct from generators.
-This is the default constructor for a semigroup generated by gens
. The generators gens
must all be of the same derived subclass of the Element base class. Additionally, gens
must satisfy the following:
There can be duplicate generators and although they do not count as distinct elements, they do count as distinct generators. In other words, the generators of the semigroup are precisely (a copy of) gens
in the same order they occur in gens
.
The generators gens
are copied by the constructor, and so it is the responsibility of the caller to delete gens
.
-
|
- -explicit | -
Construct from generators.
-This constructor simply calls the above constructor with a pointer to gens
.
-
|
- -explicit | -
Construct from generators.
-This constructor simply constructs a vector from gens
and calls the above constructor.
libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::FroidurePin | -( | -FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > const & | -) | -- |
Copy constructor.
-Constructs a new FroidurePin which is an exact copy of copy
. No enumeration is triggered for either copy
or of the newly constructed semigroup.
libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::~FroidurePin | -( | -) | -- |
A default destructor.
- -void libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::add_generator | -( | -element_type const & | -) | -- |
Add copies of the generators coll
to the generators of this
.
This method can be used to add new generators to the existing semigroup in such a way that any previously enumerated data is preserved and not recomputed, or copied. This can be faster than recomputing the semigroup generated by the old generators and the new generators in the parameter coll
.
This method changes the semigroup in-place, thereby invalidating possibly previously known data about the semigroup, such as the left or right Cayley graphs, number of idempotents, and so on.
-Every generator in coll
is added regardless of whether or not it is already a generator or element of the semigroup (it may belong to the semigroup but just not be known to belong). If coll
is empty, then the semigroup is left unchanged. The order the generators is added is also the order they occur in the parameter coll
.
The semigroup is returned in a state where all of the previously enumerated elements which had been multiplied by all of the old generators, have now been multiplied by all of the old and new generators. This means that after this method is called the semigroup might contain many more elements than before (whether it is fully enumerating or not). It can also be the case that the new generators are the only new elements, unlike, say, in the case of non-trivial groups.
-The elements of the argument coll
are copied into the semigroup, and should be deleted by the caller. If an element in coll
has a degree different to this->degree()
, a LIBSEMIGROUPS_EXCEPTION will be thrown.
void libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::add_generators | -( | -std::initializer_list< const_element_type > | -) | -- |
Add copies of the generators coll
to the generators of this
.
See FroidurePin::add_generators for more details.
- -const_reference libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::at | -( | -element_index_type | -) | -- |
Returns the element of the semigroup in position pos
, or a nullptr
if there is no such element.
This method attempts to enumerate the semigroup until at least pos
+ 1 elements have been found. If pos
is greater than FroidurePin::size, then this method returns nullptr
.
-
|
- -overridenoexcept | -
Returns the current value of the batch size. This is the minimum number of elements enumerated in any call to FroidurePin::enumerate.
- -const_iterator libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::begin | -( | -) | -const | -
Returns a const iterator pointing to the first element of the semigroup.
-This method does not perform any enumeration of the semigroup, the iterator returned may be invalidated by any call to a non-const method of the FroidurePin class.
- -const_iterator libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::cbegin | -( | -) | -const | -
Returns a const iterator pointing to the first element of the semigroup.
-This method does not perform any enumeration of the semigroup, the iterator returned may be invalidated by any call to a non-const method of the FroidurePin class.
- -const_iterator_idempotents libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::cbegin_idempotents | -( | -) | -- |
Returns a const iterator pointing at the first idempotent in the semigroup.
-If the returned iterator is incremented, then it points to the second idempotent in the semigroup (if it exists), and every subsequent increment points to the next idempotent.
-This method involves fully enumerating the semigroup, if it is not already fully enumerated.
- -const_iterator_sorted libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::cbegin_sorted | -( | -) | -- |
Returns a const iterator pointing to the first element of the semigroup when the elements are sorted by Element::operator<.
-This method fully enumerates the semigroup, the returned iterator returned may be invalidated by any call to a non-const method of the FroidurePin class.
- -const_iterator libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::cend | -( | -) | -const | -
Returns a const iterator pointing to one past the last currently known element of the semigroup.
-This method does not perform any enumeration of the semigroup, the iterator returned may be invalidated by any call to a non-const method of the FroidurePin class.
- -const_iterator_idempotents libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::cend_idempotents | -( | -) | -- |
Returns a const iterator referring to past the end of the last idempotent in the semigroup.
-This method involves fully enumerating the semigroup, if it is not already fully enumerated.
- -const_iterator_sorted libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::cend_sorted | -( | -) | -- |
Returns a const iterator pointing to one past the last element of the semigroup when the elements are sorted by Element::operator<.
-This method fully enumerates the semigroup, the returned iterator returned may be invalidated by any call to a non-const method of the FroidurePin class.
- -void libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::closure | -( | -TCollection const & | -coll | ) | -- |
Add copies of the non-redundant generators in coll
to the generators of this
.
This method can be used to add new generators to an existing semigroup in such a way that any previously enumerated data is preserved and not recomputed, or copied. This can be faster than recomputing the semigroup generated by the old generators and the new in coll
.
This method differs from FroidurePin::add_generators in that it tries to add the new generators one by one, and only adds those generators that are not products of existing generators (including any new generators from coll
that were added before). The generators are added in the order they occur in coll
.
This method changes the semigroup in-place, thereby invalidating possibly previously known data about the semigroup, such as the left or right Cayley graphs, or number of idempotents, for example.
-The elements the parameter coll
are copied into the semigroup, and should be deleted by the caller. If an element in coll
has a degree different to this->degree()
, a LIBSEMIGROUPS_EXCEPTION will be thrown.
void libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::closure | -( | -std::initializer_list< const_element_type > | -) | -- |
Add copies of the non-redundant generators in coll
to the generators of this
.
See FroidurePin::closure for more details.
- -
-
|
- -overridenoexcept | -
Returns the current value of.
- -bool libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::contains | -( | -const_reference | -) | -- |
Returns true
if x
is an element of this
and false
if it is not.
This method can be used to check if the element x
is an element of the semigroup. The semigroup is enumerated in batches until x
is found or the semigroup is fully enumerated but x
was not found (see FroidurePin::set_batch_size).
FroidurePin* libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::copy_add_generators | -( | -TCollection const & | -) | -const | -
Returns a new semigroup generated by this
and coll
.
This method is equivalent to copying this
using FroidurePin::FroidurePin(const FroidurePin& copy) and then calling FroidurePin::add_generators on the copy, but this method avoids copying the parts of this
that are immediately invalidated by FroidurePin::add_generators.
The elements the argument coll
are copied into the semigroup, and should be deleted by the caller. If an element in coll
has a degree different to this->degree()
, a LIBSEMIGROUPS_EXCEPTION will be thrown.
FroidurePin* libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::copy_closure | -( | -TCollection const & | -) | -- |
Returns a new semigroup generated by this
and copies of the non-redundant elements of coll
.
This method is equivalent to copying this
and then calling FroidurePin::closure on the copy with coll
, but this method avoids copying the parts of this
that are immediately invalidated by FroidurePin::closure.
The elements the argument coll
are copied into the semigroup, and should be deleted by the caller. If an element in coll
has a degree different to this->degree()
, a LIBSEMIGROUPS_EXCEPTION will be thrown.
const_reverse_iterator libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::crbegin | -( | -) | -const | -
Returns a const reverse iterator pointing to the last currently known element of the semigroup.
-This method does not perform any enumeration of the semigroup, the iterator returned may be invalidated by any call to a non-const method of the FroidurePin class.
- -const_reverse_iterator_sorted libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::crbegin_sorted | -( | -) | -- |
Returns a const iterator pointing to the last element of the semigroup when the elements are sorted by Element::operator<.
-This method fully enumerates the semigroup, the returned iterator returned may be invalidated by any call to a non-const method of the FroidurePin class.
- -const_reverse_iterator libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::crend | -( | -) | -const | -
Returns a const reverse iterator pointing to one before the first element of the semigroup.
-This method does not perform any enumeration of the semigroup, the iterator returned may be invalidated by any call to a non-const method of the FroidurePin class.
- -const_reverse_iterator_sorted libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::crend_sorted | -( | -) | -- |
Returns a const iterator pointing to one before the first element of the semigroup when the elements are sorted by Element::operator<.
-This method fully enumerates the semigroup, the returned iterator returned may be invalidated by any call to a non-const method of the FroidurePin class.
- -
-
|
- -overridenoexcept | -
Returns the maximum length of a word in the generators so far computed.
-Every elements of the semigroup can be expressed as a product of the generators. The elements of the semigroup are enumerated in the short-lex order induced by the order of the generators (as passed to FroidurePin::FroidurePin). This method returns the length of the longest word in the generators that has so far been enumerated.
- -
-
|
- -overridenoexcept | -
Returns the number of relations in the presentation for the semigroup that have been found so far.
-This is only the actual number of relations in a presentation defining the semigroup if the semigroup is fully enumerated.
- -element_index_type libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::current_position | -( | -const_reference | -x | ) | -const | -
Returns the position of the element x
in the semigroup if it is already known to belong to the semigroup.
This method finds the position of the element x
in the semigroup if it is already known to belong to the semigroup, and libsemigroups::FroidurePin::UNDEFINED if not. If the semigroup is not fully enumerated, then this method may return libsemigroups::FroidurePin::UNDEFINED when x
is in the semigroup, but this is not yet known.
-
|
- -overridenoexcept | -
Returns the number of elements in the semigroup that have been enumerated so far.
-This is only the actual size of the semigroup if the semigroup is fully enumerated.
- -
-
|
- -overridenoexcept | -
Returns the degree of any (and all) Element's in the semigroup.
- -const_iterator libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::end | -( | -) | -const | -
Returns a const iterator pointing to one past the last currently known element of the semigroup.
-This method does not perform any enumeration of the semigroup, the iterator returned may be invalidated by any call to a non-const method of the FroidurePin class.
- -
-
|
- -override | -
Enumerate the semigroup until limit
elements are found or killed
is true
.
This is the main method of the FroidurePin class, where the Froidure-Pin Algorithm is implemented.
-If the semigroup is already fully enumerated, or the number of elements previously enumerated exceeds limit
, then calling this method does nothing. Otherwise, enumerate attempts to find at least the maximum of limit
and FroidurePin::batch_size elements of the semigroup. If killed
is set to true
(usually by another process), then the enumeration is terminated as soon as possible. It is possible to resume enumeration at some later point after any call to this method, even if it has been killed.
If the semigroup is fully enumerated, then it knows its left and right Cayley graphs, and a minimal factorisation of every element (in terms of its generating set). All of the elements are stored in memory until the object is destroyed.
-The parameter limit
defaults to FroidurePin::LIMIT_MAX.
-
|
- -override | -
Returns true
if the parameters represent the same element of the semigroup and false
otherwise.
word_type libsemigroups::FroidurePin< KBE, internal::hash< KBE >, internal::equal_to< KBE >, TraitsHashEqual< KBE, internal::hash< KBE >, internal::equal_to< KBE > > >::factorisation | -( | -KBE const & | -x | ) | -- |
Returns a libsemigroups::word_type which evaluates to x
.
Specialises the factorisation method for FroidurePin's of KBE's so that it just returns the word inside the KBE.
- -
-
|
- -override | -
Changes word
in-place to contain a word in the generators equal to the pos
element of the semigroup.
The key difference between this method and FroidurePin::minimal_factorisation(word_type& word, element_index_type pos), is that the resulting factorisation may not be minimal. If pos
is greater than the size of the semigroup, then a LIBSEMIGROUPS_EXCEPTION is thrown.
-
|
- -override | -
Returns a libsemigroups::word_type which evaluates to the Element in position pos
of this
.
The key difference between this method and FroidurePin::minimal_factorisation(element_index_type pos), is that the resulting factorisation may not be minimal. If pos
is greater than the size of the semigroup, then a LIBSEMIGROUPS_EXCEPTION is thrown.
word_type libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::factorisation | -( | -const_reference | -) | -- |
Returns a libsemigroups::word_type which evaluates to x
.
The key difference between this method and FroidurePin::minimal_factorisation(const_reference x), is that the resulting factorisation may not be minimal. If pos
is greater than the size of the semigroup, then a LIBSEMIGROUPS_EXCEPTION is thrown.
-
|
- -override | -
Returns the position in this
of the product of this->at(i)
and this->at(j)
.
The values i
and j
must be less than FroidurePin::current_size, or a LIBSEMIGROUPS_EXCEPTION will be thrown. This method either:
i
to j
, whichever is shorter using FroidurePin::product_by_reduction; ori
and j
together;whichever is better. The method used is determined by comparing Element::complexity and the FroidurePin::length_const of i
and j
.
For example, if the Element::complexity of the multiplication is linear and this
is a semigroup of transformations of degree 20, and the shortest paths in the left and right Cayley graphs from i
to j
are of length 100 and 1131, then it better to just product the transformations together.
-
|
- -override | -
Returns the last letter of the element in position pos
.
This method returns the final letter of the element in position pos
of the semigroup, which is the index of the generator corresponding to the final letter of the element.
Note that FroidurePin::gens[FroidurePin::final_letter(pos
)] is only equal to FroidurePin::at(FroidurePin::final_letter(pos
)) if there are no duplicate generators.
The parameter pos
must be a valid position of an already enumerated element of the semigroup, or a LIBSEMIGROUPS_EXCEPTION will be thrown.
-
|
- -override | -
Returns the first letter of the element in position pos
.
This method returns the first letter of the element in position pos
of the semigroup, which is the index of the generator corresponding to the first letter of the element.
Note that FroidurePin::gens[FroidurePin::first_letter(pos
)] is only equal to FroidurePin::at(FroidurePin::first_letter(pos
)) if there are no duplicate generators.
The parameter pos
must be a valid position of an already enumerated element of the semigroup, or a LIBSEMIGROUPS_EXCEPTION will be thrown.
const_reference libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::generator | -( | -letter_type | -) | -const | -
Returns a const reference to the generator with index pos
.
If pos
is not less than FroidurePin::nr_generators(), a LIBSEMIGROUPS_EXCEPTION will be thrown. Note that FroidurePin::gens(pos) is in general in general not in position pos
in the semigroup, i.e. is not equal to FroidurePin::at(pos).
-
|
- -override | -
Returns true
if the element in position pos
is an idempotent and false
if it is not.
The parameter pos
must be a valid position of an element of the semigroup, or a LIBSEMIGROUPS_EXCEPTION will be thrown. This method involves fully enumerating the semigroup, if it is not already fully enumerated.
-
|
- -override | -
Returns the index of the product of the generator with index j
and the element in position i
.
This method fully enumerates the semigroup.
- -
-
|
- -override | -
Returns the length of the element in position pos
of the semigroup.
The parameter pos
must be a valid position of an already enumerated element of the semigroup, or a LIBSEMIGROUPS_EXCEPTION will be thrown. This method causes no enumeration of the semigroup.
-
|
- -override | -
Returns the length of the element in position pos
of the semigroup.
The parameter pos
must be a valid position of an element of the semigroup, or a LIBSEMIGROUPS_EXCEPTION will be thrown.
-
|
- -override | -
Returns the position in this
of the generator with index i
.
If i
is not a valid generator index, a LIBSEMIGROUPS_EXCEPTION will be thrown. In many cases letter_to_pos(i)
will equal i
, examples of when this will not be the case are:
-
|
- -overridenoexcept | -
Returns the current value of.
- -
-
|
- -override | -
Changes word
in-place to contain a minimal word with respect to the short-lex ordering in the generators equal to the pos
element of the semigroup.
If pos
is less than the size of this semigroup, then this method changes its first parameter word
in-place by first clearing it and then to contain a minimal factorization of the element in position pos
of the semigroup with respect to the generators of the semigroup. This method enumerates the semigroup until at least the pos
element is known. If pos
is greater than the size of the semigroup, then a LIBSEMIGROUPS_EXCEPTION is thrown.
-
|
- -override | -
Returns a minimal libsemigroups::word_type which evaluates to the Element in position pos
of this
.
This is the same as the two-argument method for FroidurePin::minimal_factorisation, but it returns a pointer to the factorisation instead of modifying an argument in-place. If pos
is greater than the size of the semigroup, then a LIBSEMIGROUPS_EXCEPTION is thrown.
word_type libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::minimal_factorisation | -( | -const_reference | -) | -- |
Returns a minimal libsemigroups::word_type which evaluates to x
.
This is the same as the method taking a FroidurePin::element_index_type, but it factorises an Element instead of using the position of an element. If pos
is greater than the size of the semigroup, then a LIBSEMIGROUPS_EXCEPTION is thrown.
-
|
- -override | -
This method changes relation
in-place to contain the next relation of the presentation defining this
.
This method changes relation
in-place so that one of the following holds:
relation
is a vector consisting of a libsemigroups::letter_type and a libsemigroups::letter_type such that FroidurePin::gens(relation
[0
]) == FroidurePin::gens(relation
[1
]), i.e. if the semigroup was defined with duplicate generators;relation
is a vector consisting of a libsemigroups::element_index_type, libsemigroups::letter_type, and libsemigroups::element_index_type such that relation
is empty if there are no more relations.FroidurePin::next_relation is guaranteed to output all relations of length 2 before any relations of length 3. If called repeatedly after FroidurePin::reset_next_relation, and until relation is empty, the values placed in relation
correspond to a length-reducing confluent rewriting system that defines the semigroup.
This method can be used in conjunction with FroidurePin::factorisation to obtain a presentation defining the semigroup.
-
-
|
- -overridenoexcept | -
Returns the number of generators of the semigroup.
- -
-
|
- -override | -
Returns the total number of idempotents in the semigroup.
-This method involves fully enumerating the semigroup, if it is not already fully enumerated. The value of the positions, and number, of idempotents is stored after they are first computed.
- -
-
|
- -override | -
Returns the total number of relations in the presentation defining the semigroup.
-
-
|
- -delete | -
Deleted.
-The FroidurePin class does not support an assignment contructor to avoid accidental copying. An object in FroidurePin may use many gigabytes of memory and might be extremely expensive to copy. A copy constructor is provided in case such a copy should it be required anyway.
- -const_reference libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::operator[] | -( | -element_index_type | -) | -const | -
Returns the element of the semigroup in position pos
.
This method performs no checks on its argument, and performs no enumeration of the semigroup.
- -element_index_type libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::position | -( | -const_reference | -) | -- |
Returns the position of x
in this
, or FroidurePin::UNDEFINED if x
is not an element of this
.
This method can be used to find the FroidurePin::element_index_type position of the element x
if it belongs to the semigroup. The semigroup is enumerated in batches until x
is found or the semigroup is fully enumerated but x
was not found (see FroidurePin::set_batch_size).
-
|
- -override | -
Returns the position of this->at(pos)
in the sorted array of elements of the semigroup, or FroidurePin::UNDEFINED if pos
is greater than the size of the semigroup.
-
|
- -override | -
Returns the position of the prefix of the element x
in position pos
(of the semigroup) of length one less than the length of x
.
The parameter pos
must be a valid position of an already enumerated element of the semigroup, or a LIBSEMIGROUPS_EXCEPTION will be thrown.
-
|
- -override | -
Returns the position in this
of the product of this->at(i)
and this->at(j)
by following a path in the Cayley graph.
The values i
and j
must be less than FroidurePin::current_size, or a LIBSEMIGROUPS_EXCEPTION will be thrown. This method returns the position FroidurePin::element_index_type in the semigroup of the product of this->at(i)
and this->at(j)
elements by following the path in the right Cayley graph from i
labelled by the word this->minimal_factorisation(j)
or, if this->minimal_factorisation(i) is shorter, by following the path in the left Cayley graph from j
labelled by this->minimal_factorisation(i).
-
|
- -override | -
Requests that the capacity (i.e. number of elements) of the semigroup be at least enough to contain n elements.
-The parameter n
is also used to initialise certain data members, if you know a good upper bound for the size of your semigroup, then it is a good idea to call this method with that upper bound as an argument, this can significantly improve the performance of the FroidurePin::enumerate method, and consequently every other method too.
-
|
- -overridenoexcept | -
This method resets FroidurePin::next_relation so that when it is next called the resulting relation is the first one.
-After a call to this function, the next call to FroidurePin::next_relation will return the first relation of the presentation defining the semigroup.
- -
-
|
- -override | -
Returns the index of the product of the element in position i
with the generator with index j
.
This method fully enumerates the semigroup.
- -
-
|
- -overridenoexcept | -
Set a new value for the batch size.
-The batch size is the number of new elements to be found by any call to FroidurePin::enumerate. A call to enumerate returns between 0 and approximately the batch size.
-The default value of the batch size is 8192.
-This is used by, for example, FroidurePin::position so that it is possible to find the position of an element without fully enumerating the semigroup.
- -
-
|
- -overridenoexcept | -
Returns the current value of.
- -
-
|
- -overridenoexcept | -
Set the maximum number of threads that any method of an instance of FroidurePin can use.
-This method sets the maximum number of threads to be used by any method of a FroidurePin object. The number of threads is limited to the maximum of 1 and the minimum of nr_threads
and the number of threads supported by the hardware.
-
|
- -override | -
Returns the size of the semigroup.
- -const_reference libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::sorted_at | -( | -element_index_type | -) | -- |
Returns the element of the semigroup in position pos
of the sorted array of elements, or nullptr
in pos
is not valid (i.e. too big).
This method fully enumerates the semigroup.
- -element_index_type libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::sorted_position | -( | -const_reference | -) | -- |
Returns the position of x
in the sorted array of elements of the semigroup, or FroidurePin::UNDEFINED if x
is not an element of this
.
-
|
- -override | -
Returns the position of the suffix of the element x
in position pos
(of the semigroup) of length one less than the length of x
.
The parameter pos
must be a valid position of an already enumerated element of the semigroup, or a LIBSEMIGROUPS_EXCEPTION will be thrown.
element_type libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits >::word_to_element | -( | -word_type const & | -) | -const | -
Returns a copy of the element of this
represented by the word w
.
The parameter w
must consist of non-negative integers less than FroidurePin::nrgens, or a LIBSEMIGROUPS_EXCEPTION will be thrown. This method returns a copy of the element of this
obtained by evaluating w
. This is equivalent to finding the product x
of the generators FroidurePin::gens(w
[i]).
A copy is returned instead of a reference, because the element of this
corresponding to w
may not yet have been enumerated.
-
|
- -override | -
Returns the position in the semigroup corresponding to the element represented by the word w
.
The parameter w
must consist of non-negative integers less than FroidurePin::nr_generators, or a LibsemigroupsException will be thrown. This method returns the position in this
of the element obtained by evaluating w
. This method does not perform any enumeration of the semigroup, and will return UNDEFINED if the position of the element of this
corresponding to w
cannot be determined.
This is equivalent to finding the product x
of the generators FroidurePin::gens(w
[i]) and then calling FroidurePin::position_current with argument x
.
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::Integers, including all inherited members.
-INFTY | libsemigroups::Semiring< int64_t > | static |
Integers() (defined in libsemigroups::Integers) | libsemigroups::Integers | inline |
MINUS_INFTY | libsemigroups::Semiring< int64_t > | static |
one() const override | libsemigroups::Integers | inlinevirtual |
plus(int64_t x, int64_t y) const override | libsemigroups::Integers | inlinevirtual |
prod(int64_t x, int64_t y) const override | libsemigroups::Integers | inlinevirtual |
UNDEFINED | libsemigroups::Semiring< int64_t > | static |
zero() const override | libsemigroups::Integers | inlinevirtual |
~Semiring() | libsemigroups::Semiring< int64_t > | inlinevirtual |
- libsemigroups
-
- |
-
The usual ring of integers. - More...
- -#include <semiring.h>
-Public Member Functions | |
int64_t | one () const override |
Returns the integer 1. More... | |
int64_t | plus (int64_t x, int64_t y) const override |
Returns the sum \(x + y\). More... | |
int64_t | prod (int64_t x, int64_t y) const override |
Returns the product \(xy\). More... | |
int64_t | zero () const override |
Returns the integer 0. More... | |
Public Member Functions inherited from libsemigroups::Semiring< int64_t > | |
virtual | ~Semiring () |
A default destructor. More... | |
-Additional Inherited Members | |
Static Public Attributes inherited from libsemigroups::Semiring< int64_t > | |
static const int64_t | INFTY |
Value representing \(\infty\). More... | |
static const int64_t | MINUS_INFTY |
Value representing \(-\infty\). More... | |
static const int64_t | UNDEFINED |
Value representing an undefined quantity. More... | |
The usual ring of integers.
-
-
|
- -inlineoverridevirtual | -
Returns the integer 1.
- -Implements libsemigroups::Semiring< int64_t >.
- -
-
|
- -inlineoverridevirtual | -
Returns the sum \(x + y\).
- -Implements libsemigroups::Semiring< int64_t >.
- -
-
|
- -inlineoverridevirtual | -
Returns the product \(xy\).
- -Implements libsemigroups::Semiring< int64_t >.
- -
-
|
- -inlineoverridevirtual | -
Returns the integer 0.
- -Implements libsemigroups::Semiring< int64_t >.
- -
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::KBE, including all inherited members.
-_hash_value | libsemigroups::Element | mutableprotected |
cache_hash_value() const override | libsemigroups::KBE | virtual |
complexity() const override | libsemigroups::KBE | virtual |
degree() const override | libsemigroups::KBE | virtual |
Element() | libsemigroups::Element | |
Element(size_t) | libsemigroups::Element | explicit |
hash_value() const | libsemigroups::Element | inline |
heap_copy() const override | libsemigroups::KBE | virtual |
heap_identity() const override | libsemigroups::KBE | virtual |
identity() const | libsemigroups::KBE | |
increase_degree_by(size_t) | libsemigroups::Element | virtual |
KBE()=default | libsemigroups::KBE | |
KBE(KnuthBendix *) | libsemigroups::KBE | explicit |
KBE(KnuthBendix *, internal_string_type const &) | libsemigroups::KBE | |
KBE(KnuthBendix *, letter_type const &) | libsemigroups::KBE | |
KBE(KnuthBendix &, letter_type const &) | libsemigroups::KBE | |
KBE(KnuthBendix *, word_type const &) | libsemigroups::KBE | |
KBE(KnuthBendix &, word_type const &) | libsemigroups::KBE | |
KBE(KBE const &)=default | libsemigroups::KBE | |
operator std::string() const (defined in libsemigroups::KBE) | libsemigroups::KBE | |
operator word_type() const (defined in libsemigroups::KBE) | libsemigroups::KBE | |
operator!=(Element const &that) const | libsemigroups::Element | |
operator<(Element const &) const override | libsemigroups::KBE | virtual |
operator<=(Element const &that) const | libsemigroups::Element | |
operator==(Element const &) const override | libsemigroups::KBE | virtual |
operator>(Element const &that) const | libsemigroups::Element | |
operator>=(Element const &that) const | libsemigroups::Element | |
redefine(Element const &, Element const &, size_t=0) override | libsemigroups::KBE | virtual |
libsemigroups::Element::redefine(Element const &, Element const &) | libsemigroups::Element | virtual |
libsemigroups::Element::redefine(Element const *, Element const *) | libsemigroups::Element | |
libsemigroups::Element::redefine(Element const *, Element const *, size_t) | libsemigroups::Element | |
reset_hash_value() const | libsemigroups::Element | protected |
swap(Element &) override | libsemigroups::KBE | virtual |
~Element()=default | libsemigroups::Element | virtual |
- libsemigroups
-
- |
-
Subclass of Element that wraps an libsemigroups::internal_string_type. - More...
- -#include <kbe.hpp>
-Public Member Functions | |
KBE ()=default | |
Constructor. More... | |
KBE (KnuthBendix *) | |
Constructor from a rewriting system and a word. More... | |
KBE (KnuthBendix *, internal_string_type const &) | |
Constructor from a rewriting system and a word. More... | |
KBE (KnuthBendix *, letter_type const &) | |
Constructor from a rewriting system and a letter. More... | |
KBE (KnuthBendix &, letter_type const &) | |
Constructor from a rewriting system and a letter. More... | |
KBE (KnuthBendix *, word_type const &) | |
Constructor from a rewriting system and a word. More... | |
KBE (KnuthBendix &, word_type const &) | |
Constructor from a rewriting system and a word. More... | |
KBE (KBE const &)=default | |
A copy constructor. 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 KBE's. More... | |
size_t | degree () const override |
Returns the degree of an KBE. More... | |
KBE * | heap_copy () const override |
Returns an independent copy of this . More... | |
KBE * | heap_identity () const override |
Returns a new copy of the identity KBE. More... | |
KBE | identity () const |
Return the identity KBE. More... | |
- | operator std::string () const |
- | operator word_type () const |
bool | operator< (Element const &) const override |
Returns true if this is less than that and false if it is not. More... | |
bool | operator== (Element const &) const override |
Returns true if this equals that . More... | |
void | redefine (Element const &, Element const &, size_t=0) override |
Multiply x and y and stores the result in this . More... | |
void | swap (Element &) override |
Copy x into this . More... | |
Public Member Functions inherited from libsemigroups::Element | |
Element () | |
A constructor. More... | |
Element (size_t) | |
A constructor. More... | |
virtual | ~Element ()=default |
A default destructor. More... | |
size_t | hash_value () const |
Return the hash value of an Element. More... | |
virtual void | increase_degree_by (size_t) |
Increases the degree of this by deg . This does not make sense for all subclasses of Element. More... | |
bool | operator!= (Element const &that) const |
Returns true if this is not equal to that . More... | |
bool | operator<= (Element const &that) const |
Returns true if this is less than or equal to that . More... | |
bool | operator> (Element const &that) const |
Returns true if this is greater than that . More... | |
bool | operator>= (Element const &that) const |
Returns true if this is less than or equal to that . More... | |
virtual void | redefine (Element const &, Element const &) |
Multiplies x and y and stores the result in this . More... | |
void | redefine (Element const *, Element const *) |
Multiplies x and y and stores the result in this . More... | |
void | redefine (Element const *, Element const *, size_t) |
Multiplies x and y and stores the result in this . More... | |
-Additional Inherited Members | |
Protected Member Functions inherited from libsemigroups::Element | |
void | reset_hash_value () const |
Reset the cached value used by Element::hash_value. More... | |
Protected Attributes inherited from libsemigroups::Element | |
size_t | _hash_value |
This data member holds a cached version of the hash value of an Element. It is stored here if it is ever computed. It is invalidated by libsemigroups::Element::redefine and sometimes by libsemigroups::Element::really_copy, and potentially any other non-const data member of Element or any of its subclasses. More... | |
Subclass of Element that wraps an libsemigroups::internal_string_type.
-This class is used to wrap libsemigroups::internal_string_type into an Element so that it is possible to use them as generators for a FroidurePin object.
-
-
|
- -default | -
Constructor.
-Constructs a KBE which does not represent a word or have an associated rewriting system.
- -
-
|
- -explicit | -
libsemigroups::KBE::KBE | -( | -KnuthBendix * | -, | -
- | - | internal_string_type const & | -- |
- | ) | -- |
libsemigroups::KBE::KBE | -( | -KnuthBendix * | -, | -
- | - | letter_type const & | -- |
- | ) | -- |
Constructor from a rewriting system and a letter.
-Calls KBE::KBE with KnuthBendix::uint_to_kb_word of a
.
libsemigroups::KBE::KBE | -( | -KnuthBendix & | -, | -
- | - | letter_type const & | -- |
- | ) | -- |
Constructor from a rewriting system and a letter.
-Calls KBE::KBE with KnuthBendix::uint_to_kb_word of a
.
libsemigroups::KBE::KBE | -( | -KnuthBendix * | -, | -
- | - | word_type const & | -- |
- | ) | -- |
Constructor from a rewriting system and a word.
-Calls KBE::KBE with KnuthBendix::word_to_kb_word of w
.
libsemigroups::KBE::KBE | -( | -KnuthBendix & | -, | -
- | - | word_type const & | -- |
- | ) | -- |
Constructor from a rewriting system and a word.
-Calls KBE::KBE with KnuthBendix::word_to_kb_word of w
.
-
|
- -default | -
A copy constructor.
- -
-
|
- -overridevirtual | -
Calculates a hash value for this object which is cached.
-Implements libsemigroups::Element.
- -
-
|
- -overridevirtual | -
Returns the approximate time complexity of multiplying two KBE's.
-Returns KBE::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 FroidurePin.
- -Implements libsemigroups::Element.
- -
-
|
- -overridevirtual | -
Returns the degree of an KBE.
-Returns the integer 0 since the notion of degree is not really meaningful in this context.
- -Implements libsemigroups::Element.
- -
-
|
- -overridevirtual | -
Returns an independent copy of this
.
Returns a pointer to a copy of this
, which is not linked to this
in memory.
Implements libsemigroups::Element.
- -
-
|
- -overridevirtual | -
Returns a new copy of the identity KBE.
-Returns a pointer to a copy of this->identity()
, which is not linked to any other copy in memory.
Implements libsemigroups::Element.
- -KBE libsemigroups::KBE::identity | -( | -) | -const | -
-
|
- -overridevirtual | -
Returns true
if this
is less than that and false
if it is not.
This defines a total order on KBEs that is the short-lex order on all words.
- -Implements libsemigroups::Element.
- -
-
|
- -overridevirtual | -
Returns true
if this
equals that
.
This method checks the mathematical equality of two KBE, 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 | -
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 | -
Copy x
into this
.
This method copies the KBE pointed to by x
into this
by changing this
in-place.
Implements libsemigroups::Element.
- -
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::MatrixOverSemiring< TValueType >, including all inherited members.
-_vector | libsemigroups::ElementWithVectorData< TValueType, MatrixOverSemiring< TValueType > > | protected |
at(size_t pos) const | libsemigroups::ElementWithVectorData< TValueType, MatrixOverSemiring< TValueType > > | inline |
begin() const | libsemigroups::ElementWithVectorData< TValueType, MatrixOverSemiring< TValueType > > | inline |
cache_hash_value() const override | libsemigroups::ElementWithVectorDataDefaultHash< TValueType, MatrixOverSemiring< TValueType > > | inlineprotectedvirtual |
cbegin() const | libsemigroups::ElementWithVectorData< TValueType, MatrixOverSemiring< TValueType > > | inline |
cend() const | libsemigroups::ElementWithVectorData< TValueType, MatrixOverSemiring< TValueType > > | inline |
complexity() const override | libsemigroups::MatrixOverSemiringBase< TValueType, MatrixOverSemiring< TValueType > > | inlinevirtual |
copy(Element const *x) override | libsemigroups::ElementWithVectorData< TValueType, MatrixOverSemiring< TValueType > > | inlinevirtual |
degree() const override | libsemigroups::MatrixOverSemiringBase< TValueType, MatrixOverSemiring< TValueType > > | inlinevirtual |
Element(elm_t type=Element::elm_t::NOT_RWSE) | libsemigroups::Element | inlineexplicit |
ElementWithVectorData() | libsemigroups::ElementWithVectorData< TValueType, MatrixOverSemiring< TValueType > > | inline |
ElementWithVectorData(std::vector< TValueType > *vector) | libsemigroups::ElementWithVectorData< TValueType, MatrixOverSemiring< TValueType > > | inlineexplicit |
ElementWithVectorData(std::vector< TValueType > const &vector) | libsemigroups::ElementWithVectorData< TValueType, MatrixOverSemiring< TValueType > > | inlineexplicit |
ElementWithVectorData< TValueType, MatrixOverSemiring< TValueType > > (defined in libsemigroups::MatrixOverSemiring< TValueType >) | libsemigroups::MatrixOverSemiring< TValueType > | friend |
elm_t enum name | libsemigroups::Element | |
end() const | libsemigroups::ElementWithVectorData< TValueType, MatrixOverSemiring< TValueType > > | inline |
get_type() const | libsemigroups::Element | inline |
hash_value() const | libsemigroups::Element | inline |
identity() const override | libsemigroups::MatrixOverSemiringBase< TValueType, MatrixOverSemiring< TValueType > > | inlinevirtual |
MatrixOverSemiringBase(std::vector< TValueType > *matrix, Semiring< TValueType > const *semiring) | libsemigroups::MatrixOverSemiringBase< TValueType, MatrixOverSemiring< TValueType > > | inline |
MatrixOverSemiringBase(std::vector< std::vector< TValueType >> const &matrix, Semiring< TValueType > const *semiring) | libsemigroups::MatrixOverSemiringBase< TValueType, MatrixOverSemiring< TValueType > > | inline |
MatrixOverSemiringBase(std::vector< TValueType > *matrix) | libsemigroups::MatrixOverSemiringBase< TValueType, MatrixOverSemiring< TValueType > > | inlineexplicitprotected |
NOT_RWSE enum value | libsemigroups::Element | |
operator<(Element const &that) const override | libsemigroups::ElementWithVectorData< TValueType, MatrixOverSemiring< TValueType > > | inlinevirtual |
operator==(Element const &that) const override | libsemigroups::ElementWithVectorData< TValueType, MatrixOverSemiring< TValueType > > | inlinevirtual |
operator[](size_t pos) const | libsemigroups::ElementWithVectorData< TValueType, MatrixOverSemiring< TValueType > > | inline |
really_copy(size_t increase_deg_by=0) const override | libsemigroups::MatrixOverSemiringBase< TValueType, MatrixOverSemiring< TValueType > > | inlinevirtual |
really_delete() override | libsemigroups::ElementWithVectorData< TValueType, MatrixOverSemiring< TValueType > > | inlinevirtual |
redefine(Element const *x, Element const *y) override | libsemigroups::MatrixOverSemiringBase< TValueType, MatrixOverSemiring< TValueType > > | inlinevirtual |
ElementWithVectorDataDefaultHash< TValueType, MatrixOverSemiring< TValueType > >::redefine(Element const *x, Element const *y, size_t const &thread_id) | libsemigroups::Element | inlinevirtual |
reset_hash_value() const | libsemigroups::Element | inlineprotected |
RWSE enum value | libsemigroups::Element | |
semiring() const | libsemigroups::MatrixOverSemiringBase< TValueType, MatrixOverSemiring< TValueType > > | inline |
swap(Element *x) override | libsemigroups::ElementWithVectorData< TValueType, MatrixOverSemiring< TValueType > > | inlinevirtual |
UNDEFINED | libsemigroups::Element | protectedstatic |
vector_hash(std::vector< T > const *vec) | libsemigroups::ElementWithVectorData< TValueType, MatrixOverSemiring< TValueType > > | inlineprotectedstatic |
~Element() | libsemigroups::Element | inlinevirtual |
- libsemigroups
-
- |
-
Matrices over a semiring. - More...
- -#include <elements.h>
-Friends | |
-class | ElementWithVectorData< TValueType, MatrixOverSemiring< TValueType > > |
-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... | |
Public Member Functions inherited from libsemigroups::MatrixOverSemiringBase< TValueType, MatrixOverSemiring< TValueType > > | |
MatrixOverSemiringBase (std::vector< TValueType > *matrix, Semiring< TValueType > const *semiring) | |
A constructor. More... | |
MatrixOverSemiringBase (std::vector< std::vector< TValueType >> const &matrix, Semiring< TValueType > const *semiring) | |
A constructor. More... | |
size_t | complexity () const override |
Returns the approximate time complexity of multiplying two matrices. More... | |
size_t | degree () const override |
Returns the dimension of the matrix. More... | |
Element * | identity () const override |
Returns the identity matrix with dimension of this . More... | |
Element * | really_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... | |
Semiring< TValueType > const * | semiring () const |
Returns a pointer to the Semiring over which the matrix is defined. More... | |
Public Member Functions inherited from libsemigroups::ElementWithVectorData< TValueType, MatrixOverSemiring< TValueType > > | |
ElementWithVectorData () | |
A constructor. More... | |
ElementWithVectorData (std::vector< TValueType > *vector) | |
A constructor. More... | |
ElementWithVectorData (std::vector< TValueType > const &vector) | |
A constructor. More... | |
TValueType | at (size_t pos) const |
Returns the pos entry in the vector containing the defining data. More... | |
std::vector< TValueType >::iterator | begin () const |
Returns an iterator. More... | |
std::vector< TValueType >::iterator | cbegin () const |
Returns a const iterator. More... | |
std::vector< TValueType >::iterator | cend () const |
Returns a const iterator. More... | |
void | copy (Element const *x) override |
Copy another Element into this . More... | |
std::vector< TValueType >::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... | |
TValueType | operator[] (size_t pos) const |
Returns the pos entry in the vector containing the defining data. 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 inherited from libsemigroups::MatrixOverSemiringBase< TValueType, MatrixOverSemiring< TValueType > > | |
MatrixOverSemiringBase (std::vector< TValueType > *matrix) | |
Constructs a MatrixOverSemiringBase with whose underlying semiring is not defined. The underlying semiring must be set by any class deriving from this one. More... | |
Protected Member Functions inherited from libsemigroups::ElementWithVectorDataDefaultHash< TValueType, MatrixOverSemiring< TValueType > > | |
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< TValueType, MatrixOverSemiring< TValueType > > | |
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< TValueType, MatrixOverSemiring< TValueType > > | |
std::vector< TValueType > * | _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... | |
Matrices over a semiring.
-This class is partial specialization of MatrixOverSemiringBase that has only one template parameter TValueType
, and that uses MatrixOverSemiring<TValueType> as the second template parameter for MatrixOverSemiringBase.
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::MatrixOverSemiringBase< TValueType, TSubclass >, including all inherited members.
-_vector | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | protected |
at(size_t pos) const | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inline |
begin() const | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inline |
cache_hash_value() const override | libsemigroups::ElementWithVectorDataDefaultHash< TValueType, TSubclass > | inlineprotectedvirtual |
cbegin() const | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inline |
cend() const | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inline |
complexity() const override | libsemigroups::MatrixOverSemiringBase< TValueType, TSubclass > | inlinevirtual |
copy(Element const *x) override | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlinevirtual |
degree() const override | libsemigroups::MatrixOverSemiringBase< TValueType, TSubclass > | inlinevirtual |
Element(elm_t type=Element::elm_t::NOT_RWSE) | libsemigroups::Element | inlineexplicit |
ElementWithVectorData() | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inline |
ElementWithVectorData(std::vector< TValueType > *vector) | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlineexplicit |
ElementWithVectorData(std::vector< TValueType > const &vector) | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlineexplicit |
ElementWithVectorData< TValueType, TSubclass > (defined in libsemigroups::MatrixOverSemiringBase< TValueType, TSubclass >) | libsemigroups::MatrixOverSemiringBase< TValueType, TSubclass > | friend |
elm_t enum name | libsemigroups::Element | |
end() const | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inline |
get_type() const | libsemigroups::Element | inline |
hash_value() const | libsemigroups::Element | inline |
identity() const override | libsemigroups::MatrixOverSemiringBase< TValueType, TSubclass > | inlinevirtual |
MatrixOverSemiringBase(std::vector< TValueType > *matrix, Semiring< TValueType > const *semiring) | libsemigroups::MatrixOverSemiringBase< TValueType, TSubclass > | inline |
MatrixOverSemiringBase(std::vector< std::vector< TValueType >> const &matrix, Semiring< TValueType > const *semiring) | libsemigroups::MatrixOverSemiringBase< TValueType, TSubclass > | inline |
MatrixOverSemiringBase(std::vector< TValueType > *matrix) | libsemigroups::MatrixOverSemiringBase< TValueType, TSubclass > | inlineexplicitprotected |
NOT_RWSE enum value | libsemigroups::Element | |
operator<(Element const &that) const override | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlinevirtual |
operator==(Element const &that) const override | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlinevirtual |
operator[](size_t pos) const | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inline |
really_copy(size_t increase_deg_by=0) const override | libsemigroups::MatrixOverSemiringBase< TValueType, TSubclass > | inlinevirtual |
really_delete() override | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlinevirtual |
redefine(Element const *x, Element const *y) override | libsemigroups::MatrixOverSemiringBase< TValueType, TSubclass > | inlinevirtual |
libsemigroups::ElementWithVectorDataDefaultHash::redefine(Element const *x, Element const *y, size_t const &thread_id) | libsemigroups::Element | inlinevirtual |
reset_hash_value() const | libsemigroups::Element | inlineprotected |
RWSE enum value | libsemigroups::Element | |
semiring() const | libsemigroups::MatrixOverSemiringBase< TValueType, TSubclass > | inline |
swap(Element *x) override | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlinevirtual |
UNDEFINED | libsemigroups::Element | protectedstatic |
vector_hash(std::vector< T > const *vec) | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlineprotectedstatic |
~Element() | libsemigroups::Element | inlinevirtual |
- libsemigroups
-
- |
-
Matrices over a semiring. - More...
- -#include <elements.h>
-Public Member Functions | |
MatrixOverSemiringBase (std::vector< TValueType > *matrix, Semiring< TValueType > const *semiring) | |
A constructor. More... | |
MatrixOverSemiringBase (std::vector< std::vector< TValueType >> const &matrix, Semiring< TValueType > const *semiring) | |
A constructor. More... | |
size_t | complexity () const override |
Returns the approximate time complexity of multiplying two matrices. More... | |
size_t | degree () const override |
Returns the dimension of the matrix. More... | |
Element * | identity () const override |
Returns the identity matrix with dimension of this . More... | |
Element * | really_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... | |
Semiring< TValueType > const * | semiring () const |
Returns a pointer to the Semiring over which the matrix is defined. More... | |
Public Member Functions inherited from libsemigroups::ElementWithVectorData< TValueType, TSubclass > | |
ElementWithVectorData () | |
A constructor. More... | |
ElementWithVectorData (std::vector< TValueType > *vector) | |
A constructor. More... | |
ElementWithVectorData (std::vector< TValueType > const &vector) | |
A constructor. More... | |
TValueType | at (size_t pos) const |
Returns the pos entry in the vector containing the defining data. More... | |
std::vector< TValueType >::iterator | begin () const |
Returns an iterator. More... | |
std::vector< TValueType >::iterator | cbegin () const |
Returns a const iterator. More... | |
std::vector< TValueType >::iterator | cend () const |
Returns a const iterator. More... | |
void | copy (Element const *x) override |
Copy another Element into this . More... | |
std::vector< TValueType >::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... | |
TValueType | operator[] (size_t pos) const |
Returns the pos entry in the vector containing the defining data. 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 | |
MatrixOverSemiringBase (std::vector< TValueType > *matrix) | |
Constructs a MatrixOverSemiringBase with whose underlying semiring is not defined. The underlying semiring must be set by any class deriving from this one. More... | |
Protected Member Functions inherited from libsemigroups::ElementWithVectorDataDefaultHash< TValueType, TSubclass > | |
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... | |
-Friends | |
-class | ElementWithVectorData< TValueType, TSubclass > |
-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< TValueType, TSubclass > | |
template<typename 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< TValueType, TSubclass > | |
std::vector< TValueType > * | _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... | |
Matrices over a semiring.
-This class is abstract since it does not implement all methods required by the Element class, it exists to provide common methods for its subclasses.
-The template parameter TValueType
is the type of the entries in the matrix, which must also be the type of the corresponding template parameter for the Semiring object used to define an instance of a MatrixOverSemiringBase.
The template parameter TSubclass
is the type of a subclass of MatrixOverSemiringBase, and it is used so that it can be passed to ElementWithVectorData, whose method ElementWithVectorData::identity returns an instance of TSubclass
.
-
|
- -inline | -
A constructor.
-Constructs a matrix defined by matrix
, matrix
is not copied, and should be deleted using ElementWithVectorData::really_delete.
The parameter matrix
should be a vector of integer values of length \(n ^ 2\) for some integer \(n\), so that the value in position \(in + j\) is the entry in the \(i\)th row and \(j\)th column of the constructed matrix.
The parameter semiring
should be a pointer to a Semiring, which is the semiring over which the matrix is defined.
This method asserts that the paramater semiring
is not a nullptr, that the vector matrix
has size a non-zero perfect square.
-
|
- -inline | -
A constructor.
-Constructs a matrix defined by matrix
, which is copied into the constructed object.
The parameter matrix
should be a vector of integer values of length \(n ^ 2\) for some integer \(n\), so that the value in position \(in + j\) is the entry in the \(i\)th row and \(j\)th column of the constructed matrix.
The parameter semiring
should be a pointer to a Semiring, which is the semiring over which the matrix is defined.
This method asserts that the paramater semiring
is not a nullptr, that the vector matrix
is not empty, and that every vector contained in matrix
has the same length as matrix
.
Note that it is the responsibility of the caller to delete the parameter semiring
, and that this should only be done after every MatrixOverSemiringBase object that was constructed using semiring
has been deleted.
-
|
- -inlineexplicitprotected | -
Constructs a MatrixOverSemiringBase with whose underlying semiring is not defined. The underlying semiring must be set by any class deriving from this one.
- -
-
|
- -inlineoverridevirtual | -
Returns the approximate time complexity of multiplying two matrices.
-The approximate time complexity of multiplying matrices is \(n ^ 3\) where \(n\) is the dimension of the matrix.
- -Implements libsemigroups::Element.
- -
-
|
- -inlineoverridevirtual | -
Returns the dimension of the matrix.
-The dimension of a matrix is just the number of rows (or, equivalently columns).
- -Implements libsemigroups::Element.
- -
-
|
- -inlineoverridevirtual | -
Returns the identity matrix with dimension of this
.
This method returns a new matrix with dimension equal to that of this
, where the main diagonal consists of the value Semiring::one and every other entry Semiring::zero.
Implements libsemigroups::Element.
- -
-
|
- -inlineoverridevirtual | -
Returns a pointer to a copy of this
.
The parameter increase_deg_by
must be 0, since it does not make sense to increase the degree of a matrix.
Reimplemented from libsemigroups::ElementWithVectorData< TValueType, TSubclass >.
- -
-
|
- -inlineoverridevirtual | -
Multiply x
and y
and stores the result in this
.
This method asserts that the degrees of x
, y
, and this
, are all equal, and that neither x
nor y
equals this
. It does not currently verify that x
, y
, and this
are defined over the same semiring.
Reimplemented from libsemigroups::Element.
- -
-
|
- -inline | -
Returns a pointer to the Semiring over which the matrix is defined.
- -
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::MaxPlusSemiring, including all inherited members.
-INFTY | libsemigroups::Semiring< int64_t > | static |
MaxPlusSemiring() (defined in libsemigroups::MaxPlusSemiring) | libsemigroups::MaxPlusSemiring | inline |
MINUS_INFTY | libsemigroups::Semiring< int64_t > | static |
one() const override | libsemigroups::MaxPlusSemiring | inlinevirtual |
plus(int64_t x, int64_t y) const override | libsemigroups::MaxPlusSemiring | inlinevirtual |
prod(int64_t x, int64_t y) const override | libsemigroups::MaxPlusSemiring | inlinevirtual |
UNDEFINED | libsemigroups::Semiring< int64_t > | static |
zero() const override | libsemigroups::MaxPlusSemiring | inlinevirtual |
~Semiring() | libsemigroups::Semiring< int64_t > | inlinevirtual |
- libsemigroups
-
- |
-
The max-plus semiring consists of the integers together with negative infinity with operations max and plus. Negative infinity is represented by Semiring<int64_t>::MINUS_INFTY. - More...
- -#include <semiring.h>
-Public Member Functions | |
int64_t | one () const override |
Returns the integer 0. More... | |
int64_t | plus (int64_t x, int64_t y) const override |
Returns the maximum of x and y . More... | |
int64_t | prod (int64_t x, int64_t y) const override |
Returns Semiring<int64_t>::MINUS_INFTY if x or y equals Semiring<int64_t>::MINUS_INFTY, otherwise returns x + y . More... | |
int64_t | zero () const override |
Returns Semiring<int64_t>::MINUS_INFTY. More... | |
Public Member Functions inherited from libsemigroups::Semiring< int64_t > | |
virtual | ~Semiring () |
A default destructor. More... | |
-Additional Inherited Members | |
Static Public Attributes inherited from libsemigroups::Semiring< int64_t > | |
static const int64_t | INFTY |
Value representing \(\infty\). More... | |
static const int64_t | MINUS_INFTY |
Value representing \(-\infty\). More... | |
static const int64_t | UNDEFINED |
Value representing an undefined quantity. More... | |
The max-plus semiring consists of the integers together with negative infinity with operations max and plus. Negative infinity is represented by Semiring<int64_t>::MINUS_INFTY.
-
-
|
- -inlineoverridevirtual | -
Returns the integer 0.
- -Implements libsemigroups::Semiring< int64_t >.
- -
-
|
- -inlineoverridevirtual | -
Returns the maximum of x
and y
.
Implements libsemigroups::Semiring< int64_t >.
- -
-
|
- -inlineoverridevirtual | -
Returns Semiring<int64_t>::MINUS_INFTY if x
or y
equals Semiring<int64_t>::MINUS_INFTY, otherwise returns x
+ y
.
Implements libsemigroups::Semiring< int64_t >.
- -
-
|
- -inlineoverridevirtual | -
Returns Semiring<int64_t>::MINUS_INFTY.
- -Implements libsemigroups::Semiring< int64_t >.
- -
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::MinPlusSemiring, including all inherited members.
-INFTY | libsemigroups::Semiring< int64_t > | static |
MinPlusSemiring() (defined in libsemigroups::MinPlusSemiring) | libsemigroups::MinPlusSemiring | inline |
MINUS_INFTY | libsemigroups::Semiring< int64_t > | static |
one() const override | libsemigroups::MinPlusSemiring | inlinevirtual |
plus(int64_t x, int64_t y) const override | libsemigroups::MinPlusSemiring | inlinevirtual |
prod(int64_t x, int64_t y) const override | libsemigroups::MinPlusSemiring | inlinevirtual |
UNDEFINED | libsemigroups::Semiring< int64_t > | static |
zero() const override | libsemigroups::MinPlusSemiring | inlinevirtual |
~Semiring() | libsemigroups::Semiring< int64_t > | inlinevirtual |
- libsemigroups
-
- |
-
The min-plus semiring consists of the integers together with infinity with operations min and plus. Infinity is represented by Semiring<int64_t>::INFTY. - More...
- -#include <semiring.h>
-Public Member Functions | |
int64_t | one () const override |
Returns the integer 0. More... | |
int64_t | plus (int64_t x, int64_t y) const override |
Returns the minimum of x and y . More... | |
int64_t | prod (int64_t x, int64_t y) const override |
Returns Semiring<int64_t>::INFTY if x or y equals Semiring<int64_t>::INFTY, otherwise returns x + y . More... | |
int64_t | zero () const override |
Returns Semiring<int64_t>::INFTY. More... | |
Public Member Functions inherited from libsemigroups::Semiring< int64_t > | |
virtual | ~Semiring () |
A default destructor. More... | |
-Additional Inherited Members | |
Static Public Attributes inherited from libsemigroups::Semiring< int64_t > | |
static const int64_t | INFTY |
Value representing \(\infty\). More... | |
static const int64_t | MINUS_INFTY |
Value representing \(-\infty\). More... | |
static const int64_t | UNDEFINED |
Value representing an undefined quantity. More... | |
The min-plus semiring consists of the integers together with infinity with operations min and plus. Infinity is represented by Semiring<int64_t>::INFTY.
-
-
|
- -inlineoverridevirtual | -
Returns the integer 0.
- -Implements libsemigroups::Semiring< int64_t >.
- -
-
|
- -inlineoverridevirtual | -
Returns the minimum of x
and y
.
Implements libsemigroups::Semiring< int64_t >.
- -
-
|
- -inlineoverridevirtual | -
Returns Semiring<int64_t>::INFTY if x
or y
equals Semiring<int64_t>::INFTY, otherwise returns x
+ y
.
Implements libsemigroups::Semiring< int64_t >.
- -
-
|
- -inlineoverridevirtual | -
Returns Semiring<int64_t>::INFTY.
- -Implements libsemigroups::Semiring< int64_t >.
- -
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::NaturalSemiring, including all inherited members.
-INFTY | libsemigroups::Semiring< int64_t > | static |
MINUS_INFTY | libsemigroups::Semiring< int64_t > | static |
NaturalSemiring(int64_t t, int64_t p) | libsemigroups::NaturalSemiring | inline |
one() const override | libsemigroups::NaturalSemiring | inlinevirtual |
period() const | libsemigroups::NaturalSemiring | inline |
plus(int64_t x, int64_t y) const override | libsemigroups::NaturalSemiring | inlinevirtual |
prod(int64_t x, int64_t y) const override | libsemigroups::NaturalSemiring | inlinevirtual |
SemiringWithThreshold(int64_t threshold) | libsemigroups::SemiringWithThreshold | inlineexplicit |
threshold() const | libsemigroups::SemiringWithThreshold | inline |
UNDEFINED | libsemigroups::Semiring< int64_t > | static |
zero() const override | libsemigroups::NaturalSemiring | inlinevirtual |
~Semiring() | libsemigroups::Semiring< int64_t > | inlinevirtual |
- libsemigroups
-
- |
-
This class implements the semiring consisting of \(\{0, 1, ..., t, t + 1, ..., t + p - 1\}\) for some threshold \(t\) and period \(p\) with operations addition and multiplication modulo the congruence \(t = t + p\). - More...
- -#include <semiring.h>
-Public Member Functions | |
NaturalSemiring (int64_t t, int64_t p) | |
Construct from threshold and period. More... | |
int64_t | one () const override |
Return the integer 1. More... | |
int64_t | period () const |
Returns the period of the semiring. More... | |
int64_t | plus (int64_t x, int64_t y) const override |
Returns x + y modulo the congruence \(t = t + p\) where \(t\) and \(p\) are the threshold and period of the semiring, respectively. More... | |
int64_t | prod (int64_t x, int64_t y) const override |
Returns x * y modulo the congruence \(t = t + p\) where \(t\) and \(p\) are the threshold and period of the semiring, respectively. More... | |
int64_t | zero () const override |
Return the integer 0. More... | |
Public Member Functions inherited from libsemigroups::SemiringWithThreshold | |
SemiringWithThreshold (int64_t threshold) | |
A class for semirings with a threshold. More... | |
int64_t | threshold () const |
Returns the threshold of a semiring with threshold. More... | |
Public Member Functions inherited from libsemigroups::Semiring< int64_t > | |
virtual | ~Semiring () |
A default destructor. More... | |
-Additional Inherited Members | |
Static Public Attributes inherited from libsemigroups::Semiring< int64_t > | |
static const int64_t | INFTY |
Value representing \(\infty\). More... | |
static const int64_t | MINUS_INFTY |
Value representing \(-\infty\). More... | |
static const int64_t | UNDEFINED |
Value representing an undefined quantity. More... | |
This class implements the semiring consisting of \(\{0, 1, ..., t, t + 1, ..., t + p - 1\}\) for some threshold \(t\) and period \(p\) with operations addition and multiplication modulo the congruence \(t = t + p\).
-
-
|
- -inline | -
Construct from threshold and period.
-This method constructs a semiring whose elements are \(\{0, 1, ..., t, t + 1, ..., t + p - 1\}\) with operations addition and multiplication modulo the congruence \(t = t + p\).
-The parameter t
should be greater than or equal to 0, and the parameter p
must be strictly greater than 0, both which are asserted in the constructor.
-
|
- -inlineoverridevirtual | -
Return the integer 1.
- -Implements libsemigroups::Semiring< int64_t >.
- -
-
|
- -inline | -
Returns the period of the semiring.
- -
-
|
- -inlineoverridevirtual | -
Returns x
+ y
modulo the congruence \(t = t + p\) where \(t\) and \(p\) are the threshold and period of the semiring, respectively.
Implements libsemigroups::Semiring< int64_t >.
- -
-
|
- -inlineoverridevirtual | -
Returns x
* y
modulo the congruence \(t = t + p\) where \(t\) and \(p\) are the threshold and period of the semiring, respectively.
Implements libsemigroups::Semiring< int64_t >.
- -
-
|
- -inlineoverridevirtual | -
Return the integer 0.
- -Implements libsemigroups::Semiring< int64_t >.
- -
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::PBR, including all inherited members.
-_vector | libsemigroups::ElementWithVectorData< std::vector< u_int32_t >, PBR > | protected |
at(size_t pos) const | libsemigroups::ElementWithVectorData< std::vector< u_int32_t >, PBR > | inline |
begin() const | libsemigroups::ElementWithVectorData< std::vector< u_int32_t >, PBR > | inline |
cache_hash_value() const override | libsemigroups::PBR | protectedvirtual |
cbegin() const | libsemigroups::ElementWithVectorData< std::vector< u_int32_t >, PBR > | inline |
cend() const | libsemigroups::ElementWithVectorData< std::vector< u_int32_t >, PBR > | inline |
complexity() const override | libsemigroups::PBR | virtual |
copy(Element const *x) override | libsemigroups::ElementWithVectorData< std::vector< u_int32_t >, PBR > | inlinevirtual |
degree() const override | libsemigroups::PBR | virtual |
Element(elm_t type=Element::elm_t::NOT_RWSE) | libsemigroups::Element | inlineexplicit |
ElementWithVectorData() | libsemigroups::ElementWithVectorData< std::vector< u_int32_t >, PBR > | inline |
ElementWithVectorData(std::vector< std::vector< u_int32_t > > *vector) | libsemigroups::ElementWithVectorData< std::vector< u_int32_t >, PBR > | inlineexplicit |
ElementWithVectorData(std::vector< std::vector< u_int32_t > > const &vector) | libsemigroups::ElementWithVectorData< std::vector< u_int32_t >, PBR > | inlineexplicit |
elm_t enum name | libsemigroups::Element | |
end() const | libsemigroups::ElementWithVectorData< std::vector< u_int32_t >, PBR > | inline |
get_type() const | libsemigroups::Element | inline |
hash_value() const | libsemigroups::Element | inline |
identity() const override | libsemigroups::PBR | virtual |
NOT_RWSE enum value | libsemigroups::Element | |
operator<(Element const &that) const override | libsemigroups::ElementWithVectorData< std::vector< u_int32_t >, PBR > | inlinevirtual |
operator==(Element const &that) const override | libsemigroups::ElementWithVectorData< std::vector< u_int32_t >, PBR > | inlinevirtual |
operator[](size_t pos) const | libsemigroups::ElementWithVectorData< std::vector< u_int32_t >, PBR > | inline |
really_copy(size_t increase_deg_by=0) const override | libsemigroups::ElementWithVectorData< std::vector< u_int32_t >, PBR > | inlinevirtual |
really_delete() override | libsemigroups::ElementWithVectorData< std::vector< u_int32_t >, PBR > | inlinevirtual |
redefine(Element const *x, Element const *y, size_t const &thread_id) override | libsemigroups::PBR | virtual |
ElementWithVectorData< std::vector< u_int32_t >, PBR >::redefine(Element const *x, Element const *y) | libsemigroups::Element | inlinevirtual |
reset_hash_value() const | libsemigroups::Element | inlineprotected |
RWSE enum value | libsemigroups::Element | |
swap(Element *x) override | libsemigroups::ElementWithVectorData< std::vector< u_int32_t >, PBR > | inlinevirtual |
UNDEFINED | libsemigroups::Element | protectedstatic |
vector_hash(std::vector< T > const *vec) | libsemigroups::ElementWithVectorData< std::vector< u_int32_t >, PBR > | inlineprotectedstatic |
~Element() | libsemigroups::Element | inlinevirtual |
- libsemigroups
-
- |
-
Class for partitioned binary relations (PBR). - More...
- -#include <elements.h>
-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... | |
Element * | identity () 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... | |
Element * | really_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... | |
Class for partitioned binary relations (PBR).
-Partitioned binary relations (PBRs) are a generalisation of bipartitions, which were introduced by Martin and Mazorchuk.
-
-
|
- -overrideprotectedvirtual | -
Calculate and cache a hash value.
-This method is used to compute and cache the hash value of this
.
Implements libsemigroups::Element.
- -
-
|
- -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.
- -
-
|
- -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.
- -
-
|
- -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.
- -
-
|
- -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.
- -
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::PPerm< TValueType, TContainer >, including all inherited members.
-in_place_product(PPerm const &x, PPerm const &y) override | libsemigroups::PPerm< TValueType, TContainer > | inline |
left_one() const (defined in libsemigroups::PPerm< TValueType, TContainer >) | libsemigroups::PPerm< TValueType, TContainer > | inline |
PPerm(TContainer const &dom, TContainer const &ran, size_t deg) | libsemigroups::PPerm< TValueType, TContainer > | inline |
PPerm(std::initializer_list< TValueType > dom, std::initializer_list< TValueType > ran, size_t deg) | libsemigroups::PPerm< TValueType, TContainer > | inline |
right_one() const (defined in libsemigroups::PPerm< TValueType, TContainer >) | libsemigroups::PPerm< TValueType, TContainer > | inline |
- libsemigroups
-
- |
-
Template class for partial permutations. - More...
- -#include <transf.hpp>
Inherits libsemigroups::PTransf< TValueType, TContainer >.
--Public Member Functions | |
PPerm (TContainer const &dom, TContainer const &ran, size_t deg) | |
A constructor. More... | |
PPerm (std::initializer_list< TValueType > dom, std::initializer_list< TValueType > ran, size_t deg) | |
A constructor. More... | |
void | in_place_product (PPerm const &x, PPerm const &y) override |
Validates the data defining this . More... | |
-PPerm< TValueType > | left_one () const |
-PPerm< TValueType, TContainer > | right_one () const |
Template class for partial permutations.
-The value of the template parameter T
can be used to reduce the amount of memory required by instances of this class; see PTransformation and ElementWithVectorData for more details.
A partial permutation \(f\) is just an injective partial transformation, which is stored as a vector of the images of \(\{0, 1, \ldots, n - 1\}\), i.e. i.e. \(\{(0)f, (1)f, \ldots, (n - 1)f\}\) where the value PTransformation::UNDEFINED is used to indicate that \((i)f\) is undefined (i.e. not among the points where \(f\) is defined).
-
-
|
- -inline | -
A constructor.
-Constructs a partial perm of degree deg
such that
for all i
and which is undefined on every other value in the range 0 to (strictly less than deg
). This method asserts that dom
and ran
have equal size and that deg
is greater than to the maximum value in dom
or ran
.
-
|
- -inline | -
A constructor.
-Constructs vectors from dom
and ran
and uses the constructor above.
-
|
- -inlineoverride | -
Validates the data defining this
.
This method throws a LIBSEMIGROUPS_EXCEPTION if any value of this
is out of bounds (i.e. greater than or equal to this->degree()
), and not equal to PPerm::UNDEFINED), or if any image appears more than once. 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
.
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::PartialPerm< T >, including all inherited members.
-_vector | libsemigroups::ElementWithVectorData< T, PartialPerm< T > > | protected |
at(size_t pos) const | libsemigroups::ElementWithVectorData< T, PartialPerm< T > > | inline |
begin() const | libsemigroups::ElementWithVectorData< T, PartialPerm< T > > | inline |
cache_hash_value() const override | libsemigroups::ElementWithVectorDataDefaultHash< T, PartialPerm< T > > | inlineprotectedvirtual |
cbegin() const | libsemigroups::ElementWithVectorData< T, PartialPerm< T > > | inline |
cend() const | libsemigroups::ElementWithVectorData< T, PartialPerm< T > > | inline |
complexity() const override | libsemigroups::PartialTransformation< T, PartialPerm< T > > | inlinevirtual |
copy(Element const *x) override | libsemigroups::ElementWithVectorData< T, PartialPerm< T > > | inlinevirtual |
crank() const | libsemigroups::PartialPerm< T > | inline |
degree() const override | libsemigroups::PartialTransformation< T, PartialPerm< T > > | inlinevirtual |
Element(elm_t type=Element::elm_t::NOT_RWSE) | libsemigroups::Element | inlineexplicit |
ElementWithVectorData() | libsemigroups::ElementWithVectorData< T, PartialPerm< T > > | inline |
ElementWithVectorData(std::vector< T > *vector) | libsemigroups::ElementWithVectorData< T, PartialPerm< T > > | inlineexplicit |
ElementWithVectorData(std::vector< T > const &vector) | libsemigroups::ElementWithVectorData< T, PartialPerm< T > > | inlineexplicit |
elm_t enum name | libsemigroups::Element | |
end() const | libsemigroups::ElementWithVectorData< T, PartialPerm< T > > | inline |
get_type() const | libsemigroups::Element | inline |
hash_value() const | libsemigroups::Element | inline |
identity() const override | libsemigroups::PartialTransformation< T, PartialPerm< T > > | inlinevirtual |
NOT_RWSE enum value | libsemigroups::Element | |
operator<(const Element &that) const override | libsemigroups::PartialPerm< T > | inlinevirtual |
operator==(Element const &that) const override | libsemigroups::ElementWithVectorData< T, PartialPerm< T > > | inlinevirtual |
operator[](size_t pos) const | libsemigroups::ElementWithVectorData< T, PartialPerm< T > > | inline |
PartialPerm(std::vector< T > const &dom, std::vector< T > const &ran, size_t deg) | libsemigroups::PartialPerm< T > | inlineexplicit |
really_copy(size_t increase_deg_by=0) const override | libsemigroups::PartialPerm< T > | inlinevirtual |
really_delete() override | libsemigroups::ElementWithVectorData< T, PartialPerm< T > > | inlinevirtual |
redefine(Element const *x, Element const *y) override | libsemigroups::PartialPerm< T > | inlinevirtual |
PartialTransformation< T, PartialPerm< T > >::redefine(Element const *x, Element const *y, size_t const &thread_id) | libsemigroups::Element | inlinevirtual |
reset_hash_value() const | libsemigroups::Element | inlineprotected |
RWSE enum value | libsemigroups::Element | |
swap(Element *x) override | libsemigroups::ElementWithVectorData< T, PartialPerm< T > > | inlinevirtual |
UNDEFINED | libsemigroups::PartialTransformation< T, PartialPerm< T > > | static |
vector_hash(std::vector< T > const *vec) | libsemigroups::ElementWithVectorData< T, PartialPerm< T > > | inlineprotectedstatic |
~Element() | libsemigroups::Element | inlinevirtual |
- libsemigroups
-
- |
-
Template class for partial permutations. - More...
- -#include <elements.h>
-Public Member Functions | |
PartialPerm (std::vector< T > const &dom, std::vector< T > const &ran, size_t deg) | |
A constructor. More... | |
size_t | crank () const |
Returns the rank of a partial permutation. More... | |
bool | operator< (const Element &that) const override |
Returns true if this is less than that . More... | |
Element * | really_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, PartialPerm< 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... | |
Element * | identity () const override |
Returns the identity transformation with degrees of this . More... | |
Public Member Functions inherited from libsemigroups::ElementWithVectorData< T, PartialPerm< T > > | |
ElementWithVectorData () | |
A constructor. More... | |
ElementWithVectorData (std::vector< T > *vector) | |
A constructor. More... | |
ElementWithVectorData (std::vector< T > const &vector) | |
A constructor. More... | |
T | 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... | |
T | operator[] (size_t pos) const |
Returns the pos entry in the vector containing the defining data. More... | |
Element * | really_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, PartialPerm< T > > | |
static T const | UNDEFINED |
Undefined image value. More... | |
Protected Member Functions inherited from libsemigroups::ElementWithVectorDataDefaultHash< T, PartialPerm< 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, PartialPerm< 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, PartialPerm< 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... | |
Template class for partial 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 partial permutation \(f\) is just an injective partial transformation, which is stored as a vector of the images of \(\{0, 1, \ldots, n - 1\}\), i.e. i.e. \(\{(0)f, (1)f, \ldots, (n - 1)f\}\) where the value PartialTransformation::UNDEFINED is used to indicate that \((i)f\) is undefined (i.e. not among the points where \(f\) is defined).
-
-
|
- -inlineexplicit | -
A constructor.
-Constructs a partial perm of degree deg
such that
for all i
and which is undefined on every other value in the range 0 to (strictly less than deg
). This method asserts that dom
and ran
have equal size and that deg
is greater than or equal to the maximum value in dom
or ran
.
-
|
- -inline | -
Returns the rank of a partial permutation.
-The rank of a partial permutation is the number of its distinct image values, not including PartialTransformation::UNDEFINED. This method involves slightly less work than PartialTransformation::crank since a partial permutation is injective, and so every image value occurs precisely once. This method recomputes the return value every time it is called.
- -
-
|
- -inlineoverridevirtual | -
Returns true
if this
is less than that
.
This defines a total order on partial permutations that is equivalent to that used by GAP. It is not short-lex on the list of images.
-Returns true
if something complicated is true
and false
if it is not.
Implements libsemigroups::Element.
- -
-
|
- -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 is undefined on all the values between the PartialPerm::degree of this
and increase_deg_by
.
Implements libsemigroups::Element.
- -
-
|
- -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.
- -
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::PartialTransformation< TValueType, TSubclass >, including all inherited members.
-_vector | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | protected |
at(size_t pos) const | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inline |
begin() const | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inline |
cache_hash_value() const override | libsemigroups::ElementWithVectorDataDefaultHash< TValueType, TSubclass > | inlineprotectedvirtual |
cbegin() const | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inline |
cend() const | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inline |
complexity() const override | libsemigroups::PartialTransformation< TValueType, TSubclass > | inlinevirtual |
copy(Element const *x) override | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlinevirtual |
crank() const | libsemigroups::PartialTransformation< TValueType, TSubclass > | inline |
degree() const override | libsemigroups::PartialTransformation< TValueType, TSubclass > | inlinevirtual |
Element(elm_t type=Element::elm_t::NOT_RWSE) | libsemigroups::Element | inlineexplicit |
ElementWithVectorData() | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inline |
ElementWithVectorData(std::vector< TValueType > *vector) | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlineexplicit |
ElementWithVectorData(std::vector< TValueType > const &vector) | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlineexplicit |
elm_t enum name | libsemigroups::Element | |
end() const | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inline |
get_type() const | libsemigroups::Element | inline |
hash_value() const | libsemigroups::Element | inline |
identity() const override | libsemigroups::PartialTransformation< TValueType, TSubclass > | inlinevirtual |
NOT_RWSE enum value | libsemigroups::Element | |
operator<(Element const &that) const override | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlinevirtual |
operator==(Element const &that) const override | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlinevirtual |
operator[](size_t pos) const | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inline |
really_copy(size_t increase_deg_by=0) const override | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlinevirtual |
really_delete() override | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlinevirtual |
redefine(Element const *x, Element const *y) | libsemigroups::Element | inlinevirtual |
redefine(Element const *x, Element const *y, size_t const &thread_id) | libsemigroups::Element | inlinevirtual |
reset_hash_value() const | libsemigroups::Element | inlineprotected |
RWSE enum value | libsemigroups::Element | |
swap(Element *x) override | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlinevirtual |
UNDEFINED | libsemigroups::PartialTransformation< TValueType, TSubclass > | static |
vector_hash(std::vector< T > const *vec) | libsemigroups::ElementWithVectorData< TValueType, TSubclass > | inlineprotectedstatic |
~Element() | libsemigroups::Element | inlinevirtual |
- libsemigroups
-
- |
-
Abstract class for partial transformations. - More...
- -#include <elements.h>
-Public Member Functions | |
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... | |
Element * | identity () const override |
Returns the identity transformation with degrees of this . More... | |
Public Member Functions inherited from libsemigroups::ElementWithVectorData< TValueType, TSubclass > | |
ElementWithVectorData () | |
A constructor. More... | |
ElementWithVectorData (std::vector< TValueType > *vector) | |
A constructor. More... | |
ElementWithVectorData (std::vector< TValueType > const &vector) | |
A constructor. More... | |
TValueType | at (size_t pos) const |
Returns the pos entry in the vector containing the defining data. More... | |
std::vector< TValueType >::iterator | begin () const |
Returns an iterator. More... | |
std::vector< TValueType >::iterator | cbegin () const |
Returns a const iterator. More... | |
std::vector< TValueType >::iterator | cend () const |
Returns a const iterator. More... | |
void | copy (Element const *x) override |
Copy another Element into this . More... | |
std::vector< TValueType >::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... | |
TValueType | operator[] (size_t pos) const |
Returns the pos entry in the vector containing the defining data. More... | |
Element * | really_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... | |
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... | |
-Static Public Attributes | |
static TValueType const | UNDEFINED = std::numeric_limits<TValueType>::max() |
Undefined image 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... | |
Protected Member Functions inherited from libsemigroups::ElementWithVectorDataDefaultHash< TValueType, TSubclass > | |
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< TValueType, TSubclass > | |
template<typename 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< TValueType, TSubclass > | |
std::vector< TValueType > * | _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... | |
Abstract class for partial transformations.
-This is a template class for partial transformations, which is a subclass of ElementWithVectorDataDefaultHash. For example, Transformation<u_int128_t> is a subclass of PartialTransformation<u_int128_t, Transformation<u_int128_t>>.
-The template parameter TValueType
is the type of image values, i.e. u_int16_t, and so on. The value of the template parameter S
can be used to reduce (or increase) the amount of memory required by instances of this class.
The template parameter TSubclass
is the subclass of PartialTransformation used by the PartialTransformation::identity method to construct an identity, so that the return value of the method PartialTransformation::identity is of type TSubclass
instead of type PartialTransformation.
This class is abstract since it does not implement all methods required by the Element class, it exists to provide common methods for its subclasses.
-A partial transformation \(f\) is just a function defined on a subset of \(\{0, 1, \ldots, n - 1\}\) for some integer \(n\) called the degree of f. A partial 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\}\) where the value PartialTransformation::UNDEFINED is used to indicate that \((i)f\) is, you guessed it, undefined (i.e. not among the points where \(f\) is defined).
-
-
|
- -inlineoverridevirtual | -
Returns the approximate time complexity of multiplying two partial transformations.
-The approximate time complexity of multiplying partial transformations is just their degree.
- -Implements libsemigroups::Element.
- -
-
|
- -inline | -
Returns the rank of a partial transformation.
-The rank of a partial transformation is the number of its distinct image values, not including PartialTransformation::UNDEFINED. This method recomputes the return value every time it is called.
- -
-
|
- -inlineoverridevirtual | -
Returns the degree of a partial transformation.
-The degree of a partial transformation is the number of points used in its definition, which is equal to the size of ElementWithVectorData::_vector.
- -Implements libsemigroups::Element.
- -
-
|
- -inlineoverridevirtual | -
Returns the identity transformation with degrees of this
.
This method returns a new partial transformation with degree equal to the degree of this
that fixes every value from 0 to the degree of this
.
Implements libsemigroups::Element.
- -
-
|
- -static | -
Undefined image value.
-This value is used to indicate that a partial transformation is not defined on a value.
- -
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::Partition< T >, including all inherited members.
-at(size_t part_index) const | libsemigroups::Partition< T > | inline |
at(size_t part_index, size_t elm_nr) const | libsemigroups::Partition< T > | inline |
operator=(Partition const &part)=delete | libsemigroups::Partition< T > | |
operator[](size_t part_index) const | libsemigroups::Partition< T > | inline |
Partition(size_t nr_parts=0) | libsemigroups::Partition< T > | inlineexplicit |
Partition(std::vector< std::vector< T * > * > *parts) | libsemigroups::Partition< T > | inlineexplicit |
Partition(Partition const ©)=delete | libsemigroups::Partition< T > | |
size() const | libsemigroups::Partition< T > | inline |
~Partition() | libsemigroups::Partition< T > | inline |
- libsemigroups
-
- |
-
Class for partitions of a set used by Congruence::nontrivial_classes. - More...
- -#include <partition.h>
-Public Member Functions | |
Partition (size_t nr_parts=0) | |
A constructor. More... | |
Partition (std::vector< std::vector< T * > * > *parts) | |
A constructor. More... | |
Partition (Partition const ©)=delete | |
The copy constructor is deleted for Partition to avoid unintended copying. More... | |
~Partition () | |
A default destructor. More... | |
std::vector< T * > * | at (size_t part_index) const |
Returns the part with index part_index . More... | |
T * | at (size_t part_index, size_t elm_nr) const |
Returns the element with index elm_nr in part part_index . More... | |
Partition & | operator= (Partition const &part)=delete |
The assignment operator is deleted for Partition to avoid unintended copying. More... | |
std::vector< T * > * | operator[] (size_t part_index) const |
Returns the part with index part_index . More... | |
size_t | size () const |
Returns the number of parts in the partition. More... | |
Class for partitions of a set used by Congruence::nontrivial_classes.
-This class is for representing a partition of a set, i.e. an equivalence relation on that set. The template parameter T
is the type of objects, pointers to which are stored in the partition.
-
|
- -inlineexplicit | -
A constructor.
-This constructor returns a partition with nr_parts
empty parts.
-
|
- -inlineexplicit | -
A constructor.
-This constructor returns the Partition defined by the given vector, which is not copied, and is deleted by the destructor of this class.
- -
-
|
- -inline | -
A default destructor.
-Deletes the vector and all of its contents passed to the constructor, if any.
- -
-
|
- -delete | -
The copy constructor is deleted for Partition to avoid unintended copying.
- -
-
|
- -inline | -
Returns the part with index part_index
.
This uses the at
method of the underlying std::vector, and so performs out-of-bounds checks.
-
|
- -inline | -
Returns the element with index elm_nr
in part part_index
.
-
|
- -delete | -
The assignment operator is deleted for Partition to avoid unintended copying.
- -
-
|
- -inline | -
Returns the part with index part_index
.
This method asserts that the parameter part_index
is less than the number of parts.
-
|
- -inline | -
Returns the number of parts in the partition.
- -
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::Perm< TValueType, TContainer >, including all inherited members.
-in_place_product(Transf const &x, Transf const &y) | libsemigroups::Transf< TValueType, TContainer > | inline |
inverse() const | libsemigroups::Perm< TValueType, TContainer > | inline |
- libsemigroups
-
- |
-
Template class for permutations. - More...
- -#include <transf.hpp>
-Public Member Functions | |
Perm | inverse () const |
Validates the data defining this . More... | |
Public Member Functions inherited from libsemigroups::Transf< TValueType, TContainer > | |
void | in_place_product (Transf const &x, Transf const &y) |
Multiply x and y and stores the result in this . More... | |
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 PTransfformation 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)\).
-
-
|
- -inline | -
Validates the data defining this
.
This method throws a LIBSEMIGROUPS_EXCEPTION if any value of this
is out of bounds (i.e. greater than or equal to this->degree()
), or if any image appears more than once. 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\).
- -
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::Permutation< T >, including all inherited members.
-_vector | libsemigroups::ElementWithVectorData< T, Transformation< T > > | protected |
at(size_t pos) const | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inline |
begin() const | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inline |
cache_hash_value() const override | libsemigroups::Transformation< T > | inlineprotectedvirtual |
cbegin() const | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inline |
cend() const | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inline |
complexity() const override | libsemigroups::PartialTransformation< T, Transformation< T > > | inlinevirtual |
copy(Element const *x) override | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inlinevirtual |
crank() const | libsemigroups::PartialTransformation< T, Transformation< T > > | inline |
degree() const override | libsemigroups::PartialTransformation< T, Transformation< T > > | inlinevirtual |
Element(elm_t type=Element::elm_t::NOT_RWSE) | libsemigroups::Element | inlineexplicit |
ElementWithVectorData() | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inline |
ElementWithVectorData(std::vector< T > *vector) | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inlineexplicit |
ElementWithVectorData(std::vector< T > const &vector) | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inlineexplicit |
elm_t enum name | libsemigroups::Element | |
end() const | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inline |
get_type() const | libsemigroups::Element | inline |
hash_value() const | libsemigroups::Element | inline |
identity() const override | libsemigroups::PartialTransformation< T, Transformation< T > > | inlinevirtual |
inverse() | libsemigroups::Permutation< T > | inline |
NOT_RWSE enum value | libsemigroups::Element | |
operator<(Element const &that) const override | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inlinevirtual |
operator==(Element const &that) const override | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inlinevirtual |
operator[](size_t pos) const | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inline |
really_copy(size_t increase_deg_by=0) const override | libsemigroups::Transformation< T > | inlinevirtual |
really_delete() override | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inlinevirtual |
redefine(Element const *x, Element const *y) override | libsemigroups::Transformation< T > | inlinevirtual |
PartialTransformation< T, Transformation< T > >::redefine(Element const *x, Element const *y, size_t const &thread_id) | libsemigroups::Element | inlinevirtual |
reset_hash_value() const | libsemigroups::Element | inlineprotected |
RWSE enum value | libsemigroups::Element | |
swap(Element *x) override | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inlinevirtual |
UNDEFINED | libsemigroups::PartialTransformation< T, Transformation< T > > | static |
vector_hash(std::vector< T > const *vec) | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inlineprotectedstatic |
~Element() | libsemigroups::Element | inlinevirtual |
- libsemigroups
-
- |
-
Template class for permutations. - More...
- -#include <elements.h>
-Public Member Functions | |
Permutation * | inverse () |
Returns the inverse of a permutation. More... | |
Public Member Functions inherited from libsemigroups::Transformation< T > | |
Element * | really_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... | |
Element * | identity () 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... | |
T | 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... | |
T | operator[] (size_t pos) const |
Returns the pos entry in the vector containing the defining data. More... | |
Element * | really_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... | |
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)\).
-
-
|
- -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\).
- -
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::ProjectiveMaxPlusMatrix, including all inherited members.
-_vector | libsemigroups::ElementWithVectorData< int64_t, ProjectiveMaxPlusMatrix > | protected |
at(size_t pos) const | libsemigroups::ElementWithVectorData< int64_t, ProjectiveMaxPlusMatrix > | inline |
begin() const | libsemigroups::ElementWithVectorData< int64_t, ProjectiveMaxPlusMatrix > | inline |
cache_hash_value() const override | libsemigroups::ElementWithVectorDataDefaultHash< int64_t, ProjectiveMaxPlusMatrix > | inlineprotectedvirtual |
cbegin() const | libsemigroups::ElementWithVectorData< int64_t, ProjectiveMaxPlusMatrix > | inline |
cend() const | libsemigroups::ElementWithVectorData< int64_t, ProjectiveMaxPlusMatrix > | inline |
complexity() const override | libsemigroups::MatrixOverSemiringBase< int64_t, ProjectiveMaxPlusMatrix > | inlinevirtual |
copy(Element const *x) override | libsemigroups::ElementWithVectorData< int64_t, ProjectiveMaxPlusMatrix > | inlinevirtual |
degree() const override | libsemigroups::MatrixOverSemiringBase< int64_t, ProjectiveMaxPlusMatrix > | inlinevirtual |
Element(elm_t type=Element::elm_t::NOT_RWSE) | libsemigroups::Element | inlineexplicit |
ElementWithVectorData() | libsemigroups::ElementWithVectorData< int64_t, ProjectiveMaxPlusMatrix > | inline |
ElementWithVectorData(std::vector< int64_t > *vector) | libsemigroups::ElementWithVectorData< int64_t, ProjectiveMaxPlusMatrix > | inlineexplicit |
ElementWithVectorData(std::vector< int64_t > const &vector) | libsemigroups::ElementWithVectorData< int64_t, ProjectiveMaxPlusMatrix > | inlineexplicit |
ElementWithVectorData< int64_t, ProjectiveMaxPlusMatrix > (defined in libsemigroups::ProjectiveMaxPlusMatrix) | libsemigroups::ProjectiveMaxPlusMatrix | friend |
elm_t enum name | libsemigroups::Element | |
end() const | libsemigroups::ElementWithVectorData< int64_t, ProjectiveMaxPlusMatrix > | inline |
get_type() const | libsemigroups::Element | inline |
hash_value() const | libsemigroups::Element | inline |
identity() const override | libsemigroups::MatrixOverSemiringBase< int64_t, ProjectiveMaxPlusMatrix > | inlinevirtual |
MatrixOverSemiringBase(std::vector< int64_t > *matrix, Semiring< int64_t > const *semiring) | libsemigroups::MatrixOverSemiringBase< int64_t, ProjectiveMaxPlusMatrix > | inline |
MatrixOverSemiringBase(std::vector< std::vector< int64_t >> const &matrix, Semiring< int64_t > const *semiring) | libsemigroups::MatrixOverSemiringBase< int64_t, ProjectiveMaxPlusMatrix > | inline |
MatrixOverSemiringBase(std::vector< int64_t > *matrix) | libsemigroups::MatrixOverSemiringBase< int64_t, ProjectiveMaxPlusMatrix > | inlineexplicitprotected |
NOT_RWSE enum value | libsemigroups::Element | |
operator<(Element const &that) const override | libsemigroups::ElementWithVectorData< int64_t, ProjectiveMaxPlusMatrix > | inlinevirtual |
operator==(Element const &that) const override | libsemigroups::ElementWithVectorData< int64_t, ProjectiveMaxPlusMatrix > | inlinevirtual |
operator[](size_t pos) const | libsemigroups::ElementWithVectorData< int64_t, ProjectiveMaxPlusMatrix > | inline |
ProjectiveMaxPlusMatrix(std::vector< int64_t > *matrix, Semiring< int64_t > const *semiring) | libsemigroups::ProjectiveMaxPlusMatrix | inline |
ProjectiveMaxPlusMatrix(std::vector< std::vector< int64_t >> const &matrix, Semiring< int64_t > const *semiring) | libsemigroups::ProjectiveMaxPlusMatrix | inline |
really_copy(size_t increase_deg_by=0) const override | libsemigroups::MatrixOverSemiringBase< int64_t, ProjectiveMaxPlusMatrix > | inlinevirtual |
really_delete() override | libsemigroups::ElementWithVectorData< int64_t, ProjectiveMaxPlusMatrix > | inlinevirtual |
redefine(Element const *x, Element const *y) override | libsemigroups::MatrixOverSemiringBase< int64_t, ProjectiveMaxPlusMatrix > | inlinevirtual |
ElementWithVectorDataDefaultHash< int64_t, ProjectiveMaxPlusMatrix >::redefine(Element const *x, Element const *y, size_t const &thread_id) | libsemigroups::Element | inlinevirtual |
reset_hash_value() const | libsemigroups::Element | inlineprotected |
RWSE enum value | libsemigroups::Element | |
semiring() const | libsemigroups::MatrixOverSemiringBase< int64_t, ProjectiveMaxPlusMatrix > | inline |
swap(Element *x) override | libsemigroups::ElementWithVectorData< int64_t, ProjectiveMaxPlusMatrix > | inlinevirtual |
UNDEFINED | libsemigroups::Element | protectedstatic |
vector_hash(std::vector< T > const *vec) | libsemigroups::ElementWithVectorData< int64_t, ProjectiveMaxPlusMatrix > | inlineprotectedstatic |
~Element() | libsemigroups::Element | inlinevirtual |
- libsemigroups
-
- |
-
Class for projective max-plus matrices. - More...
- -#include <elements.h>
-Public Member Functions | |
ProjectiveMaxPlusMatrix (std::vector< int64_t > *matrix, Semiring< int64_t > const *semiring) | |
A constructor. More... | |
ProjectiveMaxPlusMatrix (std::vector< std::vector< int64_t >> const &matrix, Semiring< int64_t > const *semiring) | |
A constructor. More... | |
Public Member Functions inherited from libsemigroups::MatrixOverSemiringBase< int64_t, ProjectiveMaxPlusMatrix > | |
MatrixOverSemiringBase (std::vector< int64_t > *matrix, Semiring< int64_t > const *semiring) | |
A constructor. More... | |
MatrixOverSemiringBase (std::vector< std::vector< int64_t >> const &matrix, Semiring< int64_t > const *semiring) | |
A constructor. More... | |
size_t | complexity () const override |
Returns the approximate time complexity of multiplying two matrices. More... | |
size_t | degree () const override |
Returns the dimension of the matrix. More... | |
Element * | identity () const override |
Returns the identity matrix with dimension of this . More... | |
Element * | really_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... | |
Semiring< int64_t > const * | semiring () const |
Returns a pointer to the Semiring over which the matrix is defined. More... | |
Public Member Functions inherited from libsemigroups::ElementWithVectorData< int64_t, ProjectiveMaxPlusMatrix > | |
ElementWithVectorData () | |
A constructor. More... | |
ElementWithVectorData (std::vector< int64_t > *vector) | |
A constructor. More... | |
ElementWithVectorData (std::vector< int64_t > const &vector) | |
A constructor. More... | |
int64_t | at (size_t pos) const |
Returns the pos entry in the vector containing the defining data. More... | |
std::vector< int64_t >::iterator | begin () const |
Returns an iterator. More... | |
std::vector< int64_t >::iterator | cbegin () const |
Returns a const iterator. More... | |
std::vector< int64_t >::iterator | cend () const |
Returns a const iterator. More... | |
void | copy (Element const *x) override |
Copy another Element into this . More... | |
std::vector< int64_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... | |
int64_t | operator[] (size_t pos) const |
Returns the pos entry in the vector containing the defining data. 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... | |
-Friends | |
-class | ElementWithVectorData< int64_t, ProjectiveMaxPlusMatrix > |
-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::MatrixOverSemiringBase< int64_t, ProjectiveMaxPlusMatrix > | |
MatrixOverSemiringBase (std::vector< int64_t > *matrix) | |
Constructs a MatrixOverSemiringBase with whose underlying semiring is not defined. The underlying semiring must be set by any class deriving from this one. More... | |
Protected Member Functions inherited from libsemigroups::ElementWithVectorDataDefaultHash< int64_t, ProjectiveMaxPlusMatrix > | |
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< int64_t, ProjectiveMaxPlusMatrix > | |
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< int64_t, ProjectiveMaxPlusMatrix > | |
std::vector< int64_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... | |
Class for projective max-plus matrices.
-These matrices belong to the quotient of the monoid of all max-plus matrices by the congruence where two matrices are related if they differ by a scalar multiple.
Matrices in this class are modified when constructed to be in a normal form which is obtained by subtracting the maximum finite entry in the matrix from the every finite entry.
-
-
|
- -inline | -
A constructor.
-See MatrixOverSemiring::MatrixOverSemiring for details about this method.
-The parameter matrix
is converted into its normal form when when the object is constructed.
-
|
- -inline | -
A constructor.
-See MatrixOverSemiring::MatrixOverSemiring for details about this method.
-The copy of the parameter matrix
in the object constructed is converted into its normal form when the object is constructed.
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::RO, including all inherited members.
-operator()(rws_word_t const *p, rws_word_t const *q) const | libsemigroups::RO | inline |
operator()(rws_word_t const &p, rws_word_t const &q) const (defined in libsemigroups::RO) | libsemigroups::RO | inline |
RO(std::function< bool(rws_word_t const *, rws_word_t const *)> func) | libsemigroups::RO | inlineexplicit |
- libsemigroups
-
- |
-
This class provides a call operator which can be used to compare libsemigroups::rws_word_t. - More...
- -#include <rws.h>
-Public Member Functions | |
RO (std::function< bool(rws_word_t const *, rws_word_t const *)> func) | |
A constructor. More... | |
size_t | operator() (rws_word_t const *p, rws_word_t const *q) const |
Returns true if the word p is greater than the word q in the reduction ordering. More... | |
-size_t | operator() (rws_word_t const &p, rws_word_t const &q) const |
This class provides a call operator which can be used to compare libsemigroups::rws_word_t.
-A reduction ordering is a linear order \(\prec\) with no infinite descending chains and where \(u \prec v\) for some libsemigroups::rws_word_t \(u\) and \(v\) implies that \( aub \prec avb\) for all libsemigroups::rws_word_t \(a\) and \(b\).
-
-
|
- -inlineexplicit | -
A constructor.
-This constructs a reduction ordering object whose call operator uses the function func
to compare libsemigroups::rws_word_t's. It is the responsibility of the caller to verify that func
specifies a reduction ordering.
-
|
- -inline | -
Returns true
if the word p
is greater than the word q
in the reduction ordering.
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::RWS, including all inherited members.
-AB_BC enum value (defined in libsemigroups::RWS) | libsemigroups::RWS | |
ABC enum value (defined in libsemigroups::RWS) | libsemigroups::RWS | |
add_rule(std::string const &p, std::string const &q) | libsemigroups::RWS | |
add_rules(std::vector< relation_t > const &relations) | libsemigroups::RWS | |
add_rules(Congruence &cong) | libsemigroups::RWS | inline |
confluent() const | libsemigroups::RWS | inline |
knuth_bendix() | libsemigroups::RWS | inline |
knuth_bendix(std::atomic< bool > &killed) | libsemigroups::RWS | |
knuth_bendix_by_overlap_length() | libsemigroups::RWS | inline |
max_AB_BC enum value (defined in libsemigroups::RWS) | libsemigroups::RWS | |
nr_rules() const | libsemigroups::RWS | inline |
operator<<(std::ostream &os, RWS const &rws) | libsemigroups::RWS | friend |
overlap_measure enum name | libsemigroups::RWS | |
rewrite(std::string *w) const | libsemigroups::RWS | inline |
rewrite(std::string w) const | libsemigroups::RWS | inline |
rule(std::string p, std::string q) const | libsemigroups::RWS | |
rules() const | libsemigroups::RWS | |
RWS(ReductionOrdering *order, std::string alphabet=STANDARD_ALPHABET) | libsemigroups::RWS | inlineexplicit |
RWS() | libsemigroups::RWS | inline |
RWS(std::string alphabet) | libsemigroups::RWS | inlineexplicit |
RWS(std::vector< relation_t > const &relations) | libsemigroups::RWS | inlineexplicit |
RWS(ReductionOrdering *order, std::vector< relation_t > const &relations) | libsemigroups::RWS | inline |
RWS(Congruence &cong) | libsemigroups::RWS | inlineexplicit |
rws_letter_t typedef | libsemigroups::RWS | |
rws_word_to_word(rws_word_t const *rws_word) | libsemigroups::RWS | inlinestatic |
set_check_confluence_interval(size_t interval) | libsemigroups::RWS | inline |
set_max_overlap(size_t val) | libsemigroups::RWS | inline |
set_max_rules(size_t val) | libsemigroups::RWS | inline |
set_overlap_measure(overlap_measure measure) | libsemigroups::RWS | |
set_report(bool val) const | libsemigroups::RWS | inline |
set_report_interval(size_t interval) | libsemigroups::RWS | inline |
test_equals(word_t const &p, word_t const &q) | libsemigroups::RWS | |
test_equals(std::initializer_list< size_t > const &p, std::initializer_list< size_t > const &q) | libsemigroups::RWS | |
test_equals(std::string const &p, std::string const &q) | libsemigroups::RWS | |
test_equals(std::string *p, std::string *q) | libsemigroups::RWS | |
test_less_than(word_t const &p, word_t const &q) | libsemigroups::RWS | |
test_less_than(std::string const &p, std::string const &q) | libsemigroups::RWS | |
test_less_than(std::string *p, std::string *q) | libsemigroups::RWS | |
uint_to_rws_word(size_t const &a) | libsemigroups::RWS | inlinestatic |
UNBOUNDED | libsemigroups::RWS | static |
word_to_rws_word(word_t const &w, rws_word_t *ww) | libsemigroups::RWS | inlinestatic |
word_to_rws_word(word_t const &w) | libsemigroups::RWS | inlinestatic |
~RWS() | libsemigroups::RWS |
- libsemigroups
-
- |
-
This class is used to represent a string rewriting system defining a finitely presented monoid or semigroup. - More...
- -#include <rws.h>
-Public Types | |
enum | overlap_measure { ABC = 0, -AB_BC = 1, -max_AB_BC = 2 - } |
The values in this enum determine how a rewriting system measures the length \(d(AB, BC)\) of the overlap of two words \(AB\) and \(BC\): More... | |
typedef char | rws_letter_t |
Type for letters for rewriting systems. More... | |
-Public Member Functions | |
RWS (ReductionOrdering *order, std::string alphabet=STANDARD_ALPHABET) | |
Constructs rewriting system with no rules and the reduction ordering order . More... | |
RWS () | |
Constructs a rewriting system with no rules, and the SHORTLEX reduction ordering. More... | |
RWS (std::string alphabet) | |
Constructs a rewriting system with no rules, and the SHORTLEX reduction ordering and using the alphabet specified by the parameter alphabet . More... | |
RWS (std::vector< relation_t > const &relations) | |
Constructs a rewriting system with rules derived from the parameter relations , and with the SHORTLEX reduction ordering. More... | |
RWS (ReductionOrdering *order, std::vector< relation_t > const &relations) | |
Constructs a rewriting system with rules derived from relations , and with the reduction ordering specified by order . More... | |
RWS (Congruence &cong) | |
Constructs a rewriting system from Congruence::relations and Congruence::extra applied to cong . More... | |
~RWS () | |
A default destructor. More... | |
void | add_rule (std::string const &p, std::string const &q) |
Add a rule to the rewriting system. More... | |
void | add_rules (std::vector< relation_t > const &relations) |
Adds rules derived from relations via RWS::word_to_rws_word to the rewriting system. More... | |
void | add_rules (Congruence &cong) |
Add rules derived from Congruence::relations and Congruence::extra applied to cong . More... | |
bool | confluent () const |
Returns true if the rewriting system is confluent and false if it is not. More... | |
void | knuth_bendix () |
Run the Knuth-Bendix algorithm on the rewriting system. More... | |
void | knuth_bendix (std::atomic< bool > &killed) |
Run the Knuth-Bendix algorithm on the rewriting system until it terminates or killed is set to true . More... | |
void | knuth_bendix_by_overlap_length () |
This method runs the Knuth-Bendix algorithm on the rewriting system by considering all overlaps of a given length \(n\) (according to the RWS::overlap_measure) before those overlaps of length \(n + 1\). More... | |
size_t | nr_rules () const |
Returns the current number of active rules in the rewriting system. More... | |
std::string * | rewrite (std::string *w) const |
Rewrites the word w in-place according to the current rules in the rewriting system. More... | |
std::string | rewrite (std::string w) const |
Rewrites a copy of the word w according to the current rules in the rewriting system. More... | |
bool | rule (std::string p, std::string q) const |
This method returns true if the strings p and q represent an active rule of the rewriting system, i.e. if either \( p \to q\) or \( q \to p \) is a currently active rule of the system. More... | |
std::vector< std::pair< std::string, std::string > > | rules () const |
This method returns a vector consisting of the pairs of strings which represent the rules of the rewriting system. The first entry in every such pair is greater than the second according to the reduction ordering of the rewriting system. The rules are sorted according to the reduction ordering used by the rewriting system, on the first entry. More... | |
void | set_check_confluence_interval (size_t interval) |
The method RWS::knuth_bendix periodically checks if the system is already confluent. This method can be used to set how frequently this happens, it is the number of new overlaps that should be considered before checking confluence. Setting this value too low can adversely affect the performance of RWS::knuth_bendix. More... | |
void | set_max_overlap (size_t val) |
This method can be used to specify the maximum length of the overlap of two left hand sides of rules that should be considered in RWS::knuth_bendix. More... | |
void | set_max_rules (size_t val) |
This method sets the (approximate) maximum number of rules that the system should contain. If this is number is exceeded in calls to RWS::knuth_bendix or RWS::knuth_bendix_by_overlap_length, then these methods will terminate and the system may not be confluent. More... | |
void | set_overlap_measure (overlap_measure measure) |
This method can be used to determine the way that the length of an overlap of two words in the system is meaasured. More... | |
void | set_report (bool val) const |
Turn reporting on or off. More... | |
void | set_report_interval (size_t interval) |
Some information can be sent to std::cout during calls to RWS::knuth_bendix and RWS::knuth_bendix_by_overlap_length. This method can be used to determine the frequency with which this information is given, where a larger value means less frequently. More... | |
bool | test_equals (word_t const &p, word_t const &q) |
Returns true if the reduced form of RWS::word_to_rws_word(p) equal the reduced form of RWS::word_to_rws_word(q) , and false if not. More... | |
bool | test_equals (std::initializer_list< size_t > const &p, std::initializer_list< size_t > const &q) |
Returns true if the reduced form of RWS::word_to_rws_word(p) equal the reduced form of RWS::word_to_rws_word(q) , and false if not. More... | |
bool | test_equals (std::string const &p, std::string const &q) |
Returns true if RWS::rewrite(p) equals RWS::rewrite(q) , and false if not. More... | |
bool | test_equals (std::string *p, std::string *q) |
Returns true if RWS::rewrite(p) equals RWS::rewrite(q) , and false if not. More... | |
bool | test_less_than (word_t const &p, word_t const &q) |
Returns true if the reduced form of RWS::word_to_rws_word(p) is less than the reduced form of RWS::word_to_rws_word(q) , with respect to the reduction ordering of this , and false if not. More... | |
bool | test_less_than (std::string const &p, std::string const &q) |
Returns true if RWS::rewrite(p) is less than RWS::rewrite(q) , with respect to the reduction ordering of this , and false if not. More... | |
bool | test_less_than (std::string *p, std::string *q) |
Returns true if RWS::rewrite(p) is less than RWS::rewrite(q) , with respect to the reduction ordering of this , and false if not. More... | |
-Static Public Member Functions | |
static word_t * | rws_word_to_word (rws_word_t const *rws_word) |
This method converts a string in the rewriting system into a vector of unsigned integers. This method is the inverse of RWS::uint_to_rws_word. More... | |
static rws_word_t * | uint_to_rws_word (size_t const &a) |
This method converts an unsigned integer to the corresponding rws_word_t. For example, the integer 0 is converted to the word with single letter which is the 1st ASCII character. More... | |
static rws_word_t * | word_to_rws_word (word_t const &w, rws_word_t *ww) |
This method converts a vector of unsigned integers to a string which represents a word in the rewriting system. The second parameter ww is modified in-place to contain the string version of the vector of unsigned integers w . More... | |
static rws_word_t * | word_to_rws_word (word_t const &w) |
This method converts a vector of unsigned integers to a string which represents a word in the rewriting system. More... | |
-Static Public Attributes | |
static size_t const | UNBOUNDED = static_cast<size_t>(-2) |
The constant value represents an UNBOUNDED quantity. More... | |
-Friends | |
std::ostream & | operator<< (std::ostream &os, RWS const &rws) |
This method allows a RWS object to be left shifted into a std::ostream, such as std::cout. The currently active rules of the system are represented in the output. More... | |
This class is used to represent a string rewriting system defining a finitely presented monoid or semigroup.
-typedef char libsemigroups::RWS::rws_letter_t | -
Type for letters for rewriting systems.
- -enum libsemigroups::RWS::overlap_measure | -
The values in this enum determine how a rewriting system measures the length \(d(AB, BC)\) of the overlap of two words \(AB\) and \(BC\):
-
-
|
- -inlineexplicit | -
Constructs rewriting system with no rules and the reduction ordering order
.
This constructs a rewriting system with no rules, and with the reduction ordering ReductionOrdering specifed by the parameter order
.
-
|
- -inline | -
Constructs a rewriting system with no rules, and the SHORTLEX reduction ordering.
- -
-
|
- -inlineexplicit | -
Constructs a rewriting system with no rules, and the SHORTLEX reduction ordering and using the alphabet specified by the parameter alphabet
.
-
|
- -inlineexplicit | -
Constructs a rewriting system with rules derived from the parameter relations
, and with the SHORTLEX reduction ordering.
-
|
- -inline | -
Constructs a rewriting system with rules derived from relations
, and with the reduction ordering specified by order
.
The RWS instance constructed here owns the parameter order
, and deletes it in its destructor.
-
|
- -inlineexplicit | -
Constructs a rewriting system from Congruence::relations and Congruence::extra applied to cong
.
Constructs a rewriting system with rules corresponding to the relations used to define cong
, i.e. Congruence::relations and Congruence::extra, and with the SHORTLEX reduction ordering.
libsemigroups::RWS::~RWS | -( | -) | -- |
A default destructor.
-This deletes the reduction order used to construct the object, and the rules in the system.
- -void libsemigroups::RWS::add_rule | -( | -std::string const & | -p, | -
- | - | std::string const & | -q | -
- | ) | -- |
Add a rule to the rewriting system.
-The principal difference between this method and RWS::add_rule(std::string* p, std::string* q) is that the arguments are copied by this method.
-void libsemigroups::RWS::add_rules | -( | -std::vector< relation_t > const & | -relations | ) | -- |
Adds rules derived from relations
via RWS::word_to_rws_word to the rewriting system.
-
|
- -inline | -
Add rules derived from Congruence::relations and Congruence::extra applied to cong
.
-
|
- -inline | -
Returns true
if the rewriting system is confluent and false
if it is not.
-
|
- -inline | -
Run the Knuth-Bendix algorithm on the rewriting system.
-void libsemigroups::RWS::knuth_bendix | -( | -std::atomic< bool > & | -killed | ) | -- |
Run the Knuth-Bendix algorithm on the rewriting system until it terminates or killed
is set to true
.
-
|
- -inline | -
This method runs the Knuth-Bendix algorithm on the rewriting system by considering all overlaps of a given length \(n\) (according to the RWS::overlap_measure) before those overlaps of length \(n + 1\).
-
-
|
- -inline | -
Returns the current number of active rules in the rewriting system.
- -
-
|
- -inline | -
Rewrites the word w
in-place according to the current rules in the rewriting system.
-
|
- -inline | -
Rewrites a copy of the word w
according to the current rules in the rewriting system.
bool libsemigroups::RWS::rule | -( | -std::string | -p, | -
- | - | std::string | -q | -
- | ) | -const | -
This method returns true
if the strings p
and q
represent an active rule of the rewriting system, i.e. if either \( p \to q\) or \( q \to p \) is a currently active rule of the system.
std::vector< std::pair< std::string, std::string > > libsemigroups::RWS::rules | -( | -) | -const | -
This method returns a vector consisting of the pairs of strings which represent the rules of the rewriting system. The first
entry in every such pair is greater than the second
according to the reduction ordering of the rewriting system. The rules are sorted according to the reduction ordering used by the rewriting system, on the first entry.
-
|
- -inlinestatic | -
This method converts a string in the rewriting system into a vector of unsigned integers. This method is the inverse of RWS::uint_to_rws_word.
- -
-
|
- -inline | -
The method RWS::knuth_bendix periodically checks if the system is already confluent. This method can be used to set how frequently this happens, it is the number of new overlaps that should be considered before checking confluence. Setting this value too low can adversely affect the performance of RWS::knuth_bendix.
-The default value is 4096, and should be set to RWS::UNBOUNDED if RWS::knuth_bendix should never check if the system is already confluent.
-
-
|
- -inline | -
This method can be used to specify the maximum length of the overlap of two left hand sides of rules that should be considered in RWS::knuth_bendix.
-If this value is less than the longest left hand side of a rule, then RWS::knuth_bendix can terminate without the system being confluent.
-
-
|
- -inline | -
This method sets the (approximate) maximum number of rules that the system should contain. If this is number is exceeded in calls to RWS::knuth_bendix or RWS::knuth_bendix_by_overlap_length, then these methods will terminate and the system may not be confluent.
-void libsemigroups::RWS::set_overlap_measure | -( | -overlap_measure | -measure | ) | -- |
This method can be used to determine the way that the length of an overlap of two words in the system is meaasured.
-
-
|
- -inline | -
Turn reporting on or off.
-If val
is true, then some methods for a RWS object may report information about the progress of the computation.
-
|
- -inline | -
Some information can be sent to std::cout during calls to RWS::knuth_bendix and RWS::knuth_bendix_by_overlap_length. This method can be used to determine the frequency with which this information is given, where a larger value means less frequently.
-The default value is 1000.
- -bool libsemigroups::RWS::test_equals | -( | -word_t const & | -p, | -
- | - | word_t const & | -q | -
- | ) | -- |
Returns true
if the reduced form of RWS::word_to_rws_word(p)
equal the reduced form of RWS::word_to_rws_word(q)
, and false
if not.
bool libsemigroups::RWS::test_equals | -( | -std::initializer_list< size_t > const & | -p, | -
- | - | std::initializer_list< size_t > const & | -q | -
- | ) | -- |
Returns true
if the reduced form of RWS::word_to_rws_word(p)
equal the reduced form of RWS::word_to_rws_word(q)
, and false
if not.
bool libsemigroups::RWS::test_equals | -( | -std::string const & | -p, | -
- | - | std::string const & | -q | -
- | ) | -- |
Returns true
if RWS::rewrite(p)
equals RWS::rewrite(q)
, and false
if not.
bool libsemigroups::RWS::test_equals | -( | -std::string * | -p, | -
- | - | std::string * | -q | -
- | ) | -- |
Returns true
if RWS::rewrite(p)
equals RWS::rewrite(q)
, and false
if not.
This method rewrites p
and q
in-place (unless they are already equal before rewriting). The caller responsible for deletion.
bool libsemigroups::RWS::test_less_than | -( | -word_t const & | -p, | -
- | - | word_t const & | -q | -
- | ) | -- |
Returns true
if the reduced form of RWS::word_to_rws_word(p)
is less than the reduced form of RWS::word_to_rws_word(q)
, with respect to the reduction ordering of this
, and false
if not.
bool libsemigroups::RWS::test_less_than | -( | -std::string const & | -p, | -
- | - | std::string const & | -q | -
- | ) | -- |
Returns true
if RWS::rewrite(p)
is less than RWS::rewrite(q)
, with respect to the reduction ordering of this
, and false
if not.
bool libsemigroups::RWS::test_less_than | -( | -std::string * | -p, | -
- | - | std::string * | -q | -
- | ) | -- |
Returns true
if RWS::rewrite(p)
is less than RWS::rewrite(q)
, with respect to the reduction ordering of this
, and false
if not.
The parameters p
and q
are rewritten in-place, and the caller is responsible for their deletion.
-
|
- -inlinestatic | -
This method converts an unsigned integer to the corresponding rws_word_t. For example, the integer 0 is converted to the word with single letter which is the 1st ASCII character.
- -
-
|
- -inlinestatic | -
This method converts a vector of unsigned integers to a string which represents a word in the rewriting system. The second parameter ww
is modified in-place to contain the string version of the vector of unsigned integers w
.
This method returns its second parameter ww
.
-
|
- -inlinestatic | -
This method converts a vector of unsigned integers to a string which represents a word in the rewriting system.
-This method returns a pointer to a new string, and it is the responsibility of the caller to delete it.
- -
-
|
- -friend | -
This method allows a RWS object to be left shifted into a std::ostream, such as std::cout. The currently active rules of the system are represented in the output.
- -
-
|
- -static | -
The constant value represents an UNBOUNDED quantity.
- - -
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::RWS::Rule, including all inherited members.
-lhs() const | libsemigroups::RWS::Rule | inline |
operator<< (defined in libsemigroups::RWS::Rule) | libsemigroups::RWS::Rule | friend |
rhs() const | libsemigroups::RWS::Rule | inline |
- libsemigroups
-
- |
-
Class for rules in rewriting systems, which supports only two methods, Rule::lhs and Rule::rhs, which return the left and right hand sides of the rule. - More...
- -#include <rws.h>
-Public Member Functions | |
rws_word_t const * | lhs () const |
Returns the left hand side of the rule, which is guaranteed to be greater than its right hand side according to the reduction ordering of the RWS used to construct this. More... | |
rws_word_t const * | rhs () const |
Returns the right hand side of the rule, which is guaranteed to be less than its left hand side according to the reduction ordering of the RWS used to construct this. More... | |
-Friends | |
-std::ostream & | operator<< (std::ostream &os, Rule const &rule) |
Class for rules in rewriting systems, which supports only two methods, Rule::lhs and Rule::rhs, which return the left and right hand sides of the rule.
-
-
|
- -inline | -
Returns the left hand side of the rule, which is guaranteed to be greater than its right hand side according to the reduction ordering of the RWS used to construct this.
- -
-
|
- -inline | -
Returns the right hand side of the rule, which is guaranteed to be less than its left hand side according to the reduction ordering of the RWS used to construct this.
- -
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::RWS::RuleLookup, including all inherited members.
-operator()(rws_word_t::iterator const &first, rws_word_t::iterator const &last) (defined in libsemigroups::RWS::RuleLookup) | libsemigroups::RWS::RuleLookup | inline |
operator<(RuleLookup const &that) const (defined in libsemigroups::RWS::RuleLookup) | libsemigroups::RWS::RuleLookup | inline |
rule() const (defined in libsemigroups::RWS::RuleLookup) | libsemigroups::RWS::RuleLookup | inline |
RuleLookup() (defined in libsemigroups::RWS::RuleLookup) | libsemigroups::RWS::RuleLookup | inline |
RuleLookup(RWS::Rule *rule) (defined in libsemigroups::RWS::RuleLookup) | libsemigroups::RWS::RuleLookup | inlineexplicit |
- libsemigroups
-
- |
-
-Public Member Functions | |
- | RuleLookup (RWS::Rule *rule) |
-RuleLookup & | operator() (rws_word_t::iterator const &first, rws_word_t::iterator const &last) |
-bool | operator< (RuleLookup const &that) const |
-Rule const * | rule () const |
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::RWSE, including all inherited members.
-cache_hash_value() const override | libsemigroups::RWSE | inlinevirtual |
complexity() const override | libsemigroups::RWSE | inlinevirtual |
copy(Element const *x) override | libsemigroups::RWSE | virtual |
degree() const override | libsemigroups::RWSE | inlinevirtual |
Element(elm_t type=Element::elm_t::NOT_RWSE) | libsemigroups::Element | inlineexplicit |
elm_t enum name | libsemigroups::Element | |
get_rws_word() const | libsemigroups::RWSE | inline |
get_type() const | libsemigroups::Element | inline |
hash_value() const | libsemigroups::Element | inline |
identity() const override | libsemigroups::RWSE | inlinevirtual |
NOT_RWSE enum value | libsemigroups::Element | |
operator<(const Element &that) const override | libsemigroups::RWSE | virtual |
operator==(Element const &that) const override | libsemigroups::RWSE | inlinevirtual |
really_copy(size_t increase_deg_by) const override | libsemigroups::RWSE | virtual |
really_delete() override | libsemigroups::RWSE | inlinevirtual |
redefine(Element const *x, Element const *y) override | libsemigroups::RWSE | virtual |
libsemigroups::Element::redefine(Element const *x, Element const *y, size_t const &thread_id) | libsemigroups::Element | inlinevirtual |
reset_hash_value() const | libsemigroups::Element | inlineprotected |
RWSE(RWS *rws, rws_word_t *w) | libsemigroups::RWSE | inline |
RWSE(RWS &rws, rws_word_t const &w) | libsemigroups::RWSE | inline |
RWSE(RWS &rws, letter_t const &a) | libsemigroups::RWSE | inline |
RWSE(RWS &rws, word_t const &w) | libsemigroups::RWSE | inline |
libsemigroups::Element::RWSE enum value | libsemigroups::Element | |
swap(Element *x) override | libsemigroups::RWSE | virtual |
UNDEFINED | libsemigroups::Element | protectedstatic |
~Element() | libsemigroups::Element | inlinevirtual |
- 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... | |
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... | |
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 | -
-
|
- -inline | -
Constructor from a rewriting system and a letter.
-Calls RWSE::RWSE with RWS::uint_to_rws_word of a
.
-
|
- -inline | -
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.
- -
-
|
- -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.
- -
-
|
- -overridevirtual | -
Swap another Element with this
.
This method swaps the defining data of x
and this
.
Implements libsemigroups::Element.
- -
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::RecVec< T, A >, including all inherited members.
-add_cols(size_t nr) (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
add_rows(size_t nr) (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
allocator_type typedef (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | |
append(const RecVec< S > ©) (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
begin() (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
begin() const (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
begin_column(size_t col_index) (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
begin_row(size_t row_index) (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
cbegin() const (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
cbegin_column(size_t col_index) (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
cbegin_row(size_t row_index) const (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
cend() const (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
cend_column(size_t col_index) (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
cend_row(size_t row_index) const (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
clear() (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
const_iterator typedef (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | |
const_reference typedef (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | |
const_reverse_iterator typedef (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | |
crbegin() const (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
crend() const (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
difference_type typedef (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | |
empty() const (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
end() (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
end() const (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
end_column(size_t col_index) (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
end_row(size_t row_index) (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
get(size_t i, size_t j) const (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
iterator typedef (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | |
max_size() const (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
nr_cols() const (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
nr_rows() const (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
operator!=(RecVec< T, A > const &that) const (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
operator=(RecVec< T, A > that) (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
operator==(RecVec< T, A > const &that) const (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
rbegin() (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
rbegin() const (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
RecVec (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | friend |
RecVec(size_t nr_cols=0, size_t nr_rows=0, T default_val=0) (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inlineexplicit |
RecVec(RecVec< S, B > const ©, size_t nr_cols_to_add) (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
reference typedef (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | |
rend() (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
rend() const (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
reverse_iterator typedef (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | |
set(size_t i, size_t j, T val) (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
size() const (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
size_type typedef (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | |
swap(RecVec< T, A > &that) (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
value_type typedef (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | |
~RecVec() (defined in libsemigroups::RecVec< T, A >) | libsemigroups::RecVec< T, A > | inline |
- libsemigroups
-
- |
-
Template class for rectangular vectors i.e. two dimensional vectors. The unique template parameter T is the type of the objects stored in the <RecVec>. - More...
- -#include <recvec.h>
-Public Types | |
-typedef A | allocator_type |
-typedef iterator_base< typename std::vector< T, A >::const_iterator, typename std::vector< T, A >::const_reference, typename std::vector< T, A >::const_pointer > | const_iterator |
-typedef std::vector< T, A >::const_reference | const_reference |
-typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
-typedef std::vector< T, A >::difference_type | difference_type |
-typedef iterator_base< typename std::vector< T, A >::iterator, typename std::vector< T, A >::reference, typename std::vector< T, A >::pointer > | iterator |
-typedef std::vector< T, A >::reference | reference |
-typedef std::reverse_iterator< iterator > | reverse_iterator |
-typedef std::vector< T, A >::size_type | size_type |
-typedef std::vector< T, A >::value_type | value_type |
-Public Member Functions | |
- | RecVec (size_t nr_cols=0, size_t nr_rows=0, T default_val=0) |
-template<typename S , class B > | |
RecVec (RecVec< S, B > const ©, size_t nr_cols_to_add) | |
-void | add_cols (size_t nr) |
-void | add_rows (size_t nr) |
-template<typename S > | |
void | append (const RecVec< S > ©) |
-iterator | begin () |
-const_iterator | begin () const |
-iterator | begin_column (size_t col_index) |
-iterator | begin_row (size_t row_index) |
-const_iterator | cbegin () const |
-const_iterator | cbegin_column (size_t col_index) |
-const_iterator | cbegin_row (size_t row_index) const |
-const_iterator | cend () const |
-const_iterator | cend_column (size_t col_index) |
-const_iterator | cend_row (size_t row_index) const |
-void | clear () |
-const_reverse_iterator | crbegin () const |
-const_reverse_iterator | crend () const |
-bool | empty () const |
-iterator | end () |
-const_iterator | end () const |
-iterator | end_column (size_t col_index) |
-iterator | end_row (size_t row_index) |
-T | get (size_t i, size_t j) const |
-size_t | max_size () const |
-size_t | nr_cols () const |
-size_t | nr_rows () const |
-bool | operator!= (RecVec< T, A > const &that) const |
-RecVec< T, A > & | operator= (RecVec< T, A > that) |
-bool | operator== (RecVec< T, A > const &that) const |
-reverse_iterator | rbegin () |
-const_reverse_iterator | rbegin () const |
-reverse_iterator | rend () |
-const_reverse_iterator | rend () const |
-void | set (size_t i, size_t j, T val) |
-size_t | size () const |
-void | swap (RecVec< T, A > &that) |
-Friends | |
-template<typename S , class B > | |
class | RecVec |
Template class for rectangular vectors i.e. two dimensional vectors. The unique template parameter T is the type of the objects stored in the <RecVec>.
-
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::ReductionOrdering, including all inherited members.
-operator()(std::string const *p, std::string const *q) const | libsemigroups::ReductionOrdering | inline |
operator()(std::string const &p, std::string const &q) const | libsemigroups::ReductionOrdering | inline |
ReductionOrdering(std::function< bool(std::string const *, std::string const *)> func) | libsemigroups::ReductionOrdering | inlineexplicit |
- libsemigroups
-
- |
-
This class provides a call operator which can be used to compare libsemigroups::rws_word_t. - More...
- -#include <rws.h>
-Public Member Functions | |
ReductionOrdering (std::function< bool(std::string const *, std::string const *)> func) | |
A constructor. More... | |
size_t | operator() (std::string const *p, std::string const *q) const |
Returns true if the word pointed to by p is greater than the word pointed to by q in the reduction ordering. More... | |
size_t | operator() (std::string const &p, std::string const &q) const |
Returns true if the word p is greater than the word q in the reduction ordering. More... | |
This class provides a call operator which can be used to compare libsemigroups::rws_word_t.
-A reduction ordering is a linear order \(\prec\) with no infinite descending chains and where \(u \prec v\) for some libsemigroups::rws_word_t \(u\) and \(v\) implies that \( aub \prec avb\) for all libsemigroups::rws_word_t \(a\) and \(b\).
-
-
|
- -inlineexplicit | -
A constructor.
-This constructs a reduction ordering object whose call operator uses the function func
to compare libsemigroups::rws_word_t's. It is the responsibility of the caller to verify that func
specifies a reduction ordering.
-
|
- -inline | -
Returns true
if the word pointed to by p
is greater than the word pointed to by q
in the reduction ordering.
-
|
- -inline | -
Returns true
if the word p
is greater than the word q
in the reduction ordering.
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::SHORTLEX, including all inherited members.
-operator()(std::string const *p, std::string const *q) const | libsemigroups::ReductionOrdering | inline |
operator()(std::string const &p, std::string const &q) const | libsemigroups::ReductionOrdering | inline |
ReductionOrdering(std::function< bool(std::string const *, std::string const *)> func) | libsemigroups::ReductionOrdering | inlineexplicit |
SHORTLEX() | libsemigroups::SHORTLEX | inline |
- libsemigroups
-
- |
-
This class implements the shortlex reduction ordering derived from an ordering on libsemigroups::rws_letter_t's. - More...
- -#include <rws.h>
-Public Member Functions | |
SHORTLEX () | |
Constructs a short-lex reduction ordering object derived from the order of on libsemigroups::rws_letter_t's given by the operator <. More... | |
Public Member Functions inherited from libsemigroups::ReductionOrdering | |
ReductionOrdering (std::function< bool(std::string const *, std::string const *)> func) | |
A constructor. More... | |
size_t | operator() (std::string const *p, std::string const *q) const |
Returns true if the word pointed to by p is greater than the word pointed to by q in the reduction ordering. More... | |
size_t | operator() (std::string const &p, std::string const &q) const |
Returns true if the word p is greater than the word q in the reduction ordering. More... | |
This class implements the shortlex reduction ordering derived from an ordering on libsemigroups::rws_letter_t's.
-
-
|
- -inline | -
Constructs a short-lex reduction ordering object derived from the order of on libsemigroups::rws_letter_t's given by the operator <.
- -
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::Semigroup, including all inherited members.
-add_generators(std::vector< Element const * > const *coll) | libsemigroups::Semigroup | |
add_generators(std::vector< Element * > const *coll) | libsemigroups::Semigroup | inline |
add_generators(std::vector< Element const * > const &coll) | libsemigroups::Semigroup | |
add_generators(std::vector< Element * > const &coll) | libsemigroups::Semigroup | inline |
add_generators(std::initializer_list< Element * > coll) | libsemigroups::Semigroup | inline |
at(element_index_t pos) | libsemigroups::Semigroup | |
batch_size() const | libsemigroups::Semigroup | inline |
begin() const | libsemigroups::Semigroup | inline |
cayley_graph_t typedef | libsemigroups::Semigroup | |
cbegin() const | libsemigroups::Semigroup | inline |
cbegin_idempotents() | libsemigroups::Semigroup | inline |
cbegin_sorted() | libsemigroups::Semigroup | inline |
cend() const | libsemigroups::Semigroup | inline |
cend_idempotents() | libsemigroups::Semigroup | inline |
cend_sorted() | libsemigroups::Semigroup | inline |
closure(std::vector< Element const * > const *coll) | libsemigroups::Semigroup | |
closure(std::vector< Element const * > const &coll) | libsemigroups::Semigroup | |
closure(std::vector< Element * > const &coll) | libsemigroups::Semigroup | inline |
closure(std::initializer_list< Element * > coll) | libsemigroups::Semigroup | inline |
copy_add_generators(std::vector< Element const * > const *coll) const | libsemigroups::Semigroup | |
copy_add_generators(std::vector< Element * > const *coll) const | libsemigroups::Semigroup | inline |
copy_closure(std::vector< Element const * > const *coll) | libsemigroups::Semigroup | |
copy_closure(std::vector< Element * > const *gens) | libsemigroups::Semigroup | inline |
crbegin() const | libsemigroups::Semigroup | inline |
crbegin_sorted() | libsemigroups::Semigroup | inline |
crend() const | libsemigroups::Semigroup | inline |
crend_sorted() | libsemigroups::Semigroup | inline |
current_max_word_length() const | libsemigroups::Semigroup | inline |
current_nrrules() const | libsemigroups::Semigroup | inline |
current_position(Element const *x) const | libsemigroups::Semigroup | inline |
current_size() const | libsemigroups::Semigroup | inline |
degree() const | libsemigroups::Semigroup | inline |
element_index_t typedef | libsemigroups::Semigroup | |
end() const | libsemigroups::Semigroup | inline |
enumerate(std::atomic< bool > &killed, size_t limit=LIMIT_MAX) | libsemigroups::Semigroup | |
enumerate(size_t limit=LIMIT_MAX) | libsemigroups::Semigroup | inline |
factorisation(word_t &word, element_index_t pos) | libsemigroups::Semigroup | inline |
factorisation(element_index_t pos) | libsemigroups::Semigroup | inline |
factorisation(Element const *x) | libsemigroups::Semigroup | |
fast_product(element_index_t i, element_index_t j) const | libsemigroups::Semigroup | |
final_letter(element_index_t pos) const | libsemigroups::Semigroup | inline |
first_letter(element_index_t pos) const | libsemigroups::Semigroup | inline |
gens(letter_t pos) const | libsemigroups::Semigroup | inline |
is_begun() const | libsemigroups::Semigroup | inline |
is_done() const | libsemigroups::Semigroup | inline |
is_idempotent(element_index_t pos) | libsemigroups::Semigroup | |
left(element_index_t i, letter_t j) | libsemigroups::Semigroup | inline |
left_cayley_graph_copy() | libsemigroups::Semigroup | inline |
length_const(element_index_t pos) const | libsemigroups::Semigroup | inline |
length_non_const(element_index_t pos) | libsemigroups::Semigroup | inline |
letter_to_pos(letter_t i) const | libsemigroups::Semigroup | inline |
LIMIT_MAX | libsemigroups::Semigroup | static |
minimal_factorisation(word_t &word, element_index_t pos) | libsemigroups::Semigroup | |
minimal_factorisation(element_index_t pos) | libsemigroups::Semigroup | |
minimal_factorisation(Element const *x) | libsemigroups::Semigroup | |
next_relation(word_t &relation) | libsemigroups::Semigroup | |
nrgens() const | libsemigroups::Semigroup | inline |
nridempotents() | libsemigroups::Semigroup | |
nrrules() | libsemigroups::Semigroup | inline |
operator=(Semigroup const &semigroup)=delete | libsemigroups::Semigroup | |
operator[](element_index_t pos) const | libsemigroups::Semigroup | inline |
position(Element const *x) | libsemigroups::Semigroup | |
position_to_sorted_position(element_index_t pos) | libsemigroups::Semigroup | |
prefix(element_index_t pos) const | libsemigroups::Semigroup | inline |
product_by_reduction(element_index_t i, element_index_t j) const | libsemigroups::Semigroup | |
reserve(size_t n) | libsemigroups::Semigroup | |
reset_next_relation() | libsemigroups::Semigroup | inline |
right(element_index_t i, letter_t j) | libsemigroups::Semigroup | inline |
right_cayley_graph_copy() | libsemigroups::Semigroup | inline |
Semigroup(std::vector< Element const * > const *gens) | libsemigroups::Semigroup | explicit |
Semigroup(std::vector< Element * > const *gens) | libsemigroups::Semigroup | inlineexplicit |
Semigroup(std::vector< Element * > *gens) | libsemigroups::Semigroup | inlineexplicit |
Semigroup(std::vector< Element const * > *gens) | libsemigroups::Semigroup | inlineexplicit |
Semigroup(std::vector< Element const * > const &gens) | libsemigroups::Semigroup | explicit |
Semigroup(std::vector< Element * > const &gens) | libsemigroups::Semigroup | inlineexplicit |
Semigroup(std::initializer_list< Element * > gens) | libsemigroups::Semigroup | inlineexplicit |
Semigroup(const Semigroup ©) | libsemigroups::Semigroup | |
set_batch_size(size_t batch_size) | libsemigroups::Semigroup | inline |
set_max_threads(size_t nr_threads) | libsemigroups::Semigroup | inline |
set_report(bool val) const | libsemigroups::Semigroup | inline |
size() | libsemigroups::Semigroup | inline |
sorted_at(element_index_t pos) | libsemigroups::Semigroup | |
sorted_position(Element const *x) | libsemigroups::Semigroup | |
suffix(element_index_t pos) const | libsemigroups::Semigroup | inline |
test_membership(Element const *x) | libsemigroups::Semigroup | inline |
UNDEFINED | libsemigroups::Semigroup | static |
word_to_element(word_t const &w) const | libsemigroups::Semigroup | |
word_to_pos(word_t const &w) const | libsemigroups::Semigroup | |
~Semigroup() | libsemigroups::Semigroup |
- libsemigroups
-
- |
-
Class for semigroups generated by instances of Element. - More...
- -#include <semigroups.h>
-Public Types | |
typedef RecVec< element_index_t > | cayley_graph_t |
Type for a left or right Cayley graph of a semigroup. More... | |
typedef index_t | element_index_t |
Type for the position of an element in an instance of Semigroup. The size of the semigroup being enumerated must be at most std::numeric_limits<element_index_t>::max() More... | |
-Public Member Functions | |
Semigroup (std::vector< Element const * > const *gens) | |
Construct from generators. More... | |
Semigroup (std::vector< Element * > const *gens) | |
Construct from generators. More... | |
Semigroup (std::vector< Element * > *gens) | |
Construct from generators. More... | |
Semigroup (std::vector< Element const * > *gens) | |
Construct from generators. More... | |
Semigroup (std::vector< Element const * > const &gens) | |
Construct from generators. More... | |
Semigroup (std::vector< Element * > const &gens) | |
Construct from generators. More... | |
Semigroup (std::initializer_list< Element * > gens) | |
Construct from generators. More... | |
Semigroup (const Semigroup ©) | |
Copy constructor. More... | |
~Semigroup () | |
A default destructor. More... | |
void | add_generators (std::vector< Element const * > const *coll) |
Add copies of the generators coll to the generators of this . More... | |
void | add_generators (std::vector< Element * > const *coll) |
Add copies of the generators coll to the generators of this . More... | |
void | add_generators (std::vector< Element const * > const &coll) |
Add copies of the generators coll to the generators of this . More... | |
void | add_generators (std::vector< Element * > const &coll) |
Add copies of the generators coll to the generators of this . More... | |
void | add_generators (std::initializer_list< Element * > coll) |
Add copies of the generators coll to the generators of this . More... | |
Element const * | at (element_index_t pos) |
Returns the element of the semigroup in position pos , or a nullptr if there is no such element. More... | |
size_t | batch_size () const |
Returns the current value of the batch size. This is the minimum number of elements enumerated in any call to Semigroup::enumerate. More... | |
const_iterator | begin () const |
Returns a const iterator pointing to the first element of the semigroup. More... | |
const_iterator | cbegin () const |
Returns a const iterator pointing to the first element of the semigroup. More... | |
const_iterator_idempotents | cbegin_idempotents () |
Returns a const iterator pointing at the first idempotent in the semigroup. More... | |
const_iterator_sorted | cbegin_sorted () |
Returns a const iterator pointing to the first element of the semigroup when the elements are sorted by Element::operator<. More... | |
const_iterator | cend () const |
Returns a const iterator pointing to one past the last currently known element of the semigroup. More... | |
const_iterator_idempotents | cend_idempotents () |
Returns a const iterator referring to past the end of the last idempotent in the semigroup. More... | |
const_iterator_sorted | cend_sorted () |
Returns a const iterator pointing to one past the last element of the semigroup when the elements are sorted by Element::operator<. More... | |
void | closure (std::vector< Element const * > const *coll) |
Add copies of the non-redundant generators in coll to the generators of this . More... | |
void | closure (std::vector< Element const * > const &coll) |
Add copies of the non-redundant generators in coll to the generators of this . More... | |
void | closure (std::vector< Element * > const &coll) |
Add copies of the non-redundant generators in coll to the generators of this . More... | |
void | closure (std::initializer_list< Element * > coll) |
Add copies of the non-redundant generators in coll to the generators of this . More... | |
Semigroup * | copy_add_generators (std::vector< Element const * > const *coll) const |
Returns a new semigroup generated by this and coll . More... | |
Semigroup * | copy_add_generators (std::vector< Element * > const *coll) const |
Returns a new semigroup generated by this and coll . More... | |
Semigroup * | copy_closure (std::vector< Element const * > const *coll) |
Returns a new semigroup generated by this and copies of the non-redundant elements of coll . More... | |
Semigroup * | copy_closure (std::vector< Element * > const *gens) |
Returns a new semigroup generated by this and copies of the non-redundant elements of coll . More... | |
const_reverse_iterator | crbegin () const |
Returns a const reverse iterator pointing to the last currently known element of the semigroup. More... | |
const_reverse_iterator_sorted | crbegin_sorted () |
Returns a const iterator pointing to the last element of the semigroup when the elements are sorted by Element::operator<. More... | |
const_reverse_iterator | crend () const |
Returns a const reverse iterator pointing to one before the first element of the semigroup. More... | |
const_reverse_iterator_sorted | crend_sorted () |
Returns a const iterator pointing to one before the first element of the semigroup when the elements are sorted by Element::operator<. More... | |
size_t | current_max_word_length () const |
Returns the maximum length of a word in the generators so far computed. More... | |
size_t | current_nrrules () const |
Returns the number of relations in the presentation for the semigroup that have been found so far. More... | |
element_index_t | current_position (Element const *x) const |
Returns the position of the element x in the semigroup if it is already known to belong to the semigroup. More... | |
size_t | current_size () const |
Returns the number of elements in the semigroup that have been enumerated so far. More... | |
size_t | degree () const |
Returns the degree of any (and all) Element's in the semigroup. More... | |
const_iterator | end () const |
Returns a const iterator pointing to one past the last currently known element of the semigroup. More... | |
void | enumerate (std::atomic< bool > &killed, size_t limit=LIMIT_MAX) |
Enumerate the semigroup until limit elements are found or killed is true . More... | |
void | enumerate (size_t limit=LIMIT_MAX) |
Enumerate the semigroup until limit elements are found. More... | |
void | factorisation (word_t &word, element_index_t pos) |
Changes word in-place to contain a word in the generators equal to the pos element of the semigroup. More... | |
word_t * | factorisation (element_index_t pos) |
Returns a pointer to a libsemigroups::word_t which evaluates to the Element in position pos of this . More... | |
word_t * | factorisation (Element const *x) |
Returns a pointer to a libsemigroups::word_t which evaluates to. More... | |
element_index_t | fast_product (element_index_t i, element_index_t j) const |
Returns the position in this of the product of this->at(i) and this->at(j) . More... | |
letter_t | final_letter (element_index_t pos) const |
Returns the last letter of the element in position pos . More... | |
letter_t | first_letter (element_index_t pos) const |
Returns the first letter of the element in position pos . More... | |
Element const * | gens (letter_t pos) const |
Return a pointer to the generator with index pos . More... | |
bool | is_begun () const |
Returns true if no elements other than the generators have been enumerated so far and false otherwise. More... | |
bool | is_done () const |
Returns true if the semigroup is fully enumerated and false if not. More... | |
bool | is_idempotent (element_index_t pos) |
Returns true if the element in position pos is an idempotent and false if it is not. More... | |
element_index_t | left (element_index_t i, letter_t j) |
Returns the index of the product of the generator with index j and the element in position i . More... | |
cayley_graph_t * | left_cayley_graph_copy () |
Returns a copy of the left Cayley graph of the semigroup. More... | |
size_t | length_const (element_index_t pos) const |
Returns the length of the element in position pos of the semigroup. More... | |
size_t | length_non_const (element_index_t pos) |
Returns the length of the element in position pos of the semigroup. More... | |
element_index_t | letter_to_pos (letter_t i) const |
Returns the position in this of the generator with index i . More... | |
void | minimal_factorisation (word_t &word, element_index_t pos) |
Changes word in-place to contain a minimal word with respect to the short-lex ordering in the generators equal to the pos element of the semigroup. More... | |
word_t * | minimal_factorisation (element_index_t pos) |
Returns a pointer to a minimal libsemigroups::word_t which evaluates to the Element in position pos of this . More... | |
word_t * | minimal_factorisation (Element const *x) |
Returns a pointer to a minimal libsemigroups::word_t which evaluates to x . More... | |
void | next_relation (word_t &relation) |
This method changes relation in-place to contain the next relation of the presentation defining this . More... | |
size_t | nrgens () const |
Returns the number of generators of the semigroup. More... | |
size_t | nridempotents () |
Returns the total number of idempotents in the semigroup. More... | |
size_t | nrrules () |
Returns the total number of relations in the presentation defining the semigroup. More... | |
Semigroup & | operator= (Semigroup const &semigroup)=delete |
Deleted. More... | |
Element const * | operator[] (element_index_t pos) const |
Returns the element of the semigroup in position pos . More... | |
element_index_t | position (Element const *x) |
Returns the position of x in this , or Semigroup::UNDEFINED if x is not an element of this . More... | |
element_index_t | position_to_sorted_position (element_index_t pos) |
Returns the position of this->at(pos) in the sorted array of elements of the semigroup, or Semigroup::UNDEFINED if pos is greater than the size of the semigroup. More... | |
element_index_t | prefix (element_index_t pos) const |
Returns the position of the prefix of the element x in position pos (of the semigroup) of length one less than the length of x . More... | |
element_index_t | product_by_reduction (element_index_t i, element_index_t j) const |
Returns the position in this of the product of this->at(i) and this->at(j) by following a path in the Cayley graph. More... | |
void | reserve (size_t n) |
Requests that the capacity (i.e. number of elements) of the semigroup be at least enough to contain n elements. More... | |
void | reset_next_relation () |
This method resets Semigroup::next_relation so that when it is next called the resulting relation is the first one. More... | |
element_index_t | right (element_index_t i, letter_t j) |
Returns the index of the product of the element in position i with the generator with index j . More... | |
cayley_graph_t * | right_cayley_graph_copy () |
Returns a copy of the right Cayley graph of the semigroup. More... | |
void | set_batch_size (size_t batch_size) |
Set a new value for the batch size. More... | |
void | set_max_threads (size_t nr_threads) |
Set the maximum number of threads that any method of an instance of Semigroup can use. More... | |
void | set_report (bool val) const |
Turn reporting on or off. More... | |
size_t | size () |
Returns the size of the semigroup. More... | |
Element const * | sorted_at (element_index_t pos) |
Returns the element of the semigroup in position pos of the sorted array of elements, or nullptr in pos is not valid (i.e. too big). More... | |
element_index_t | sorted_position (Element const *x) |
Returns the position of x in the sorted array of elements of the semigroup, or Semigroup::UNDEFINED if x is not an element of this . More... | |
element_index_t | suffix (element_index_t pos) const |
Returns the position of the suffix of the element x in position pos (of the semigroup) of length one less than the length of x . More... | |
bool | test_membership (Element const *x) |
Returns true if x is an element of this and false if it is not. More... | |
Element * | word_to_element (word_t const &w) const |
Returns a pointer to the element of this represented by the word w . More... | |
element_index_t | word_to_pos (word_t const &w) const |
Returns the position in the semigroup corresponding to the element represented by the word w . More... | |
-Static Public Attributes | |
static index_t const | LIMIT_MAX = std::numeric_limits<index_t>::max() |
This variable is used to indicate the maximum possible limit that can be used with Semigroup::enumerate. More... | |
static index_t const | UNDEFINED = std::numeric_limits<index_t>::max() |
This variable is used to indicate that a value is undefined, such as, for example, the position of an element that does not belong to a semigroup. More... | |
Class for semigroups generated by instances of Element.
-Semigroups are defined by a generating set, and the main method here is Semigroup::enumerate, which implements the Froidure-Pin Algorithm. When the enumeration of the semigroup is complete, the size, the left and right Cayley graphs are determined, and a confluent terminating presentation for the semigroup is known.
-typedef RecVec<element_index_t> libsemigroups::Semigroup::cayley_graph_t | -
Type for a left or right Cayley graph of a semigroup.
- -typedef index_t libsemigroups::Semigroup::element_index_t | -
Type for the position of an element in an instance of Semigroup. The size of the semigroup being enumerated must be at most std::numeric_limits<element_index_t>::max()
- -
-
|
- -explicit | -
Construct from generators.
-This is the default constructor for a semigroup generated by gens
. The generators gens
must all be of the same derived subclass of the Element base class. Additionally, gens
must satisfy the following:
if either of these points is not satisfied, then an asssertion failure will occur.
-There can be duplicate generators and although they do not count as distinct elements, they do count as distinct generators. In other words, the generators of the semigroup are precisely (a copy of) gens
in the same order they occur in gens
.
The generators gens
are copied by the constructor, and so it is the responsibility of the caller to delete gens
.
-
|
- -inlineexplicit | -
Construct from generators.
-This constructor is for convenience only, and it simply reinterpret_cast's the argument from std::vector<Element*> const* to std::vector<Element const*> const*.
- -
-
|
- -inlineexplicit | -
Construct from generators.
-This constructor is for convenience only, and it simply const_casts the argument from std::vector<Element*>* to std::vector<Element*> const*.
- -
-
|
- -inlineexplicit | -
Construct from generators.
-This constructor is for convenience only, and it simply const_casts the argument from std::vector<Element const*>* to std::vector<Element const*> const*.
- -
-
|
- -explicit | -
Construct from generators.
-This constructor is for convenience only, see Semigroup::Semigroup.
- -
-
|
- -inlineexplicit | -
Construct from generators.
-This constructor is for convenience, and it simply reinterpret_casts its argument to <std::vector<Element const*> const&.
- -
-
|
- -inlineexplicit | -
Construct from generators.
-This constructor is for convenience, and it simply static_casts its argument to std::vector<Element*>.
- -libsemigroups::Semigroup::Semigroup | -( | -const Semigroup & | -copy | ) | -- |
Copy constructor.
-Constructs a new Semigroup which is an exact copy of copy
. No enumeration is triggered for either copy
or of the newly constructed semigroup.
libsemigroups::Semigroup::~Semigroup | -( | -) | -- |
A default destructor.
- -void libsemigroups::Semigroup::add_generators | -( | -std::vector< Element const * > const * | -coll | ) | -- |
Add copies of the generators coll
to the generators of this
.
This method can be used to add new generators to the existing semigroup in such a way that any previously enumerated data is preserved and not recomputed, or copied. This can be faster than recomputing the semigroup generated by the old generators and the new generators in the parameter coll
.
This method changes the semigroup in-place, thereby invalidating possibly previously known data about the semigroup, such as the left or right Cayley graphs, number of idempotents, and so on.
-Every generator in coll
is added regardless of whether or not it is already a generator or element of the semigroup (it may belong to the semigroup but just not be known to belong). If coll
is empty, then the semigroup is left unchanged. The order the generators is added is also the order they occur in the parameter coll
.
The semigroup is returned in a state where all of the previously enumerated elements which had been multiplied by all of the old generators, have now been multiplied by all of the old and new generators. This means that after this method is called the semigroup might contain many more elements than before (whether it is fully enumerating or not). It can also be the case that the new generators are the only new elements, unlike, say, in the case of non-trivial groups.
-The elements the argument coll
are copied into the semigroup, and should be deleted by the caller.
-
|
- -inline | -
Add copies of the generators coll
to the generators of this
.
See Semigroup::add_generators for more details.
- -void libsemigroups::Semigroup::add_generators | -( | -std::vector< Element const * > const & | -coll | ) | -- |
Add copies of the generators coll
to the generators of this
.
See Semigroup::add_generators for more details.
- -
-
|
- -inline | -
Add copies of the generators coll
to the generators of this
.
See Semigroup::add_generators for more details.
- -
-
|
- -inline | -
Add copies of the generators coll
to the generators of this
.
See Semigroup::add_generators for more details.
- -Element const * libsemigroups::Semigroup::at | -( | -element_index_t | -pos | ) | -- |
Returns the element of the semigroup in position pos
, or a nullptr
if there is no such element.
This method attempts to enumerate the semigroup until at least pos
+ 1 elements have been found. If pos
is greater than Semigroup::size, then this method returns nullptr
.
-
|
- -inline | -
Returns the current value of the batch size. This is the minimum number of elements enumerated in any call to Semigroup::enumerate.
- -
-
|
- -inline | -
Returns a const iterator pointing to the first element of the semigroup.
-This method does not perform any enumeration of the semigroup, the iterator returned may be invalidated by any call to a non-const method of the Semigroup class.
- -
-
|
- -inline | -
Returns a const iterator pointing to the first element of the semigroup.
-This method does not perform any enumeration of the semigroup, the iterator returned may be invalidated by any call to a non-const method of the Semigroup class.
- -
-
|
- -inline | -
Returns a const iterator pointing at the first idempotent in the semigroup.
-If the returned iterator is incremented, then it points to the second idempotent in the semigroup (if it exists), and every subsequent increment points to the next idempotent.
-This method involves fully enumerating the semigroup, if it is not already fully enumerated.
- -
-
|
- -inline | -
Returns a const iterator pointing to the first element of the semigroup when the elements are sorted by Element::operator<.
-This method fully enumerates the semigroup, the returned iterator returned may be invalidated by any call to a non-const method of the Semigroup class.
- -
-
|
- -inline | -
Returns a const iterator pointing to one past the last currently known element of the semigroup.
-This method does not perform any enumeration of the semigroup, the iterator returned may be invalidated by any call to a non-const method of the Semigroup class.
- -
-
|
- -inline | -
Returns a const iterator referring to past the end of the last idempotent in the semigroup.
-This method involves fully enumerating the semigroup, if it is not already fully enumerated.
- -
-
|
- -inline | -
Returns a const iterator pointing to one past the last element of the semigroup when the elements are sorted by Element::operator<.
-This method fully enumerates the semigroup, the returned iterator returned may be invalidated by any call to a non-const method of the Semigroup class.
- -void libsemigroups::Semigroup::closure | -( | -std::vector< Element const * > const * | -coll | ) | -- |
Add copies of the non-redundant generators in coll
to the generators of this
.
This method can be used to add new generators to an existing semigroup in such a way that any previously enumerated data is preserved and not recomputed, or copied. This can be faster than recomputing the semigroup generated by the old generators and the new in coll
.
This method differs from Semigroup::add_generators in that it tries to add the new generators one by one, and only adds those generators that are not products of existing generators (including any new generators from coll
that were added before). The generators are added in the order they occur in coll
.
This method changes the semigroup in-place, thereby invalidating possibly previously known data about the semigroup, such as the left or right Cayley graphs, or number of idempotents, for example.
-The elements the parameter coll
are copied into the semigroup, and should be deleted by the caller.
void libsemigroups::Semigroup::closure | -( | -std::vector< Element const * > const & | -coll | ) | -- |
Add copies of the non-redundant generators in coll
to the generators of this
.
See Semigroup::closure for more details.
- -
-
|
- -inline | -
Add copies of the non-redundant generators in coll
to the generators of this
.
See Semigroup::closure for more details.
- -
-
|
- -inline | -
Add copies of the non-redundant generators in coll
to the generators of this
.
See Semigroup::closure for more details.
- -Semigroup * libsemigroups::Semigroup::copy_add_generators | -( | -std::vector< Element const * > const * | -coll | ) | -const | -
Returns a new semigroup generated by this
and coll
.
This method is equivalent to copying this
using Semigroup::Semigroup(const Semigroup& copy) and then calling Semigroup::add_generators on the copy, but this method avoids copying the parts of this
that are immediately invalidated by Semigroup::add_generators.
The elements the argument coll
are copied into the semigroup, and should be deleted by the caller.
-
|
- -inline | -
Returns a new semigroup generated by this
and coll
.
See Semigroup::copy_add_generators for more details.
- -Semigroup * libsemigroups::Semigroup::copy_closure | -( | -std::vector< Element const * > const * | -coll | ) | -- |
Returns a new semigroup generated by this
and copies of the non-redundant elements of coll
.
This method is equivalent to copying this
and then calling Semigroup::closure on the copy with coll
, but this method avoids copying the parts of this
that are immediately invalidated by Semigroup::closure.
The elements the argument coll
are copied into the semigroup, and should be deleted by the caller.
-
|
- -inline | -
Returns a new semigroup generated by this
and copies of the non-redundant elements of coll
.
See Semigroup::copy_closure for more details.
- -
-
|
- -inline | -
Returns a const reverse iterator pointing to the last currently known element of the semigroup.
-This method does not perform any enumeration of the semigroup, the iterator returned may be invalidated by any call to a non-const method of the Semigroup class.
- -
-
|
- -inline | -
Returns a const iterator pointing to the last element of the semigroup when the elements are sorted by Element::operator<.
-This method fully enumerates the semigroup, the returned iterator returned may be invalidated by any call to a non-const method of the Semigroup class.
- -
-
|
- -inline | -
Returns a const reverse iterator pointing to one before the first element of the semigroup.
-This method does not perform any enumeration of the semigroup, the iterator returned may be invalidated by any call to a non-const method of the Semigroup class.
- -
-
|
- -inline | -
Returns a const iterator pointing to one before the first element of the semigroup when the elements are sorted by Element::operator<.
-This method fully enumerates the semigroup, the returned iterator returned may be invalidated by any call to a non-const method of the Semigroup class.
- -
-
|
- -inline | -
Returns the maximum length of a word in the generators so far computed.
-Every elements of the semigroup can be expressed as a product of the generators. The elements of the semigroup are enumerated in the short-lex order induced by the order of the generators (as passed to Semigroup::Semigroup). This method returns the length of the longest word in the generators that has so far been enumerated.
- -
-
|
- -inline | -
Returns the number of relations in the presentation for the semigroup that have been found so far.
-This is only the actual number of relations in a presentation defining the semigroup if the semigroup is fully enumerated.
- -
-
|
- -inline | -
Returns the position of the element x
in the semigroup if it is already known to belong to the semigroup.
This method finds the position of the element x
in the semigroup if it is already known to belong to the semigroup, and libsemigroups::Semigroup::UNDEFINED if not. If the semigroup is not fully enumerated, then this method may return libsemigroups::Semigroup::UNDEFINED when x
is in the semigroup, but not this is not yet known.
-
|
- -inline | -
Returns the number of elements in the semigroup that have been enumerated so far.
-This is only the actual size of the semigroup if the semigroup is fully enumerated.
- -
-
|
- -inline | -
Returns the degree of any (and all) Element's in the semigroup.
- -
-
|
- -inline | -
Returns a const iterator pointing to one past the last currently known element of the semigroup.
-This method does not perform any enumeration of the semigroup, the iterator returned may be invalidated by any call to a non-const method of the Semigroup class.
- -void libsemigroups::Semigroup::enumerate | -( | -std::atomic< bool > & | -killed, | -
- | - | size_t | -limit = LIMIT_MAX |
-
- | ) | -- |
Enumerate the semigroup until limit
elements are found or killed
is true
.
This is the main method of the Semigroup class, where the Froidure-Pin Algorithm is implemented.
-If the semigroup is already fully enumerated, or the number of elements previously enumerated exceeds limit
, then calling this method does nothing. Otherwise, enumerate attempts to find at least the maximum of limit
and Semigroup::batch_size elements of the semigroup. If killed
is set to true
(usually by another process), then the enumeration is terminated as soon as possible. It is possible to resume enumeration at some later point after any call to this method, even if it has been killed.
If the semigroup is fully enumerated, then it knows its left and right Cayley graphs, and a minimal factorisation of every element (in terms of its generating set). All of the elements are stored in memory until the object is destroyed.
-The parameter limit
defaults to Semigroup::LIMIT_MAX.
-
|
- -inline | -
Enumerate the semigroup until limit
elements are found.
See Semigroup::enumerate(std::atomic<bool>& killed, size_t limit) for more details.
- -
-
|
- -inline | -
Changes word
in-place to contain a word in the generators equal to the pos
element of the semigroup.
The key difference between this method and Semigroup::minimal_factorisation(word_t& word, element_index_t pos), is that the resulting factorisation may not be minimal.
- -
-
|
- -inline | -
Returns a pointer to a libsemigroups::word_t which evaluates to the Element in position pos
of this
.
The key difference between this method and Semigroup::minimal_factorisation(element_index_t pos), is that the resulting factorisation may not be minimal.
- -Returns a pointer to a libsemigroups::word_t which evaluates to.
-The key difference between this method and Semigroup::minimal_factorisation(Element const* x), is that the resulting factorisation may not be minimal.
- -Semigroup::element_index_t libsemigroups::Semigroup::fast_product | -( | -element_index_t | -i, | -
- | - | element_index_t | -j | -
- | ) | -const | -
Returns the position in this
of the product of this->at(i)
and this->at(j)
.
This method asserts that the parameters i
and j
are less than Semigroup::current_size, and it either:
i
to j
, whichever is shorter using Semigroup::product_by_reduction; ori
and j
together;whichever is better. The method used is determined by comparing Element::complexity and the Semigroup::length_const of i
and j
.
For example, if the Element::complexity of the multiplication is linear and this
is a semigroup of transformations of degree 20, and the shortest paths in the left and right Cayley graphs from i
to j
are of length 100 and 1131, then it better to just multiply the transformations together.
-
|
- -inline | -
Returns the last letter of the element in position pos
.
This method returns the final letter of the element in position pos
of the semigroup, which is the index of the generator corresponding to the first letter of the element.
Note that Semigroup::gens[Semigroup::final_letter(pos
)] is only equal to Semigroup::at(Semigroup::final_letter(pos
)) if there are no duplicate generators.
The parameter pos
must be a valid position of an already enumerated element of the semigroup, this is asserted in the method.
-
|
- -inline | -
Returns the first letter of the element in position pos
.
This method returns the first letter of the element in position pos
of the semigroup, which is the index of the generator corresponding to the first letter of the element.
Note that Semigroup::gens[Semigroup::first_letter(pos
)] is only equal to Semigroup::at(Semigroup::first_letter(pos
)) if there are no duplicate generators.
The parameter pos
must be a valid position of an already enumerated element of the semigroup, this is asserted in the method.
-
|
- -inline | -
Return a pointer to the generator with index pos
.
-
|
- -inline | -
Returns true
if no elements other than the generators have been enumerated so far and false
otherwise.
-
|
- -inline | -
Returns true
if the semigroup is fully enumerated and false
if not.
The semigroup is fully enumerated when the product of every element by every generator is known.
- -bool libsemigroups::Semigroup::is_idempotent | -( | -element_index_t | -pos | ) | -- |
Returns true
if the element in position pos
is an idempotent and false
if it is not.
This method involves fully enumerating the semigroup, if it is not already fully enumerated.
- -
-
|
- -inline | -
Returns the index of the product of the generator with index j
and the element in position i
.
This method fully enumerates the semigroup.
- -
-
|
- -inline | -
Returns a copy of the left Cayley graph of the semigroup.
-This method fully enumerates the semigroup.
- -
-
|
- -inline | -
Returns the length of the element in position pos
of the semigroup.
The parameter pos
must be a valid position of an already enumerated element of the semigroup, this is asserted in the method. This method causes no enumeration of the semigroup.
-
|
- -inline | -
Returns the length of the element in position pos
of the semigroup.
The parameter pos
must be a valid position of an element of the semigroup, this is asserted in the method.
-
|
- -inline | -
Returns the position in this
of the generator with index i
.
This method asserts that the value of i
is valid. In many cases letter_to_pos(i)
will equal i
, examples of when this will not be the case are:
void libsemigroups::Semigroup::minimal_factorisation | -( | -word_t & | -word, | -
- | - | element_index_t | -pos | -
- | ) | -- |
Changes word
in-place to contain a minimal word with respect to the short-lex ordering in the generators equal to the pos
element of the semigroup.
If pos
is less than the size of this semigroup, then this method changes its first parameter word
in-place by first clearing it and then to contain a minimal factorization of the element in position pos
of the semigroup with respect to the generators of the semigroup. This method enumerates the semigroup until at least the pos
element is known. If pos
is greater than the size of the semigroup, then nothing happens and word is not modified, in particular not cleared.
word_t * libsemigroups::Semigroup::minimal_factorisation | -( | -element_index_t | -pos | ) | -- |
Returns a pointer to a minimal libsemigroups::word_t which evaluates to the Element in position pos
of this
.
This is the same as the two-argument method for Semigroup::minimal_factorisation, but it returns a pointer to the factorisation instead of modifying an argument in-place.
- -Returns a pointer to a minimal libsemigroups::word_t which evaluates to x
.
This is the same as the method taking a Semigroup::element_index_t, but it factorises an Element instead of using the position of an element.
- -void libsemigroups::Semigroup::next_relation | -( | -word_t & | -relation | ) | -- |
This method changes relation
in-place to contain the next relation of the presentation defining this
.
This method changes relation
in-place so that one of the following holds:
relation
is a vector consisting of a libsemigroups::letter_t and a libsemigroups::letter_t such that Semigroup::gens(relation
[0
]) == Semigroup::gens(relation
[1
]), i.e. if the semigroup was defined with duplicate generators;relation
is a vector consisting of a libsemigroups::element_index_t, libsemigroups::letter_t, and libsemigroups::element_index_t such that relation
is empty if there are no more relations.Semigroup::next_relation is guaranteed to output all relations of length 2 before any relations of length 3. If called repeatedly after Semigroup::reset_next_relation, and until relation is empty, the values placed in relation
correspond to a length-reducing confluent rewriting system that defines the semigroup.
This method can be used in conjunction with Semigroup::factorisation to obtain a presentation defining the semigroup.
-
-
|
- -inline | -
Returns the number of generators of the semigroup.
- -size_t libsemigroups::Semigroup::nridempotents | -( | -) | -- |
Returns the total number of idempotents in the semigroup.
-This method involves fully enumerating the semigroup, if it is not already fully enumerated. The value of the positions, and number, of idempotents is stored after they are first computed.
- -
-
|
- -inline | -
Returns the total number of relations in the presentation defining the semigroup.
-
-
|
- -inline | -
Returns the element of the semigroup in position pos
.
This method performs no checks on its argument, and performs no enumeration of the semigroup.
- -Semigroup::element_index_t libsemigroups::Semigroup::position | -( | -Element const * | -x | ) | -- |
Returns the position of x
in this
, or Semigroup::UNDEFINED if x
is not an element of this
.
This method can be used to find the Semigroup::element_index_t position of the element x
if it belongs to the semigroup. The semigroup is enumerated in batches until x
is found or the semigroup is fully enumerated but x
was not found (see Semigroup::set_batch_size).
Semigroup::element_index_t libsemigroups::Semigroup::position_to_sorted_position | -( | -element_index_t | -pos | ) | -- |
Returns the position of this->at(pos)
in the sorted array of elements of the semigroup, or Semigroup::UNDEFINED if pos
is greater than the size of the semigroup.
-
|
- -inline | -
Returns the position of the prefix of the element x
in position pos
(of the semigroup) of length one less than the length of x
.
The parameter pos
must be a valid position of an already enumerated element of the semigroup, this is asserted in the method.
Semigroup::element_index_t libsemigroups::Semigroup::product_by_reduction | -( | -element_index_t | -i, | -
- | - | element_index_t | -j | -
- | ) | -const | -
Returns the position in this
of the product of this->at(i)
and this->at(j)
by following a path in the Cayley graph.
This method asserts that the values i
and j
are valid, in that they are less than Semigroup::current_size. This method returns the position Semigroup::element_index_t in the semigroup of the product of this->at(i)
and this->at(j)
elements by following the path in the right or left Cayley graph from i
to j
, whichever is shorter.
void libsemigroups::Semigroup::reserve | -( | -size_t | -n | ) | -- |
Requests that the capacity (i.e. number of elements) of the semigroup be at least enough to contain n elements.
-The parameter n
is also used to initialise certain data members, if you know a good upper bound for the size of your semigroup, then it is a good idea to call this method with that upper bound as an argument, this can significantly improve the performance of the Semigroup::enumerate method, and consequently every other method too.
-
|
- -inline | -
This method resets Semigroup::next_relation so that when it is next called the resulting relation is the first one.
-After a call to this function, the next call to Semigroup::next_relation will return the first relation of the presentation defining the semigroup.
- -
-
|
- -inline | -
Returns the index of the product of the element in position i
with the generator with index j
.
This method fully enumerates the semigroup.
- -
-
|
- -inline | -
Returns a copy of the right Cayley graph of the semigroup.
-This method fully enumerates the semigroup.
- -
-
|
- -inline | -
Set a new value for the batch size.
-The batch size is the number of new elements to be found by any call to Semigroup::enumerate. A call to enumerate returns between 0 and approximately the batch size.
-The default value of the batch size is 8192.
-This is used by, for example, Semigroup::position so that it is possible to find the position of an element without fully enumerating the semigroup.
- -
-
|
- -inline | -
Set the maximum number of threads that any method of an instance of Semigroup can use.
-This method sets the maximum number of threads to be used by any method of a Semigroup object. The number of threads is limited to the maximum of 1 and the minimum of nr_threads
and the number of threads supported by the hardware.
-
|
- -inline | -
Turn reporting on or off.
-If val
is true, then some methods for a Semigroup object may report information about the progress of the computation.
-
|
- -inline | -
Returns the size of the semigroup.
- -Element const * libsemigroups::Semigroup::sorted_at | -( | -element_index_t | -pos | ) | -- |
Returns the element of the semigroup in position pos
of the sorted array of elements, or nullptr
in pos
is not valid (i.e. too big).
This method fully enumerates the semigroup.
- -Semigroup::element_index_t libsemigroups::Semigroup::sorted_position | -( | -Element const * | -x | ) | -- |
Returns the position of x
in the sorted array of elements of the semigroup, or Semigroup::UNDEFINED if x
is not an element of this
.
-
|
- -inline | -
Returns the position of the suffix of the element x
in position pos
(of the semigroup) of length one less than the length of x
.
The parameter pos
must be a valid position of an already enumerated element of the semigroup, this is asserted in the method.
-
|
- -inline | -
Returns true
if x
is an element of this
and false
if it is not.
This method can be used to check if the element x
is an element of the semigroup. The semigroup is enumerated in batches until x
is found or the semigroup is fully enumerated but x
was not found (see Semigroup::set_batch_size).
Returns a pointer to the element of this
represented by the word w
.
The parameter w
must consist of non-negative integers less than Semigroup::nrgens. This method returns a pointer to the element of this
obtained by evaluating w
. This is equivalent to finding the product x
of the generators Semigroup::gens(w
[i]).
Semigroup::element_index_t libsemigroups::Semigroup::word_to_pos | -( | -word_t const & | -w | ) | -const | -
Returns the position in the semigroup corresponding to the element represented by the word w
.
The parameter w
must consist of non-negative integers less than Semigroup::nrgens. This method returns the position in this
of the element obtained by evaluating w
. This is equivalent to finding the product x
of the generators Semigroup::gens(w
[i]) and then calling Semigroup::position with argument x
.
-
|
- -static | -
This variable is used to indicate the maximum possible limit that can be used with Semigroup::enumerate.
- -
-
|
- -static | -
This variable is used to indicate that a value is undefined, such as, for example, the position of an element that does not belong to a semigroup.
- -
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::Semigroup::const_iterator, including all inherited members.
-const_iterator(typename std::vector< Element const *>::const_iterator it_vec) (defined in libsemigroups::Semigroup::const_iterator) | libsemigroups::Semigroup::const_iterator | inlineexplicit |
const_iterator(const_iterator const &that) (defined in libsemigroups::Semigroup::const_iterator) | libsemigroups::Semigroup::const_iterator | inline |
difference_type typedef (defined in libsemigroups::Semigroup::const_iterator) | libsemigroups::Semigroup::const_iterator | |
iterator_category typedef (defined in libsemigroups::Semigroup::const_iterator) | libsemigroups::Semigroup::const_iterator | |
operator!=(const_iterator const &that) const (defined in libsemigroups::Semigroup::const_iterator) | libsemigroups::Semigroup::const_iterator | inline |
operator*() const (defined in libsemigroups::Semigroup::const_iterator) | libsemigroups::Semigroup::const_iterator | inline |
operator+(size_type val) const (defined in libsemigroups::Semigroup::const_iterator) | libsemigroups::Semigroup::const_iterator | inline |
operator+ (defined in libsemigroups::Semigroup::const_iterator) | libsemigroups::Semigroup::const_iterator | friend |
operator++(int) (defined in libsemigroups::Semigroup::const_iterator) | libsemigroups::Semigroup::const_iterator | inline |
operator++() (defined in libsemigroups::Semigroup::const_iterator) | libsemigroups::Semigroup::const_iterator | inline |
operator+=(size_type val) (defined in libsemigroups::Semigroup::const_iterator) | libsemigroups::Semigroup::const_iterator | inline |
operator-(size_type val) const (defined in libsemigroups::Semigroup::const_iterator) | libsemigroups::Semigroup::const_iterator | inline |
operator-(const_iterator that) const (defined in libsemigroups::Semigroup::const_iterator) | libsemigroups::Semigroup::const_iterator | inline |
operator--(int) (defined in libsemigroups::Semigroup::const_iterator) | libsemigroups::Semigroup::const_iterator | inline |
operator--() (defined in libsemigroups::Semigroup::const_iterator) | libsemigroups::Semigroup::const_iterator | inline |
operator-=(size_type val) (defined in libsemigroups::Semigroup::const_iterator) | libsemigroups::Semigroup::const_iterator | inline |
operator->() const (defined in libsemigroups::Semigroup::const_iterator) | libsemigroups::Semigroup::const_iterator | inline |
operator<(const_iterator const &that) const (defined in libsemigroups::Semigroup::const_iterator) | libsemigroups::Semigroup::const_iterator | inline |
operator<=(const_iterator const &that) const (defined in libsemigroups::Semigroup::const_iterator) | libsemigroups::Semigroup::const_iterator | inline |
operator=(const_iterator const &that) (defined in libsemigroups::Semigroup::const_iterator) | libsemigroups::Semigroup::const_iterator | inline |
operator==(const_iterator const &that) const (defined in libsemigroups::Semigroup::const_iterator) | libsemigroups::Semigroup::const_iterator | inline |
operator>(const_iterator const &that) const (defined in libsemigroups::Semigroup::const_iterator) | libsemigroups::Semigroup::const_iterator | inline |
operator>=(const_iterator const &that) const (defined in libsemigroups::Semigroup::const_iterator) | libsemigroups::Semigroup::const_iterator | inline |
operator[](size_type pos) const (defined in libsemigroups::Semigroup::const_iterator) | libsemigroups::Semigroup::const_iterator | inline |
pointer typedef (defined in libsemigroups::Semigroup::const_iterator) | libsemigroups::Semigroup::const_iterator | |
reference typedef (defined in libsemigroups::Semigroup::const_iterator) | libsemigroups::Semigroup::const_iterator | |
size_type typedef (defined in libsemigroups::Semigroup::const_iterator) | libsemigroups::Semigroup::const_iterator | |
value_type typedef (defined in libsemigroups::Semigroup::const_iterator) | libsemigroups::Semigroup::const_iterator |
- libsemigroups
-
- |
-
-Public Types | |
-typedef std::vector< Element const * >::difference_type | difference_type |
-typedef std::random_access_iterator_tag | iterator_category |
-typedef std::vector< Element const * >::const_pointer | pointer |
-typedef std::vector< Element const * >::const_reference | reference |
-typedef std::vector< Element const * >::size_type | size_type |
-typedef std::vector< Element const * >::value_type | value_type |
-Public Member Functions | |
- | const_iterator (typename std::vector< Element const *>::const_iterator it_vec) |
- | const_iterator (const_iterator const &that) |
-bool | operator!= (const_iterator const &that) const |
-reference | operator* () const |
-const_iterator | operator+ (size_type val) const |
-const_iterator | operator++ (int) |
-const_iterator & | operator++ () |
-const_iterator & | operator+= (size_type val) |
-const_iterator | operator- (size_type val) const |
-difference_type | operator- (const_iterator that) const |
-const_iterator | operator-- (int) |
-const_iterator & | operator-- () |
-const_iterator & | operator-= (size_type val) |
-pointer | operator-> () const |
-bool | operator< (const_iterator const &that) const |
-bool | operator<= (const_iterator const &that) const |
-const_iterator & | operator= (const_iterator const &that) |
-bool | operator== (const_iterator const &that) const |
-bool | operator> (const_iterator const &that) const |
-bool | operator>= (const_iterator const &that) const |
-reference | operator[] (size_type pos) const |
-Friends | |
-const_iterator | operator+ (size_type val, const_iterator const &it) |
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::Semigroup::iterator_base< T, C >, including all inherited members.
-_it_vec (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | protected |
_methods (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | protectedstatic |
difference_type typedef (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | |
iterator_base(typename std::vector< T >::const_iterator it_vec) (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | inlineexplicit |
iterator_base(iterator_base const &that) (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | inline |
iterator_category typedef (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | |
operator!=(iterator_base const &that) const (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | inline |
operator*() const (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | inline |
operator+(size_type val) const (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | inline |
operator+ (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | friend |
operator++(int) (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | inline |
operator++() (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | inline |
operator+=(size_type val) (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | inline |
operator-(size_type val) const (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | inline |
operator-(iterator_base that) const (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | inline |
operator--(int) (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | inline |
operator--() (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | inline |
operator-=(size_type val) (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | inline |
operator->() const (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | inline |
operator<(iterator_base const &that) const (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | inline |
operator<=(iterator_base const &that) const (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | inline |
operator=(iterator_base const &that) (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | inline |
operator==(iterator_base const &that) const (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | inline |
operator>(iterator_base const &that) const (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | inline |
operator>=(iterator_base const &that) const (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | inline |
operator[](size_type pos) const (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | inline |
pointer typedef (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | |
reference typedef (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | |
size_type typedef (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | |
value_type typedef (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | |
~iterator_base() (defined in libsemigroups::Semigroup::iterator_base< T, C >) | libsemigroups::Semigroup::iterator_base< T, C > | inlinevirtual |
- libsemigroups
-
- |
-
-Public Types | |
-typedef std::vector< T >::difference_type | difference_type |
-typedef std::random_access_iterator_tag | iterator_category |
-typedef std::vector< Element const * >::const_pointer | pointer |
-typedef std::vector< Element const * >::const_reference | reference |
-typedef std::vector< Element const * >::size_type | size_type |
-typedef std::vector< Element const * >::value_type | value_type |
-Public Member Functions | |
- | iterator_base (typename std::vector< T >::const_iterator it_vec) |
- | iterator_base (iterator_base const &that) |
-bool | operator!= (iterator_base const &that) const |
-reference | operator* () const |
-iterator_base | operator+ (size_type val) const |
-iterator_base | operator++ (int) |
-iterator_base & | operator++ () |
-iterator_base & | operator+= (size_type val) |
-iterator_base | operator- (size_type val) const |
-difference_type | operator- (iterator_base that) const |
-iterator_base | operator-- (int) |
-iterator_base & | operator-- () |
-iterator_base & | operator-= (size_type val) |
-pointer | operator-> () const |
-bool | operator< (iterator_base const &that) const |
-bool | operator<= (iterator_base const &that) const |
-iterator_base & | operator= (iterator_base const &that) |
-bool | operator== (iterator_base const &that) const |
-bool | operator> (iterator_base const &that) const |
-bool | operator>= (iterator_base const &that) const |
-reference | operator[] (size_type pos) const |
-Protected Attributes | |
-std::vector< T >::const_iterator | _it_vec |
-Static Protected Attributes | |
-static C const | _methods |
-Friends | |
-iterator_base | operator+ (size_type val, iterator_base const &it) |
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::Semiring< T >, including all inherited members.
-INFTY | libsemigroups::Semiring< T > | static |
MINUS_INFTY | libsemigroups::Semiring< T > | static |
one() const =0 | libsemigroups::Semiring< T > | pure virtual |
plus(T x, T y) const =0 | libsemigroups::Semiring< T > | pure virtual |
prod(T x, T y) const =0 | libsemigroups::Semiring< T > | pure virtual |
UNDEFINED | libsemigroups::Semiring< T > | static |
zero() const =0 | libsemigroups::Semiring< T > | pure virtual |
~Semiring() | libsemigroups::Semiring< T > | inlinevirtual |
- libsemigroups
-
- |
-
This class its subclasses provide very basic functionality for creating semirings. - More...
- -#include <semiring.h>
-Public Member Functions | |
virtual | ~Semiring () |
A default destructor. More... | |
virtual T | one () const =0 |
Returns the multiplicative identity, or one, of the semiring. More... | |
virtual T | plus (T x, T y) const =0 |
Returns the sum of x and y . More... | |
virtual T | prod (T x, T y) const =0 |
Returns the product of x and y . More... | |
virtual T | zero () const =0 |
Returns the additive identity, or zero, of the semiring. More... | |
-Static Public Attributes | |
static const T | INFTY = std::numeric_limits<T>::max() |
Value representing \(\infty\). More... | |
static const T | MINUS_INFTY = std::numeric_limits<T>::min() |
Value representing \(-\infty\). More... | |
static const T | UNDEFINED = std::numeric_limits<T>::max() |
Value representing an undefined quantity. More... | |
This class its subclasses provide very basic functionality for creating semirings.
-A semiring is a set \(R\) together with two binary operations \(+\) and \(\times\) (called addition and multiplication) such that \((R, +)\) is a commutative monoid with identity \(0\), \((R, \times)\) is a monoid with identity \(1\), and the following hold:
-More information about semirings can be found on Wikipedia.
-
-
|
- -inlinevirtual | -
A default destructor.
- -
-
|
- -pure virtual | -
Returns the multiplicative identity, or one, of the semiring.
- -Implemented in libsemigroups::NaturalSemiring, libsemigroups::TropicalMinPlusSemiring, libsemigroups::TropicalMaxPlusSemiring, libsemigroups::MinPlusSemiring, libsemigroups::MaxPlusSemiring, libsemigroups::Integers, and libsemigroups::BooleanSemiring.
- -
-
|
- -pure virtual | -
Returns the sum of x
and y
.
Implemented in libsemigroups::NaturalSemiring, libsemigroups::TropicalMinPlusSemiring, libsemigroups::TropicalMaxPlusSemiring, libsemigroups::MinPlusSemiring, libsemigroups::MaxPlusSemiring, libsemigroups::Integers, and libsemigroups::BooleanSemiring.
- -
-
|
- -pure virtual | -
Returns the product of x
and y
.
Implemented in libsemigroups::NaturalSemiring, libsemigroups::TropicalMinPlusSemiring, libsemigroups::TropicalMaxPlusSemiring, libsemigroups::MinPlusSemiring, libsemigroups::MaxPlusSemiring, libsemigroups::Integers, and libsemigroups::BooleanSemiring.
- -
-
|
- -pure virtual | -
Returns the additive identity, or zero, of the semiring.
- -Implemented in libsemigroups::NaturalSemiring, libsemigroups::TropicalMinPlusSemiring, libsemigroups::TropicalMaxPlusSemiring, libsemigroups::MinPlusSemiring, libsemigroups::MaxPlusSemiring, libsemigroups::Integers, and libsemigroups::BooleanSemiring.
- -
-
|
- -static | -
Value representing \(\infty\).
- -
-
|
- -static | -
Value representing \(-\infty\).
- -
-
|
- -static | -
Value representing an undefined quantity.
- -
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::SemiringWithThreshold, including all inherited members.
-INFTY | libsemigroups::Semiring< int64_t > | static |
MINUS_INFTY | libsemigroups::Semiring< int64_t > | static |
one() const=0 | libsemigroups::Semiring< int64_t > | pure virtual |
plus(int64_t x, int64_t y) const=0 | libsemigroups::Semiring< int64_t > | pure virtual |
prod(int64_t x, int64_t y) const=0 | libsemigroups::Semiring< int64_t > | pure virtual |
SemiringWithThreshold(int64_t threshold) | libsemigroups::SemiringWithThreshold | inlineexplicit |
threshold() const | libsemigroups::SemiringWithThreshold | inline |
UNDEFINED | libsemigroups::Semiring< int64_t > | static |
zero() const=0 | libsemigroups::Semiring< int64_t > | pure virtual |
~Semiring() | libsemigroups::Semiring< int64_t > | inlinevirtual |
- libsemigroups
-
- |
-
This abstract class provides common methods for its subclasses TropicalMaxPlusSemiring, TropicalMinPlusSemiring, and NaturalSemiring. - More...
- -#include <semiring.h>
-Public Member Functions | |
SemiringWithThreshold (int64_t threshold) | |
A class for semirings with a threshold. More... | |
int64_t | threshold () const |
Returns the threshold of a semiring with threshold. More... | |
Public Member Functions inherited from libsemigroups::Semiring< int64_t > | |
virtual | ~Semiring () |
A default destructor. More... | |
virtual int64_t | one () const=0 |
Returns the multiplicative identity, or one, of the semiring. More... | |
virtual int64_t | plus (int64_t x, int64_t y) const=0 |
Returns the sum of x and y . More... | |
virtual int64_t | prod (int64_t x, int64_t y) const=0 |
Returns the product of x and y . More... | |
virtual int64_t | zero () const=0 |
Returns the additive identity, or zero, of the semiring. More... | |
-Additional Inherited Members | |
Static Public Attributes inherited from libsemigroups::Semiring< int64_t > | |
static const int64_t | INFTY |
Value representing \(\infty\). More... | |
static const int64_t | MINUS_INFTY |
Value representing \(-\infty\). More... | |
static const int64_t | UNDEFINED |
Value representing an undefined quantity. More... | |
This abstract class provides common methods for its subclasses TropicalMaxPlusSemiring, TropicalMinPlusSemiring, and NaturalSemiring.
-
-
|
- -inlineexplicit | -
A class for semirings with a threshold.
-The threshold of a semiring is related to the largest finite value in the semiring.
- -
-
|
- -inline | -
Returns the threshold of a semiring with threshold.
- -
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::Transf< TValueType, TContainer >, including all inherited members.
-in_place_product(Transf const &x, Transf const &y) | libsemigroups::Transf< TValueType, TContainer > | inline |
- libsemigroups
-
- |
-
Template class for transformations. - More...
- -#include <transf.hpp>
-Public Member Functions | |
void | in_place_product (Transf const &x, Transf const &y) |
Multiply x and y and stores the result in this . More... | |
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 PTransformation 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\}\).
-
-
|
- -inline | -
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
.
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::Transformation< T >, including all inherited members.
-_vector | libsemigroups::ElementWithVectorData< T, Transformation< T > > | protected |
at(size_t pos) const | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inline |
begin() const | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inline |
cache_hash_value() const override | libsemigroups::Transformation< T > | inlineprotectedvirtual |
cbegin() const | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inline |
cend() const | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inline |
complexity() const override | libsemigroups::PartialTransformation< T, Transformation< T > > | inlinevirtual |
copy(Element const *x) override | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inlinevirtual |
crank() const | libsemigroups::PartialTransformation< T, Transformation< T > > | inline |
degree() const override | libsemigroups::PartialTransformation< T, Transformation< T > > | inlinevirtual |
Element(elm_t type=Element::elm_t::NOT_RWSE) | libsemigroups::Element | inlineexplicit |
ElementWithVectorData() | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inline |
ElementWithVectorData(std::vector< T > *vector) | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inlineexplicit |
ElementWithVectorData(std::vector< T > const &vector) | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inlineexplicit |
elm_t enum name | libsemigroups::Element | |
end() const | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inline |
get_type() const | libsemigroups::Element | inline |
hash_value() const | libsemigroups::Element | inline |
identity() const override | libsemigroups::PartialTransformation< T, Transformation< T > > | inlinevirtual |
NOT_RWSE enum value | libsemigroups::Element | |
operator<(Element const &that) const override | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inlinevirtual |
operator==(Element const &that) const override | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inlinevirtual |
operator[](size_t pos) const | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inline |
really_copy(size_t increase_deg_by=0) const override | libsemigroups::Transformation< T > | inlinevirtual |
really_delete() override | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inlinevirtual |
redefine(Element const *x, Element const *y) override | libsemigroups::Transformation< T > | inlinevirtual |
PartialTransformation< T, Transformation< T > >::redefine(Element const *x, Element const *y, size_t const &thread_id) | libsemigroups::Element | inlinevirtual |
reset_hash_value() const | libsemigroups::Element | inlineprotected |
RWSE enum value | libsemigroups::Element | |
swap(Element *x) override | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inlinevirtual |
UNDEFINED | libsemigroups::PartialTransformation< T, Transformation< T > > | static |
vector_hash(std::vector< T > const *vec) | libsemigroups::ElementWithVectorData< T, Transformation< T > > | inlineprotectedstatic |
~Element() | libsemigroups::Element | inlinevirtual |
- libsemigroups
-
- |
-
Template class for transformations. - More...
- -#include <elements.h>
-Public Member Functions | |
Element * | really_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... | |
Element * | identity () 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... | |
T | 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... | |
T | operator[] (size_t pos) const |
Returns the pos entry in the vector containing the defining data. More... | |
Element * | really_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... | |
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\}\).
-
-
|
- -inlineoverrideprotectedvirtual | -
This method is included because it seems to give superior performance in some benchmarks.
- -Implements libsemigroups::Element.
- -
-
|
- -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.
- -
-
|
- -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.
- -
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::TropicalMaxPlusSemiring, including all inherited members.
-INFTY | libsemigroups::Semiring< int64_t > | static |
MINUS_INFTY | libsemigroups::Semiring< int64_t > | static |
one() const override | libsemigroups::TropicalMaxPlusSemiring | inlinevirtual |
plus(int64_t x, int64_t y) const override | libsemigroups::TropicalMaxPlusSemiring | inlinevirtual |
prod(int64_t x, int64_t y) const override | libsemigroups::TropicalMaxPlusSemiring | inlinevirtual |
SemiringWithThreshold(int64_t threshold) | libsemigroups::SemiringWithThreshold | inlineexplicit |
threshold() const | libsemigroups::SemiringWithThreshold | inline |
TropicalMaxPlusSemiring(int64_t threshold) | libsemigroups::TropicalMaxPlusSemiring | inlineexplicit |
UNDEFINED | libsemigroups::Semiring< int64_t > | static |
zero() const override | libsemigroups::TropicalMaxPlusSemiring | inlinevirtual |
~Semiring() | libsemigroups::Semiring< int64_t > | inlinevirtual |
- libsemigroups
-
- |
-
The tropical max-plus semiring consists of the integers \(\{0, \ldots , t\}\) for some value \(t\) (called the threshold of the semiring) and \(-\infty\). Negative infinity is represented by Semiring<int64_t>::MINUS_INFTY. - More...
- -#include <semiring.h>
-Public Member Functions | |
TropicalMaxPlusSemiring (int64_t threshold) | |
Construct from threshold. More... | |
int64_t | one () const override |
Returns the multiplicative identity, or one, of the semiring. More... | |
int64_t | plus (int64_t x, int64_t y) const override |
Returns the minimum of (the maximum of x and y ) and the threshold of the semiring. More... | |
int64_t | prod (int64_t x, int64_t y) const override |
Returns Semiring<int64_t>::MINUS_INFTY if x or y equals Semiring<int64_t>::MINUS_INFTY, otherwise returns the minimum of x + y and the threshold of the semiring. More... | |
int64_t | zero () const override |
Returns the Semiring<int64_t>::MINUS_INFTY. More... | |
Public Member Functions inherited from libsemigroups::SemiringWithThreshold | |
SemiringWithThreshold (int64_t threshold) | |
A class for semirings with a threshold. More... | |
int64_t | threshold () const |
Returns the threshold of a semiring with threshold. More... | |
Public Member Functions inherited from libsemigroups::Semiring< int64_t > | |
virtual | ~Semiring () |
A default destructor. More... | |
-Additional Inherited Members | |
Static Public Attributes inherited from libsemigroups::Semiring< int64_t > | |
static const int64_t | INFTY |
Value representing \(\infty\). More... | |
static const int64_t | MINUS_INFTY |
Value representing \(-\infty\). More... | |
static const int64_t | UNDEFINED |
Value representing an undefined quantity. More... | |
The tropical max-plus semiring consists of the integers \(\{0, \ldots , t\}\) for some value \(t\) (called the threshold of the semiring) and \(-\infty\). Negative infinity is represented by Semiring<int64_t>::MINUS_INFTY.
-
-
|
- -inlineexplicit | -
Construct from threshold.
-The threshold is the largest integer in the semiring.
- -
-
|
- -inlineoverridevirtual | -
Returns the multiplicative identity, or one, of the semiring.
- -Implements libsemigroups::Semiring< int64_t >.
- -
-
|
- -inlineoverridevirtual | -
Returns the minimum of (the maximum of x
and y
) and the threshold of the semiring.
Implements libsemigroups::Semiring< int64_t >.
- -
-
|
- -inlineoverridevirtual | -
Returns Semiring<int64_t>::MINUS_INFTY if x
or y
equals Semiring<int64_t>::MINUS_INFTY, otherwise returns the minimum of x
+ y
and the threshold of the semiring.
Implements libsemigroups::Semiring< int64_t >.
- -
-
|
- -inlineoverridevirtual | -
Returns the Semiring<int64_t>::MINUS_INFTY.
- -Implements libsemigroups::Semiring< int64_t >.
- -
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::TropicalMinPlusSemiring, including all inherited members.
-INFTY | libsemigroups::Semiring< int64_t > | static |
MINUS_INFTY | libsemigroups::Semiring< int64_t > | static |
one() const override | libsemigroups::TropicalMinPlusSemiring | inlinevirtual |
plus(int64_t x, int64_t y) const override | libsemigroups::TropicalMinPlusSemiring | inlinevirtual |
prod(int64_t x, int64_t y) const override | libsemigroups::TropicalMinPlusSemiring | inlinevirtual |
SemiringWithThreshold(int64_t threshold) | libsemigroups::SemiringWithThreshold | inlineexplicit |
threshold() const | libsemigroups::SemiringWithThreshold | inline |
TropicalMinPlusSemiring(int64_t threshold) | libsemigroups::TropicalMinPlusSemiring | inlineexplicit |
UNDEFINED | libsemigroups::Semiring< int64_t > | static |
zero() const override | libsemigroups::TropicalMinPlusSemiring | inlinevirtual |
~Semiring() | libsemigroups::Semiring< int64_t > | inlinevirtual |
- libsemigroups
-
- |
-
The tropical min-plus semiring consists of the integers \(\{0, \ldots , t\}\) for some value \(t\) (called the threshold of the semiring) and \(\infty\). Infinity is represented by Semiring<int64_t>::INFTY. - More...
- -#include <semiring.h>
-Public Member Functions | |
TropicalMinPlusSemiring (int64_t threshold) | |
Construct from threshold. More... | |
int64_t | one () const override |
Returns the integer 0. More... | |
int64_t | plus (int64_t x, int64_t y) const override |
Returns Semiring<int64_t>::INFTY if either of x and y is Semiring<int64_t>::INFTY, and otherwise the minimum of x, y, and the threshold of the semiring. More... | |
int64_t | prod (int64_t x, int64_t y) const override |
Returns Semiring<int64_t>::INFTY if x or y equals Semiring<int64_t>::INFTY, otherwise return the minimum of x + y and the threshold of the semiring. More... | |
int64_t | zero () const override |
Returns the Semiring<int64_t>::INFTY. More... | |
Public Member Functions inherited from libsemigroups::SemiringWithThreshold | |
SemiringWithThreshold (int64_t threshold) | |
A class for semirings with a threshold. More... | |
int64_t | threshold () const |
Returns the threshold of a semiring with threshold. More... | |
Public Member Functions inherited from libsemigroups::Semiring< int64_t > | |
virtual | ~Semiring () |
A default destructor. More... | |
-Additional Inherited Members | |
Static Public Attributes inherited from libsemigroups::Semiring< int64_t > | |
static const int64_t | INFTY |
Value representing \(\infty\). More... | |
static const int64_t | MINUS_INFTY |
Value representing \(-\infty\). More... | |
static const int64_t | UNDEFINED |
Value representing an undefined quantity. More... | |
The tropical min-plus semiring consists of the integers \(\{0, \ldots , t\}\) for some value \(t\) (called the threshold of the semiring) and \(\infty\). Infinity is represented by Semiring<int64_t>::INFTY.
-
-
|
- -inlineexplicit | -
Construct from threshold.
-The threshold is the largest integer in the semiring.
- -
-
|
- -inlineoverridevirtual | -
Returns the integer 0.
- -Implements libsemigroups::Semiring< int64_t >.
- -
-
|
- -inlineoverridevirtual | -
Returns Semiring<int64_t>::INFTY if either of x
and y
is Semiring<int64_t>::INFTY, and otherwise the minimum of x, y, and the threshold of the semiring.
Implements libsemigroups::Semiring< int64_t >.
- -
-
|
- -inlineoverridevirtual | -
Returns Semiring<int64_t>::INFTY if x
or y
equals Semiring<int64_t>::INFTY, otherwise return the minimum of x
+ y
and the threshold of the semiring.
Implements libsemigroups::Semiring< int64_t >.
- -
-
|
- -inlineoverridevirtual | -
Returns the Semiring<int64_t>::INFTY.
- -Implements libsemigroups::Semiring< int64_t >.
- -
- libsemigroups
-
- |
-
This is the complete list of members for libsemigroups::fpsemigroup::KnuthBendix, including all inherited members.
-::libsemigroups::congruence::KnuthBendix (defined in libsemigroups::fpsemigroup::KnuthBendix) | libsemigroups::fpsemigroup::KnuthBendix | friend |
::libsemigroups::KBE (defined in libsemigroups::fpsemigroup::KnuthBendix) | libsemigroups::fpsemigroup::KnuthBendix | friend |
add_rule(std::string const &, std::string const &) (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
add_rule(word_type const &, word_type const &) (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
add_rule(std::initializer_list< size_t >, std::initializer_list< size_t >) (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
add_rule(relation_type rel) (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
add_rule(std::pair< std::string, std::string >) (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
add_rules(FroidurePinBase &) (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
add_rules(std::vector< std::pair< std::string, std::string >> const &) (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
alphabet() const noexcept (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
cbegin_rules() const (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
cend_rules() const (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
char_to_uint(char) const (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | protected |
confluent() const | libsemigroups::fpsemigroup::KnuthBendix | |
const_iterator typedef (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
equal_to(std::string const &, std::string const &) override (defined in libsemigroups::fpsemigroup::KnuthBendix) | libsemigroups::fpsemigroup::KnuthBendix | |
equal_to(word_type const &, word_type const &) (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | virtual |
equal_to(std::initializer_list< letter_type >, std::initializer_list< letter_type >) (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
FpSemiBase(FpSemiBase const &)=delete (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
FpSemiBase(FpSemiBase &&)=delete (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
FpSemiBase() (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
froidure_pin() (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
has_froidure_pin() const noexcept (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
identity() const (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
inverses() const (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
is_obviously_finite() (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
is_obviously_infinite() (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
knuth_bendix() | libsemigroups::fpsemigroup::KnuthBendix | |
knuth_bendix_by_overlap_length() | libsemigroups::fpsemigroup::KnuthBendix | |
KnuthBendix(ReductionOrdering *) | libsemigroups::fpsemigroup::KnuthBendix | explicit |
KnuthBendix(FroidurePinBase &) (defined in libsemigroups::fpsemigroup::KnuthBendix) | libsemigroups::fpsemigroup::KnuthBendix | explicit |
KnuthBendix(KnuthBendix const *) (defined in libsemigroups::fpsemigroup::KnuthBendix) | libsemigroups::fpsemigroup::KnuthBendix | explicit |
KnuthBendix() | libsemigroups::fpsemigroup::KnuthBendix | |
normal_form(std::string const &) override (defined in libsemigroups::fpsemigroup::KnuthBendix) | libsemigroups::fpsemigroup::KnuthBendix | |
normal_form(word_type const &) (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | virtual |
normal_form(std::initializer_list< letter_type >) (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
nr_active_rules() const noexcept | libsemigroups::fpsemigroup::KnuthBendix | |
nr_rules() const noexcept (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
operator<<(std::ostream &, KnuthBendix const &) | libsemigroups::fpsemigroup::KnuthBendix | friend |
operator=(FpSemiBase const &)=delete (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
operator=(FpSemiBase &&)=delete (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
overlap_policy enum name | libsemigroups::fpsemigroup::KnuthBendix | |
rewrite(std::string *) const | libsemigroups::fpsemigroup::KnuthBendix | |
rewrite(std::string) const | libsemigroups::fpsemigroup::KnuthBendix | |
rules() const | libsemigroups::fpsemigroup::KnuthBendix | |
run() override (defined in libsemigroups::fpsemigroup::KnuthBendix) | libsemigroups::fpsemigroup::KnuthBendix | |
set_alphabet(std::string const &) (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
set_alphabet(size_t) (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
set_check_confluence_interval(size_t) | libsemigroups::fpsemigroup::KnuthBendix | |
set_identity(std::string const &) (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
set_identity(letter_type) (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
set_inverses(std::string const &) (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
set_max_overlap(size_t) | libsemigroups::fpsemigroup::KnuthBendix | |
set_max_rules(size_t) | libsemigroups::fpsemigroup::KnuthBendix | |
set_overlap_policy(overlap_policy) | libsemigroups::fpsemigroup::KnuthBendix | |
size() override (defined in libsemigroups::fpsemigroup::KnuthBendix) | libsemigroups::fpsemigroup::KnuthBendix | |
string_to_word(std::string const &) const (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
to_gap_string() (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
uint_to_char(size_t) const noexcept (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | protected |
validate_letter(char) const (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | protected |
validate_letter(letter_type) const (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | protected |
validate_relation(std::string const &, std::string const &) const (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | protected |
validate_relation(std::pair< std::string, std::string > const &) const (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | protected |
validate_relation(relation_type const &) const (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | protected |
validate_relation(word_type const &, word_type const &) const (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | protected |
validate_word(std::string const &) const (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | protected |
validate_word(word_type const &) const (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | protected |
word_to_string(word_type const &) const (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | |
~FpSemiBase() (defined in libsemigroups::FpSemiBase) | libsemigroups::FpSemiBase | virtual |
~KnuthBendix() | libsemigroups::fpsemigroup::KnuthBendix |
- libsemigroups
-
- |
-
This class is used to represent a string rewriting system defining a finitely presented monoid or semigroup. - More...
- -#include <knuth-bendix.hpp>
Inherits libsemigroups::FpSemiBase.
--Public Types | |
enum | overlap_policy { ABC = 0, -AB_BC = 1, -MAX_AB_BC = 2 - } |
The values in this enum determine how a rewriting system measures the length \(d(AB, BC)\) of the overlap of two words \(AB\) and \(BC\): More... | |
-Public Member Functions | |
KnuthBendix (ReductionOrdering *) | |
Constructs rewriting system with no rules and the reduction ordering order . More... | |
- | KnuthBendix (FroidurePinBase &) |
- | KnuthBendix (KnuthBendix const *) |
KnuthBendix () | |
Constructs a rewriting system with no rules, and the SHORTLEX reduction ordering. More... | |
~KnuthBendix () | |
A default destructor. More... | |
bool | confluent () const |
Returns true if the rewriting system is confluent and false if it is not. More... | |
-bool | equal_to (std::string const &, std::string const &) override |
void | knuth_bendix () |
Run the Knuth-Bendix algorithm on the rewriting system. More... | |
void | knuth_bendix_by_overlap_length () |
This method runs the Knuth-Bendix algorithm on the rewriting system by considering all overlaps of a given length \(n\) (according to the KnuthBendix::overlap_measure) before those overlaps of length \(n + 1\). More... | |
-std::string | normal_form (std::string const &) override |
size_t | nr_active_rules () const noexcept |
Returns the current number of active rules in the rewriting system. More... | |
std::string * | rewrite (std::string *) const |
Rewrites the word w in-place according to the current rules in the rewriting system, and returns it. More... | |
std::string | rewrite (std::string) const |
Rewrites a copy of the word w rewritten according to the current rules in the rewriting system. More... | |
std::vector< std::pair< std::string, std::string > > | rules () const |
This method returns a vector consisting of the pairs of strings which represent the rules of the rewriting system. The first entry in every such pair is greater than the second according to the reduction ordering of the rewriting system. The rules are sorted according to the reduction ordering used by the rewriting system, on the first entry. More... | |
-void | run () override |
void | set_check_confluence_interval (size_t) |
The method KnuthBendix::knuth_bendix periodically checks if the system is already confluent. This method can be used to set how frequently this happens, it is the number of new overlaps that should be considered before checking confluence. Setting this value too low can adversely affect the performance of KnuthBendix::knuth_bendix. More... | |
void | set_max_overlap (size_t) |
This method can be used to specify the maximum length of the overlap of two left hand sides of rules that should be considered in KnuthBendix::knuth_bendix. More... | |
void | set_max_rules (size_t) |
This method sets the (approximate) maximum number of rules that the system should contain. If this is number is exceeded in calls to KnuthBendix::knuth_bendix or KnuthBendix::knuth_bendix_by_overlap_length, then these methods will terminate and the system may not be confluent. More... | |
void | set_overlap_policy (overlap_policy) |
This method can be used to determine the way that the length of an overlap of two words in the system is meaasured. More... | |
-size_t | size () override |
-Friends | |
-class | ::libsemigroups::congruence::KnuthBendix |
-class | ::libsemigroups::KBE |
std::ostream & | operator<< (std::ostream &, KnuthBendix const &) |
This method allows a KnuthBendix object to be left shifted into a std::ostream, such as std::cout. The currently active rules of the system are represented in the output. More... | |
This class is used to represent a string rewriting system defining a finitely presented monoid or semigroup.
-
-
|
- -strong | -
The values in this enum determine how a rewriting system measures the length \(d(AB, BC)\) of the overlap of two words \(AB\) and \(BC\):
-
-
|
- -explicit | -
Constructs rewriting system with no rules and the reduction ordering order
.
This constructs a rewriting system with no rules, and with the reduction ordering ReductionOrdering specifed by the parameter order
.
libsemigroups::fpsemigroup::KnuthBendix::KnuthBendix | -( | -) | -- |
Constructs a rewriting system with no rules, and the SHORTLEX reduction ordering.
- -libsemigroups::fpsemigroup::KnuthBendix::~KnuthBendix | -( | -) | -- |
A default destructor.
-This deletes the reduction order used to construct the object, and the rules in the system.
- -bool libsemigroups::fpsemigroup::KnuthBendix::confluent | -( | -) | -const | -
Returns true
if the rewriting system is confluent and false
if it is not.
void libsemigroups::fpsemigroup::KnuthBendix::knuth_bendix | -( | -) | -- |
Run the Knuth-Bendix algorithm on the rewriting system.
-void libsemigroups::fpsemigroup::KnuthBendix::knuth_bendix_by_overlap_length | -( | -) | -- |
This method runs the Knuth-Bendix algorithm on the rewriting system by considering all overlaps of a given length \(n\) (according to the KnuthBendix::overlap_measure) before those overlaps of length \(n + 1\).
-
-
|
- -noexcept | -
Returns the current number of active rules in the rewriting system.
- -std::string* libsemigroups::fpsemigroup::KnuthBendix::rewrite | -( | -std::string * | -) | -const | -
Rewrites the word w
in-place according to the current rules in the rewriting system, and returns it.
std::string libsemigroups::fpsemigroup::KnuthBendix::rewrite | -( | -std::string | -) | -const | -
Rewrites a copy of the word w
rewritten according to the current rules in the rewriting system.
std::vector<std::pair<std::string, std::string> > libsemigroups::fpsemigroup::KnuthBendix::rules | -( | -) | -const | -
This method returns a vector consisting of the pairs of strings which represent the rules of the rewriting system. The first
entry in every such pair is greater than the second
according to the reduction ordering of the rewriting system. The rules are sorted according to the reduction ordering used by the rewriting system, on the first entry.
void libsemigroups::fpsemigroup::KnuthBendix::set_check_confluence_interval | -( | -size_t | -) | -- |
The method KnuthBendix::knuth_bendix periodically checks if the system is already confluent. This method can be used to set how frequently this happens, it is the number of new overlaps that should be considered before checking confluence. Setting this value too low can adversely affect the performance of KnuthBendix::knuth_bendix.
-The default value is 4096, and should be set to KnuthBendix::UNBOUNDED if KnuthBendix::knuth_bendix should never check if the system is already confluent.
-void libsemigroups::fpsemigroup::KnuthBendix::set_max_overlap | -( | -size_t | -) | -- |
This method can be used to specify the maximum length of the overlap of two left hand sides of rules that should be considered in KnuthBendix::knuth_bendix.
-If this value is less than the longest left hand side of a rule, then KnuthBendix::knuth_bendix can terminate without the system being confluent.
-void libsemigroups::fpsemigroup::KnuthBendix::set_max_rules | -( | -size_t | -) | -- |
This method sets the (approximate) maximum number of rules that the system should contain. If this is number is exceeded in calls to KnuthBendix::knuth_bendix or KnuthBendix::knuth_bendix_by_overlap_length, then these methods will terminate and the system may not be confluent.
-void libsemigroups::fpsemigroup::KnuthBendix::set_overlap_policy | -( | -overlap_policy | -) | -- |
This method can be used to determine the way that the length of an overlap of two words in the system is meaasured.
-
-
|
- -friend | -
This method allows a KnuthBendix object to be left shifted into a std::ostream, such as std::cout. The currently active rules of the system are represented in the output.
- -
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
This file contains an implementation of out-regular digraph which represents the action of a semigroup on a set. -More...
-#include <queue>
#include <random>
#include <stack>
#include <stddef.h>
#include <type_traits>
#include <vector>
#include "containers.hpp"
#include "forest.hpp"
#include "iterator.hpp"
#include "libsemigroups-debug.hpp"
#include "libsemigroups-exception.hpp"
#include "range.hpp"
Go to the source code of this file.
--Classes | |
class | libsemigroups::ActionDigraph< TIntType > |
Class for out-regular digraphs. More... | |
-Namespaces | |
libsemigroups | |
Namespace for everything in the libsemigroups library. | |
This file contains an implementation of out-regular digraph which represents the action of a semigroup on a set.
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
-Files | |
file | adapters.hpp [code] |
This file contains function templates for adapting a user-defined type so that it can be used with libsemigroups. | |
file | digraph.hpp [code] |
This file contains an implementation of out-regular digraph which represents the action of a semigroup on a set. | |
file | froidure-pin.hpp [code] |
This file contains a declaration of the class template FroidurePin which implements the Froidure-Pin algorithm as described in Algorithms for computing finite semigroups | |
file | kbe.hpp [code] |
This file contains the declaration of the class KBE, which can be used as the element_type for a FroidurePin instance. This class essentially wraps a reduced word of a KnuthBendix instance. | |
file | libsemigroups.hpp [code] |
This file includes all the headers in libsemigroups, for convenience. | |
file | orb.hpp [code] |
This file contains a generic implementation of a class Orb which represents the action of a semigroup on a set. | |
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
▼ src | |
blocks.h | |
cong.h | |
elements.h | |
libsemigroups-config.h | |
libsemigroups-debug.h | |
partition.h | |
rws.h | |
rwse.h | |
semigroups.h | |
semiring.h |
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
This file contains a declaration of the class template FroidurePin which implements the Froidure-Pin algorithm as described in Algorithms for computing finite semigroups -More...
-#include <stddef.h>
#include <iterator>
#include <mutex>
#include <thread>
#include <type_traits>
#include <unordered_map>
#include <utility>
#include <vector>
#include "adapters.hpp"
#include "constants.hpp"
#include "containers.hpp"
#include "froidure-pin-base.hpp"
#include "iterator.hpp"
#include "libsemigroups-config.hpp"
#include "libsemigroups-debug.hpp"
#include "libsemigroups-exception.hpp"
#include "report.hpp"
#include "stl.hpp"
#include "timer.hpp"
#include "traits.hpp"
#include "types.hpp"
#include "froidure-pin-impl.hpp"
Go to the source code of this file.
--Classes | |
class | libsemigroups::FroidurePin< TElementType, TElementHash, TElementEqual, TTraits > |
Class for semigroups generated by instances of Element. More... | |
-Namespaces | |
libsemigroups | |
Namespace for everything in the libsemigroups library. | |
This file contains a declaration of the class template FroidurePin which implements the Froidure-Pin algorithm as described in Algorithms for computing finite semigroups
-For technical reasons the implementation of the methods of the FroidurePin class template is contained in include/froidure-pin-impl.hpp.
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
This page explains how to interpret the graphs that are generated by doxygen.
-Consider the following example:
This will result in the following graph:
-The boxes in the above graph have the following meaning:
-The arrows have the following meaning:
-
- libsemigroups
-
- |
-
Clibsemigroups::Blocks | Class for signed partitions of the set \(\{0, \ldots, n - 1\}\) |
Clibsemigroups::Congruence | Class for congruence on a semigroup or fintely presented semigroup |
▼Clibsemigroups::Element | Abstract base class for semigroup elements |
▼Clibsemigroups::ElementWithVectorData< bool, BooleanMat > | |
▼Clibsemigroups::ElementWithVectorDataDefaultHash< bool, BooleanMat > | |
▼Clibsemigroups::MatrixOverSemiringBase< bool, BooleanMat > | |
Clibsemigroups::BooleanMat | Matrices over the boolean semiring |
▼Clibsemigroups::ElementWithVectorData< int64_t, ProjectiveMaxPlusMatrix > | |
▼Clibsemigroups::ElementWithVectorDataDefaultHash< int64_t, ProjectiveMaxPlusMatrix > | |
▼Clibsemigroups::MatrixOverSemiringBase< int64_t, ProjectiveMaxPlusMatrix > | |
Clibsemigroups::ProjectiveMaxPlusMatrix | Class for projective max-plus matrices |
▼Clibsemigroups::ElementWithVectorData< std::vector< u_int32_t >, PBR > | |
Clibsemigroups::PBR | Class for partitioned binary relations (PBR) |
▼Clibsemigroups::ElementWithVectorData< T, PartialPerm< T > > | |
▼Clibsemigroups::ElementWithVectorDataDefaultHash< T, PartialPerm< T > > | |
▼Clibsemigroups::PartialTransformation< T, PartialPerm< T > > | |
Clibsemigroups::PartialPerm< T > | Template class for partial permutations |
▼Clibsemigroups::ElementWithVectorData< T, Transformation< T > > | |
▼Clibsemigroups::ElementWithVectorDataDefaultHash< T, Transformation< T > > | |
▼Clibsemigroups::PartialTransformation< T, Transformation< T > > | |
▼Clibsemigroups::Transformation< T > | Template class for transformations |
Clibsemigroups::Permutation< T > | Template class for permutations |
▼Clibsemigroups::ElementWithVectorData< TValueType, MatrixOverSemiring< TValueType > > | |
▼Clibsemigroups::ElementWithVectorDataDefaultHash< TValueType, MatrixOverSemiring< TValueType > > | |
▼Clibsemigroups::MatrixOverSemiringBase< TValueType, MatrixOverSemiring< TValueType > > | |
Clibsemigroups::MatrixOverSemiring< TValueType > | Matrices over a semiring |
▼Clibsemigroups::ElementWithVectorData< u_int32_t, Bipartition > | |
▼Clibsemigroups::ElementWithVectorDataDefaultHash< u_int32_t, Bipartition > | |
Clibsemigroups::Bipartition | Class for bipartitions |
▼Clibsemigroups::ElementWithVectorData< TValueType, TSubclass > | Abstract base class for elements using a vector to store their defining data |
▼Clibsemigroups::ElementWithVectorDataDefaultHash< TValueType, TSubclass > | Abstract base class for elements using a vector to store their defining data and the default hash function for that underlying vector |
Clibsemigroups::MatrixOverSemiringBase< TValueType, TSubclass > | Matrices over a semiring |
Clibsemigroups::PartialTransformation< TValueType, TSubclass > | Abstract class for partial transformations |
Clibsemigroups::RWSE | Subclass of Element that wraps an libsemigroups::rws_word_t |
Clibsemigroups::Element::Equal | Provides a call operator for comparing Elements via pointers |
Clibsemigroups::Element::Hash | Provides a call operator returning a hash value for an Element via a pointer |
Clibsemigroups::Partition< T > | Class for partitions of a set used by Congruence::nontrivial_classes |
▼Clibsemigroups::ReductionOrdering | This class provides a call operator which can be used to compare libsemigroups::rws_word_t |
Clibsemigroups::SHORTLEX | This class implements the shortlex reduction ordering derived from an ordering on libsemigroups::rws_letter_t's |
Clibsemigroups::RWS | This class is used to represent a string rewriting system defining a finitely presented monoid or semigroup |
Clibsemigroups::Semigroup | Class for semigroups generated by instances of Element |
Clibsemigroups::Semiring< T > | This class its subclasses provide very basic functionality for creating semirings |
▼Clibsemigroups::Semiring< bool > | |
Clibsemigroups::BooleanSemiring | The usual Boolean semiring |
▼Clibsemigroups::Semiring< int64_t > | |
Clibsemigroups::Integers | The usual ring of integers |
Clibsemigroups::MaxPlusSemiring | The max-plus semiring consists of the integers together with negative infinity with operations max and plus. Negative infinity is represented by Semiring<int64_t>::MINUS_INFTY |
Clibsemigroups::MinPlusSemiring | The min-plus semiring consists of the integers together with infinity with operations min and plus. Infinity is represented by Semiring<int64_t>::INFTY |
▼Clibsemigroups::SemiringWithThreshold | This abstract class provides common methods for its subclasses TropicalMaxPlusSemiring, TropicalMinPlusSemiring, and NaturalSemiring |
Clibsemigroups::NaturalSemiring | This class implements the semiring consisting of \(\{0, 1, ..., t, t + 1, ..., t + p - 1\}\) for some threshold \(t\) and period \(p\) with operations addition and multiplication modulo the congruence \(t = t + p\) |
Clibsemigroups::TropicalMaxPlusSemiring | The tropical max-plus semiring consists of the integers \(\{0, \ldots , t\}\) for some value \(t\) (called the threshold of the semiring) and \(-\infty\). Negative infinity is represented by Semiring<int64_t>::MINUS_INFTY |
Clibsemigroups::TropicalMinPlusSemiring | The tropical min-plus semiring consists of the integers \(\{0, \ldots , t\}\) for some value \(t\) (called the threshold of the semiring) and \(\infty\). Infinity is represented by Semiring<int64_t>::INFTY |
Clibsemigroups::Semiring< TValueType > |
- libsemigroups
-
- |
-
- libsemigroups
-
- |
-
The current version of libsemigroups is 0.6.7.
-libsemigroups is a C++ library for semigroups and monoids using C++11; it is partly based on Algorithms for computing finite semigroups, Expository Slides, and Semigroupe 2.01 by Jean-Eric Pin. libsemigroups uses catch for its unit tests.
-The libsemigroups library is used in the Semigroups package for GAP. The development version is available on Github, and there are python bindings (for Python 2 and 3).
-Some of the features of Semigroupe 2.01 are not yet implemented in libsemigroups, this is a work in progress. Missing features include those for:
-These will be included in a future version.
-libsemigroups performs roughly the same as Semigroupe 2.01 when there is a known upper bound on the size of the semigroup being enumerated, and this is used to initialise the data structures for the semigroup; see libsemigroups::Semigroup::reserve for more details. Note that in Semigroupe 2.01 it is always necessary to provide such an upper bound, but in libsemigroups it is not.
-libsemigroups also has some advantages over Semigroupe 2.01:
-This installation method assumes that you have anaconda or miniconda installed. See the getting started and miniconda download page on the conda website.
-Activate the conda-forge package repository:
conda config --add channels conda-forge -
Install libsemigroups
conda install libsemigroups -
libsemigroups requires a C++ compiler supporting the C++11 standard. To install libsemigroups from the sources (this also requires autoconf
and automake
):
git clone https://github.com/james-d-mitchell/libsemigroups -cd libsemigroups -./autogen.sh && ./configure && make && sudo make install -
To enable assertions and other debugging checks enabled do:
./autogen.sh && ./configure --enable-debug && make && sudo make install -
By default, make install
installs the library and its pkg-config
configuration into /usr/local
. One can also specify another install location, say, /foo/bar
, by calling ./configure
with parameter --prefix
, e.g. ./configure --prefix=/foo/bar
. This might be useful if sudo
is not available.
If you have pkg-config
installed, it may be called to get libsemigroups
's version, location, etc (see its docs for details; this facility is used in GAP package Semigroups, which may be configured to use the external libsemigroups). E.g.
pkg-config --modversion libsemigroups -
will print the version of the installed libsemigroups, provided it is scanning configurations in the install location. For installation location unknown to pkg-config
, one needs to add it to PKG_CONFIG_PATH
(an environment variable). E.g. if it is /foo/bar
as above then
PKG_CONFIG_PATH=/foo/bar/lib/pkgconfig pkg-config --modversion libsemigroups -
will print the version of the installed libsemigroups. (As usual, PKG_CONFIG_PATH
may be exported, added to shell configuration, etc.)
The documentation is generated using doxygen and is available here. This documentation can be compiled by running ./autogen.sh && ./configure && make doc
in the libsemigroups
directory, and the tests can be run by doing make check
in the libsemigroups
directory.
There are python bindings (for Python 2 and 3) for most of the functionality of libsemigroups.
-If you find any problems with libsemigroups, or have any suggestions for features that you'd like to see, please use the issue tracker.
-We acknowledge financial support from the OpenDreamKit Horizon 2020 European Research Infrastructures project (#676541) (primarily for the python bindings).
-We thank the Carnegie Trust for the Universities of Scotland for funding the PhD scholarship of J. JonusÌŒas when he worked on this project.
-We thank the Engineering and Physical Sciences Research Council (EPSRC) for funding the PhD scholarship of M. Torpey when he worked on this project (EP/M506631/1).
-
- libsemigroups
-
- |
-
- - |
- - |
- - |
- - |
- - |
- - |
- - |
- - |
- - |
- - |
- - |
- - |
- - |
- libsemigroups
-
- |
-
t |
- libsemigroups
-
- |
-
This file contains the declaration of the class KBE, which can be used as the element_type for a FroidurePin instance. This class essentially wraps a reduced word of a KnuthBendix instance. -More...
-#include <cstddef>
#include <functional>
#include <string>
#include <utility>
#include "adapters.hpp"
#include "element.hpp"
#include "froidure-pin.hpp"
#include "knuth-bendix.hpp"
#include "types.hpp"
Go to the source code of this file.
--Classes | |
struct | std::equal_to< libsemigroups::KBE > |
Provides a call operator for comparing KBEs via references. More... | |
struct | std::hash< libsemigroups::KBE > |
Provides a call operator returning a hash value for an Element via a pointer. More... | |
class | libsemigroups::KBE |
Subclass of Element that wraps an libsemigroups::internal_string_type. More... | |
-Namespaces | |
libsemigroups | |
Namespace for everything in the libsemigroups library. | |
This file contains the declaration of the class KBE, which can be used as the element_type for a FroidurePin instance. This class essentially wraps a reduced word of a KnuthBendix instance.
-