![]() |
libsemigroups
v3.0.0
C++ library for semigroups and monoids
|
This is a class template for partial transformations that collects all the common aspects of the subclasses StaticPTransf and DynamicPTransf. It is not intended that instance of this class are actually constructed, only its derived classes.
Scalar | the type of image values (must be an unsigned integer type). |
Container | the type of the container holding the image values. |
Public Types | |
using | const_iterator = typename Container::const_iterator |
Type of const iterators point to image values. | |
using | container_type = Container |
Type of the underlying container. | |
using | iterator = typename Container::iterator |
Type of iterators point to image values. | |
using | point_type = Scalar |
Type of the image values. | |
Public Member Functions | |
PTransfBase ()=default | |
Default constructor. | |
PTransfBase (Container &&cont) | |
Construct from a container of images. | |
PTransfBase (Container const &cont) | |
Construct from a container of images. | |
template<typename Iterator> | |
PTransfBase (Iterator first, Iterator last) | |
Construct from a range of images. | |
PTransfBase (PTransfBase &&)=default | |
Default move constructor. | |
PTransfBase (PTransfBase const &)=default | |
Default copy constructor. | |
PTransfBase (std::initializer_list< Scalar > cont) | |
Construct from a container of images. | |
point_type & | at (size_t i) |
Get a reference to the image of a point. | |
point_type const & | at (size_t i) const |
Get a const reference to the image of a point. | |
const_iterator | begin () const noexcept |
Returns a const_iterator (random access iterator) pointing at the first image value. | |
iterator | begin () noexcept |
Returns an iterator (random access iterator) pointing at the first image value. | |
const_iterator | cbegin () const noexcept |
Returns a const_iterator (random access iterator) pointing at the first image value. | |
const_iterator | cend () const noexcept |
Returns a const_iterator (random access iterator) pointing one past the last image value. | |
size_t | degree () const noexcept |
Returns the degree of a partial transformation. | |
const_iterator | end () const noexcept |
Returns a const_iterator (random access iterator) pointing one past the last image value. | |
iterator | end () noexcept |
Returns an iterator (random access iterator) pointing one past the last image value. | |
size_t | hash_value () const |
Returns a hash value. | |
bool | operator!= (PTransfBase const &that) const |
Compare for inequality. | |
template<typename Subclass> | |
Subclass | operator* (Subclass const &that) const |
Multiply by another partial transformation. | |
bool | operator< (PTransfBase const &that) const |
Compare for less. | |
bool | operator<= (PTransfBase const &that) const |
Compare for less than or equal. | |
PTransfBase & | operator= (PTransfBase &&)=default |
Default move assignment operator. | |
PTransfBase & | operator= (PTransfBase const &)=default |
Default copy assignment operator. | |
bool | operator== (PTransfBase const &that) const |
Compare for equality. | |
bool | operator> (PTransfBase const &that) const |
Compare for greater. | |
bool | operator>= (PTransfBase const &that) const |
Compare for greater than or equal. | |
point_type & | operator[] (size_t i) |
Get a reference to the image of a point. | |
point_type const & | operator[] (size_t i) const |
Get a const reference to the image of a point. | |
size_t | rank () const |
Returns the number of distinct image values. | |
void | swap (PTransfBase &that) noexcept |
Swap with another partial transformation. | |
Static Public Member Functions | |
template<typename Subclass, typename OtherContainer = Container> | |
static Subclass | make (OtherContainer &&cont) |
Construct from universal reference container and check. | |
template<typename Subclass, typename OtherScalar> | |
static Subclass | make (std::initializer_list< OtherScalar > cont) |
Construct from std::initializer_list and check. | |
template<typename Subclass> | |
static Subclass | one (size_t N) |
Returns the identity transformation on the given number of points. | |
static point_type | undef () noexcept |
Returns the value used to represent "undefined". | |
using const_iterator = typename Container::const_iterator |
Type of const iterators point to image values.
using container_type = Container |
Type of the underlying container.
using iterator = typename Container::iterator |
Type of iterators point to image values.
using point_type = Scalar |
Also the template parameter Scalar
.
|
default |
Constructs an uninitialized partial transformation of degree 0
.
|
inlineexplicit |
Constructs a partial transformation initialized using the container cont
as follows: the image of the point i
under the partial transformation is the value in position i
of the container cont
.
cont | the container. |
cont
.cont
are performed.
|
inlineexplicit |
Constructs a partial transformation initialized using the container cont
as follows: the image of the point i
under the partial transformation is the value in position i
of the container cont
.
cont | the container. |
cont
.cont
are performed.
|
inlineexplicit |
Constructs a partial transformation initialized using the iterators first
and last
as follows: the image of the point i
under the partial transformation at first + i
.
The values pointed at by iterators of type Iterator must be convertible to point_type or equal to UNDEFINED.
first | iterator pointing at the first image point. |
last | iterator pointing one beyond the last image point. |
cont
.cont
are performed.
|
inline |
Constructs a partial transformation initialized using the container cont
as follows: the image of the point i
under the partial transformation is the value in position i
of the container cont
.
cont | the container. |
cont
.cont
are performed.
|
default |
Default copy constructor
|
default |
Default move constructor
|
inlinenodiscard |
Returns a reference to the image of i
.
i | the point. |
std::out_of_range | if i is out of range. |
|
inlinenodiscard |
Returns a const reference to the image of i
.
i | the point. |
std::out_of_range | if i is out of range. |
|
inlinenodiscardnoexcept |
noexcept
and is guaranteed never to throw.
|
inlinenodiscardnoexcept |
noexcept
and is guaranteed never to throw.
|
inlinenodiscardnoexcept |
noexcept
and is guaranteed never to throw.
|
inlinenodiscardnoexcept |
noexcept
and is guaranteed never to throw.
|
inlinenodiscardnoexcept |
The degree of a partial transformation is the number of points used in its definition, which is equal to the size of the underlying container.
size_t
.noexcept
and is guaranteed never to throw.
|
inlinenodiscardnoexcept |
noexcept
and is guaranteed never to throw.
|
inlinenodiscardnoexcept |
noexcept
and is guaranteed never to throw.
|
inlinenodiscard |
size_t
.
|
staticnodiscard |
Constructs a partial transformation initialized using the container cont
as follows: the image of the point i
under the partial transformation is the value in position i
of the container cont
.
Subclass | the type of the return value. |
OtherContainer | universal reference for the type of the container (default: Container). |
cont | the container. |
LibsemigroupsException | if any of the following hold:
|
cont
.
|
staticnodiscard |
Constructs a partial transformation initialized using the container cont
as follows: the image of the point i
under the partial transformation is the value in position i
of the container cont
.
Subclass | the type of the return value. |
OtherScalar | the type of the points in cont . |
cont | the initializer list. |
LibsemigroupsException | if any of the following hold:
|
cont
.
|
inlinestaticnodiscard |
This function returns a newly constructed partial transformation with degree equal to the degree of N
that fixes every value from 0
to N - 1
.
Subclass | the return type. |
N | the degree of the identity being constructed. |
Subclass
.
|
inlinenodiscard |
Returns true
if *this
does not equal that
by comparing the image values of *this
and that
.
that | the partial transformation for comparison. |
bool
.
|
inlinenodiscard |
Returns a newly constructed partial transformation holding the product of *this
and that
.
Subclass | the return type. |
that | a partial transformation. |
Subclass
.*this
and that
have different degrees, then bad things may happen.
|
inlinenodiscard |
Returns true
if *this
is less than that
by comparing the image values of *this
and that
.
that | the partial transformation for comparison. |
bool
.
|
inlinenodiscard |
Returns true
if *this
is less than or equal to that
by comparing the image values of *this
and that
.
that | the partial transformation for comparison. |
bool
.
|
default |
Default move assignment operator.
|
default |
Default copy assignment operator.
|
inlinenodiscard |
Returns true
if *this
equals that
by comparing the image values of *this
and that
.
that | the partial transformation for comparison. |
bool
.
|
inlinenodiscard |
Returns true
if *this
is greater than that
by comparing the image values of *this
and that
.
that | the partial transformation for comparison. |
bool
.
|
inlinenodiscard |
Returns true
if *this
is greater than or equal to that
by comparing the image values of *this
and that
.
that | the partial transformation for comparison. |
bool
.
|
inlinenodiscard |
Returns a reference to the image of i
.
i | the point. |
i
.
|
inlinenodiscard |
Returns a const reference to the image of i
.
i | the point. |
i
.
|
inlinenodiscard |
The rank of a partial transformation is the number of its distinct image values, not including UNDEFINED.
size_t
.
|
inlinenoexcept |
that | the partial transformation to swap with. |
noexcept
and is guaranteed never to throw.
|
inlinestaticnodiscardnoexcept |
This static function returns the value of type point_type used to represent an "undefined" value.
noexcept
and is guaranteed never to throw.