libsemigroups  v3.0.0
C++ library for semigroups and monoids
Loading...
Searching...
No Matches
DynamicPTransf< Scalar >
template<typename Scalar>
class libsemigroups::DynamicPTransf< Scalar >

Defined in transf.hpp.

This is a class for partial transformations where the number of points acted on (the degree) can be set at run time.

Template Parameters
Scalara unsigned integer type.
See also
PTransfBase for more information.
Inheritance diagram for DynamicPTransf< Scalar >:
[legend]

Public Types

using container_type = std::vector<point_type>
 Type of the underlying container.
 
using point_type = Scalar
 Type of the image values.
 
- Public Types inherited from PTransfBase< Scalar, std::vector< Scalar > >
using const_iterator
 Type of const iterators point to image values.
 
using container_type
 Type of the underlying container.
 
using iterator
 Type of iterators point to image values.
 
using point_type
 Type of the image values.
 

Public Member Functions

 DynamicPTransf (size_t n)
 Construct with given degree.
 
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.
 
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.
 
DynamicPTransfincrease_degree_by (size_t m)
 Increase the degree in-place.
 
- Public Member Functions inherited from PTransfBase< Scalar, std::vector< Scalar > >
 PTransfBase ()=default
 Default constructor.
 
 PTransfBase ()=default
 Default constructor.
 
 PTransfBase (Iterator first, Iterator last)
 Construct from a range of images.
 
 PTransfBase (Iterator first, Iterator last)
 Construct from a range of images.
 
 PTransfBase (PTransfBase &&)=default
 Default move constructor.
 
 PTransfBase (PTransfBase &&)=default
 Default move constructor.
 
 PTransfBase (PTransfBase const &)=default
 Default copy constructor.
 
 PTransfBase (PTransfBase const &)=default
 Default copy constructor.
 
 PTransfBase (std::initializer_list< Scalar > cont)
 Construct from a container of images.
 
 PTransfBase (std::initializer_list< Scalar > cont)
 Construct from a container of images.
 
 PTransfBase (std::vector< Scalar > &&cont)
 Construct from a container of images.
 
 PTransfBase (std::vector< Scalar > &&cont)
 Construct from a container of images.
 
 PTransfBase (std::vector< Scalar > const &cont)
 Construct from a container of images.
 
 PTransfBase (std::vector< Scalar > const &cont)
 Construct from a container of images.
 
point_typeat (size_t i)
 Get a reference to the image of a point.
 
point_typeat (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.
 
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.
 
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.
 
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 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.
 
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.
 
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.
 
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.
 
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.
 
size_t hash_value () const
 Returns a hash value.
 
bool operator!= (PTransfBase const &that) const
 Compare for inequality.
 
bool operator!= (PTransfBase const &that) const
 Compare for inequality.
 
Subclass operator* (Subclass const &that) const
 Multiply by another partial transformation.
 
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.
 
bool operator<= (PTransfBase const &that) const
 Compare for less than or equal.
 
bool operator<= (PTransfBase const &that) const
 Compare for less than or equal.
 
PTransfBaseoperator= (PTransfBase &&)=default
 Default move assignment operator.
 
PTransfBaseoperator= (PTransfBase &&)=default
 Default move assignment operator.
 
PTransfBaseoperator= (PTransfBase const &)=default
 Default copy assignment operator.
 
PTransfBaseoperator= (PTransfBase const &)=default
 Default copy assignment operator.
 
bool operator== (PTransfBase const &that) const
 Compare for equality.
 
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.
 
bool operator>= (PTransfBase const &that) const
 Compare for greater than or equal.
 
bool operator>= (PTransfBase const &that) const
 Compare for greater than or equal.
 
point_typeoperator[] (size_t i)
 Get a reference to the image of a point.
 
point_typeoperator[] (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.
 
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.
 
size_t rank () const
 Returns the number of distinct image values.
 
void swap (PTransfBase &that) noexcept
 Swap with another partial transformation.
 
void swap (PTransfBase &that) noexcept
 Swap with another partial transformation.
 

Additional Inherited Members

- Static Public Member Functions inherited from PTransfBase< Scalar, std::vector< Scalar > >
static Subclass make (OtherContainer &&cont)
 Construct from universal reference container and check.
 
static Subclass make (OtherContainer &&cont)
 Construct from universal reference container and check.
 
static Subclass make (std::initializer_list< OtherScalar > cont)
 Construct from std::initializer_list and check.
 
static Subclass make (std::initializer_list< OtherScalar > cont)
 Construct from std::initializer_list and check.
 
static Subclass one (size_t N)
 Returns the identity transformation on the given number of points.
 
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".
 
static point_type undef () noexcept
 Returns the value used to represent "undefined".
 

Member Typedef Documentation

◆ container_type

template<typename Scalar>
using container_type = std::vector<point_type>

Type of the underlying container.

In this case, this is std::vector<point_type>.

◆ point_type

template<typename Scalar>
using point_type = Scalar

Type of the image values.

Also the template parameter Scalar.

Constructor & Destructor Documentation

◆ DynamicPTransf()

template<typename Scalar>
DynamicPTransf ( size_t n)
inlineexplicit

Constructs a partial transformation of degree n with the image of every point set to UNDEFINED.

Parameters
nthe degree.
Exceptions
This function guarantees not to throw a LibsemigroupsException.
Complexity
Linear in the parameter n.

Member Function Documentation

◆ begin() [1/2]

template<typename Scalar>
const_iterator begin ( ) const
inlinenodiscardnoexcept
Returns
A const iterator to the first image value.
Exceptions
This function is noexcept and is guaranteed never to throw.
Complexity
Constant.

◆ begin() [2/2]

template<typename Scalar>
iterator begin ( )
inlinenodiscardnoexcept
Returns
An iterator to the first image value.
Exceptions
This function is noexcept and is guaranteed never to throw.
Complexity
Constant.

◆ degree()

template<typename Scalar>
size_t degree ( ) const
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.

Returns
A value of type size_t.
Exceptions
This function is noexcept and is guaranteed never to throw.

◆ end() [1/2]

template<typename Scalar>
const_iterator end ( ) const
inlinenodiscardnoexcept
Returns
A const iterator pointing one past the last image value.
Exceptions
This function is noexcept and is guaranteed never to throw.
Complexity
Constant.

◆ end() [2/2]

template<typename Scalar>
iterator end ( )
inlinenodiscardnoexcept
Returns
An iterator pointing one past the last image value.
Exceptions
This function is noexcept and is guaranteed never to throw.
Complexity
Constant.

◆ increase_degree_by()

template<typename Scalar>
DynamicPTransf & increase_degree_by ( size_t m)
inline

Increases the degree of this in-place, leaving existing values unaltered.

Parameters
mthe number of points to add.
Exceptions
This function guarantees not to throw a LibsemigroupsException.
Complexity
At worst linear in the sum of the parameter m and degree().

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