template<size_t N, typename Point = typename SmallestInteger<N>::type, typename Element = LeastPerm<N>, typename Traits = SchreierSimsTraits<N, Point, Element>>
class libsemigroups::SchreierSims< N, Point, Element, Traits >
Defined in schreier-sims.hpp
.
This class implements a deterministic version of the Schreier-Sims algorithm acting on a relatively small number of points ( \(< 1000\)).
- Template Parameters
-
N | the largest point not fixed by the permutations in the permutation group to be represented by this. |
Point | the type of the points acted on (default: the member type of SmallestInteger with template parameter N ). |
Element | the type of the group elements acting on Point (default: the member type of LeastPerm with template parameter N ). |
Traits | the type of traits object (default: SchreierSimsTraits with template parameters N , Point , and Element ). |
- See also
- SchreierSimsTraits.
- Example
Permutations with static or dynamic degree.
Definition transf.hpp:1530
typename detail::BruidhinnTraits< Element >::value_type element_type
Type of the elements.
Definition schreier-sims.hpp:201
uint64_t size()
Returns the size of the group represented by this.
SchreierSims()
Default constructor.
bool add_generator(const_element_reference x)
Add a generator.
|
using | Action = typename Traits::Action |
| Alias for Traits::Action .
|
|
using | const_element_reference |
| Type of a const reference to the elements.
|
|
using | Degree = typename Traits::Degree |
| Adapter for the degree of an element.
|
|
using | domain_type = typename Traits::domain_type |
| Type of the object containing all points acted on.
|
|
using | element_reference |
| Type of a reference to the elements.
|
|
using | element_type = typename detail::BruidhinnTraits<Element>::value_type |
| Type of the elements.
|
|
using | EqualTo = typename Traits::EqualTo |
| Adapter for testing equality.
|
|
using | index_type = typename Traits::index_type |
| Type of indices.
|
|
using | Inverse = typename Traits::Inverse |
| Adapter for the inverse of an element.
|
|
using | One = typename Traits::One |
| Adapter for the identity element of the given type.
|
|
using | point_type = Point |
| Type of the points acted on.
|
|
using | Product = typename Traits::Product |
| Adapter for the product of two elements.
|
|
using | Swap = typename Traits::Swap |
| Adapter for swapping.
|
|
template<size_t N, typename Point = typename SmallestInteger<N>::type, typename Element = LeastPerm<N>, typename Traits = SchreierSimsTraits<N, Point, Element>>
using Action = typename Traits::Action |
Alias for Traits::Action
. See Action for further details.
template<size_t N, typename Point = typename SmallestInteger<N>::type, typename Element = LeastPerm<N>, typename Traits = SchreierSimsTraits<N, Point, Element>>
using Degree = typename Traits::Degree |
Defined in adapters.hpp
.
Specialisations of this struct should be stateless trivially default constructible with a call operator of signature size_t operator()(Element const& x) const
(possibly noexcept
, inline
and/or constexpr
also).
The return value of the call operator ought to indicate the degree of a Element
instance which may or may not depend on the parameter x
. The degree of a permutation, for instance, would be the the number of points it acts on, the degree of a matrix is its dimension, and so on. This is used, for example, by SchreierSimsTraits in some member functions to determine whether it is known a priori that a permutation does not belong to the object, because it acts on too many points.
- Template Parameters
-
Element | the type of the elements of a semigroup. |
The second template parameter exists for SFINAE.
- Used by:
-
- Example
template <>
constexpr inline size_t operator()(
BMat8 const&)
const noexcept {
return 8;
}
};
Fast boolean matrices of dimension up to 8 x 8.
Definition bmat8.hpp:74
typename Traits::Degree Degree
Adapter for the degree of an element.
Definition schreier-sims.hpp:237
template<size_t N, typename Point = typename SmallestInteger<N>::type, typename Element = LeastPerm<N>, typename Traits = SchreierSimsTraits<N, Point, Element>>
Type of the object containing all points acted on.
template<size_t N, typename Point = typename SmallestInteger<N>::type, typename Element = LeastPerm<N>, typename Traits = SchreierSimsTraits<N, Point, Element>>
using element_type = typename detail::BruidhinnTraits<Element>::value_type |
The type of the elements of a SchreierSims instance with const removed, and if Element
is a pointer to const, then the second const is also removed.
template<size_t N, typename Point = typename SmallestInteger<N>::type, typename Element = LeastPerm<N>, typename Traits = SchreierSimsTraits<N, Point, Element>>
using EqualTo = typename Traits::EqualTo |
Defined in adapters.hpp
.
This type should be a stateless trivially default constructible with a call operator of signature bool operator()(Value const&, Value const&)
(possibly noexcept
, inline
and/or constexpr
also) for use with, for example, std::unordered_map.
- Template Parameters
-
Value | the type of objects to compare. |
The second template parameter exists for SFINAE.
- Used by:
-
template<size_t N, typename Point = typename SmallestInteger<N>::type, typename Element = LeastPerm<N>, typename Traits = SchreierSimsTraits<N, Point, Element>>
using Inverse = typename Traits::Inverse |
Defined in adapters.hpp
.
Specialisations of this struct should be stateless trivially default constructible with a call operator of signature Point operator()(Element const& x) const
(possibly noexcept
, inline
and/or constexpr
also).
The call operator should return the inverse of the element x
under the assumption that x
has an inverse (in the sense of groups). For example, if x
is a permutation, then this would return its inverse. If x
is a permutation matrix of type BMat8, then this operator would return its transpose.
- Template Parameters
-
Element | the type of the elements of a semigroup. |
The second template parameter exists for SFINAE.
- Used by:
-
- Example
template <>
inline BMat8 operator()(
BMat8 const& x)
const noexcept {
LIBSEMIGROUPS_ASSERT(x * x.transpose() == x.one());
return x.transpose();
}
};
typename Traits::Inverse Inverse
Adapter for the inverse of an element.
Definition schreier-sims.hpp:243
template<size_t N, typename Point = typename SmallestInteger<N>::type, typename Element = LeastPerm<N>, typename Traits = SchreierSimsTraits<N, Point, Element>>
using One = typename Traits::One |
Specialisations of this struct should be stateless trivially default constructible with two call operator of signatures:
Element operator()(size_t n) const
(possibly noexcept
, inline
and/or constexpr
also) returning a multiplicative identity element for the category Element
and with Degree<Element>()(x)
equal to the parameter n
. For example, if Element
is a type of n x n matrices, then this should return the n x n identity matrix.
Element operator()(T const&) const
(possibly noexcept
, inline
and/or constexpr
also). This could be implemented as: Element operator()(Element const& x) const noexcept {
}
- Template Parameters
-
Element | the type of the elements of a semigroup. |
The second template parameter exists for SFINAE.
- Used by:
-
- Example
template <typename T>
T,
typename
std::enable_if<std::is_base_of<PTransf16, T>::value>::type> {
T operator()(size_t = 0) const noexcept {
return T::one();
}
T operator()(T const&) const noexcept {
return T::one();
}
};
typename Traits::One One
Adapter for the identity element of the given type.
Definition schreier-sims.hpp:246
template<size_t N, typename Point = typename SmallestInteger<N>::type, typename Element = LeastPerm<N>, typename Traits = SchreierSimsTraits<N, Point, Element>>
Type of the points acted on. Also the template parameter Point
.
template<size_t N, typename Point = typename SmallestInteger<N>::type, typename Element = LeastPerm<N>, typename Traits = SchreierSimsTraits<N, Point, Element>>
using Product = typename Traits::Product |
Defined in adapters.hpp
.
Specialisations of this struct should be stateless trivially default constructible with a call operator of signature void operator()(Element&, Element const&, Element const&, size_t = 0)
(possibly noexcept
, inline
and/or constexpr
also).
The call operator should change xy
in-place to be the product of x
and y
. The 4th parameter is optional and it can be used as an index for static thread local storage, that might be required for forming the product of x
and y
. The purpose of the 1st parameter is to avoid repeated allocations of memory to hold temporary products that are discarded soon after they are created.
- Template Parameters
-
Element | the type of the elements of a semigroup. |
The second template parameter exists for SFINAE.
- Used by:
-
- Example
template <>
void operator()(size_t& xy, size_t x, size_t y, size_t = 0) const
noexcept {
xy = x * y;
}
};
typename Traits::Product Product
Adapter for the product of two elements.
Definition schreier-sims.hpp:249
template<size_t N, typename Point = typename SmallestInteger<N>::type, typename Element = LeastPerm<N>, typename Traits = SchreierSimsTraits<N, Point, Element>>
using Swap = typename Traits::Swap |
Defined in adapters.hpp
.
This type should be a stateless trivially default constructible with a call operator of signature void operator()(Value&, Value&)
(possibly noexcept
, inline
and/or constexpr
also) which swaps its arguments.
- Template Parameters
-
Value | the type of objects to swap. |
The second template parameter exists for SFINAE.
- Used by:
-
template<size_t N, typename Point = typename SmallestInteger<N>::type, typename Element = LeastPerm<N>, typename Traits = SchreierSimsTraits<N, Point, Element>>
This functions adds the argument x
as a new generator if and only if x
is not already an element of the group represented by the SchreierSims object.
- Parameters
-
x | a const reference to the generator to add. |
- Returns
true
if x
is added as a generator and false
if it is not.
- Exceptions
-
LibsemigroupsException | if the degree of x is not equal to the first template parameter N , or if this already contains the maximum number of elements. |
- Complexity
- Constant
template<size_t N, typename Point = typename SmallestInteger<N>::type, typename Element = LeastPerm<N>, typename Traits = SchreierSimsTraits<N, Point, Element>>
This functions adds the argument x
as a new generator if and only if x
is not already an element of the group represented by the SchreierSims object. For example, the identity element is never added as a generator.
- Parameters
-
x | a const reference to the generator to add. |
- Returns
true
if x
is added as a generator and false
if it is not.
- Complexity
- Constant
- Warning
- This functions performs no checks on its arguments. In particular, if the degree of
x
is not equal to the first template parameter N
, or if this
already contains the maximum number of elements, then bad things will happen.
template<size_t N, typename Point = typename SmallestInteger<N>::type, typename Element = LeastPerm<N>, typename Traits = SchreierSimsTraits<N, Point, Element>>
Get a base point, having checked index
if not out of range.
- Parameters
-
index | the index of the base point. |
- Returns
- the base point with index
index
.
- Exceptions
-
- Complexity
- Constant.
template<size_t N, typename Point = typename SmallestInteger<N>::type, typename Element = LeastPerm<N>, typename Traits = SchreierSimsTraits<N, Point, Element>>
size_t base_size |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
Get the size of the current base.
- Returns
- A
size_t
.
- Exceptions
- This function is
noexcept
and is guaranteed never to throw.
- Complexity
- Constant.
template<size_t N, typename Point = typename SmallestInteger<N>::type, typename Element = LeastPerm<N>, typename Traits = SchreierSimsTraits<N, Point, Element>>
uint64_t current_size |
( |
| ) |
const |
|
nodiscard |
Returns the size of the group represented by this without running the algorithm.
- Returns
- the size, a value of
uint64_t
.
- Exceptions
- This function guarantees not to throw a LibsemigroupsException.
template<size_t N, typename Point = typename SmallestInteger<N>::type, typename Element = LeastPerm<N>, typename Traits = SchreierSimsTraits<N, Point, Element>>
Check if the stabiliser chain is fully enumerated.
- Returns
true
if the stabiliser chain is fully enumerated and false
otherwise.
- Exceptions
- This function guarantees not to throw a LibsemigroupsException.
- Complexity
- Constant.
template<size_t N, typename Point = typename SmallestInteger<N>::type, typename Element = LeastPerm<N>, typename Traits = SchreierSimsTraits<N, Point, Element>>
Get a generator with a given index, having checked that the index is in bounds.
- Parameters
-
index | the index of the generator to return. |
- Returns
- A const reference to the generator of
this
with index index
.
- Exceptions
-
- Complexity
- Constant.
template<size_t N, typename Point = typename SmallestInteger<N>::type, typename Element = LeastPerm<N>, typename Traits = SchreierSimsTraits<N, Point, Element>>
Removes all generators, and orbits, and resets this
so that it represents the trivial group, as if this
had been newly constructed.
- Exceptions
- This function guarantees not to throw a LibsemigroupsException.
- Complexity
- \(O(N ^ 2)\) where
N
is the first template parameter.
template<size_t N, typename Point = typename SmallestInteger<N>::type, typename Element = LeastPerm<N>, typename Traits = SchreierSimsTraits<N, Point, Element>>
size_t number_of_strong_generators_no_checks |
( |
index_type | depth | ) |
const |
|
inlinenodiscard |
Return the number of strong generators at a given depth.
- Parameters
-
- Returns
- The number of strong generators, a value of
size_t
, at depth depth
of the stabiliser chain.
- Exceptions
- This function guarantees not to throw a LibsemigroupsException.
- Complexity
- Constant.
- Warning
- This functions performs no checks on its arguments. In particular, if
depth
is out of bounds, then bad things will happen.
template<size_t N, typename Point = typename SmallestInteger<N>::type, typename Element = LeastPerm<N>, typename Traits = SchreierSimsTraits<N, Point, Element>>
Sift an element through the stabiliser chain in-place, having checked the degree of x
is equal to the first template parameter N
.
- Parameters
-
x | a const reference to a group element. |
- Exceptions
-
template<size_t N, typename Point = typename SmallestInteger<N>::type, typename Element = LeastPerm<N>, typename Traits = SchreierSimsTraits<N, Point, Element>>
Sift an element through the stabiliser chain in-place.
- Parameters
-
x | a const reference to a group element. |
- Warning
- This functions performs no checks on its arguments. In particular, if either the degree of
x
is not equal to the first template parameter N
, then bad things will happen.