![]() |
libsemigroups
v3.0.0
C++ library for semigroups and monoids
|
Defined in pbr.hpp
.
Partitioned binary relations (PBRs) are a generalisation of a bipartitions, and were introduced by Martin and Mazorchuk in [44].
Public Types | |
template<typename T> | |
using | initializer_list_type = std::initializer_list<std::vector<T>> const& |
Type of constructor argument. | |
template<typename T> | |
using | vector_type = std::vector<std::vector<T>> const& |
Type of constructor argument. | |
Public Member Functions | |
PBR ()=delete | |
Deleted. | |
PBR (initializer_list_type< int32_t > left, initializer_list_type< int32_t > right) | |
Construct from adjacencies 1 to n and -1 to -n . | |
PBR (initializer_list_type< uint32_t > x) | |
Construct from adjacencies 0 to 2n - 1 . | |
PBR (PBR &&)=default | |
Default move constructor. | |
PBR (PBR const &)=default | |
Default copy constructor. | |
PBR (size_t n) | |
Construct empty PBR of given degree. | |
PBR (vector_type< int32_t > left, vector_type< int32_t > right) | |
Construct from adjacencies 1 to n and -1 to -n . | |
PBR (vector_type< uint32_t > x) | |
Construct from adjacencies 0 to 2n - 1 . | |
std::vector< uint32_t > & | at (size_t i) |
Returns a reference to the points adjacent to a given point, with bounds checking. | |
std::vector< uint32_t > const & | at (size_t i) const |
Returns a const reference to the points adjacent to a given point, with bounds checking. | |
size_t | degree () const noexcept |
Returns the degree of a PBR. | |
size_t | hash_value () const |
Returns a hash value for a PBR. | |
size_t | number_of_points () const noexcept |
Returns the number of points of a PBR. | |
bool | operator< (PBR const &that) const |
Compare for less. | |
PBR & | operator= (PBR &&)=default |
Default move assignment operator. | |
PBR & | operator= (PBR const &)=default |
Default copy assignment operator. | |
bool | operator== (PBR const &that) const |
Compare two PBRs for equality. | |
std::vector< uint32_t > & | operator[] (size_t i) |
Returns a reference to the points adjacent to a given point. | |
std::vector< uint32_t > const & | operator[] (size_t i) const |
Returns a const reference to the points adjacent to a given point. | |
void | product_inplace (PBR const &x, PBR const &y, size_t thread_id=0) |
Multiply two PBR objects and store the product in this . | |
void | product_inplace_no_checks (PBR const &x, PBR const &y, size_t thread_id=0) |
Multiply two PBR objects and store the product in this . | |
Related Symbols | |
(Note that these are not member symbols.) | |
template<typename Return, typename... T> | |
enable_if_is_same< Return, PBR > | make (T... args) |
Construct and check a PBR. | |
bool | operator!= (PBR const &x, PBR const &y) |
Compare two PBRs for inequality. | |
PBR | operator* (PBR const &x, PBR const &y) |
Multiply two PBRs. | |
bool | operator<= (PBR const &x, PBR const &y) |
Convenience function that just calls operator< and operator==. | |
bool | operator> (PBR const &x, PBR const &y) |
Convenience function that just calls operator<. | |
bool | operator>= (PBR const &x, PBR const &y) |
Convenience function that just calls operator<=. | |
std::string | to_human_readable_repr (PBR const &x) |
Return a human readable representation of a PBR. | |
using initializer_list_type = std::initializer_list<std::vector<T>> const& |
Type of constructor argument.
using vector_type = std::vector<std::vector<T>> const& |
Type of constructor argument.
|
delete |
Deleted. To avoid the situation where the underlying container is not defined, it is not possible to default construct a PBR object.
|
explicit |
Construct from adjacencies 0
to 2n - 1
.
The parameter x
must be a container of vectors of uint32_t
with size
x | the container of vectors of adjacencies. |
x
are performed.
|
explicit |
Construct from adjacencies 0
to 2n - 1
.
The parameter x
must be a container of vectors of uint32_t
with size
x | the container of vectors of adjacencies. |
x
are performed.
|
explicit |
Construct empty PBR of given degree.
n | the degree. |
PBR | ( | initializer_list_type< int32_t > | left, |
initializer_list_type< int32_t > | right ) |
Construct from adjacencies 1
to n
and -1
to -n
.
The parameters left
and right
should be containers of left
is the list of points adjacent to right
is the list of points adjacent to
left | container of adjacencies of 1 to n . |
right | container of adjacencies of n + 1 to 2n . |
left
or right
are performed.PBR | ( | vector_type< int32_t > | left, |
vector_type< int32_t > | right ) |
Construct from adjacencies 1
to n
and -1
to -n
.
The parameters left
and right
should be containers of left
is the list of points adjacent to right
is the list of points adjacent to
left | container of adjacencies of 1 to n . |
right | container of adjacencies of n + 1 to 2n . |
left
or right
are performed.std::vector< uint32_t > & at | ( | size_t | i | ) |
Returns a reference to the points adjacent to a given point, with bounds checking.
i | the point. |
std::vector<uint32_t>
.std::out_of_range | if i > number_of_points(). |
std::vector< uint32_t > const & at | ( | size_t | i | ) | const |
Returns a const reference to the points adjacent to a given point, with bounds checking.
i | the point. |
std::vector<uint32_t>
.std::out_of_range | if i > number_of_points(). |
|
noexcept |
|
inline |
Returns a hash value for a PBR.
this
.degree()
.
|
noexcept |
Returns the number of points of a PBR.
size_t
.noexcept
and is guaranteed never to throw.
|
inline |
Compare for less.
that | a PBR to compare with. |
true
if this
is less than that
, and false
otherwise.
|
inline |
Compare two PBRs for equality.
that | a PBR to compare with. |
true
if this
equals that
, and false
otherwise.
|
inline |
Returns a reference to the points adjacent to a given point.
i | the point. |
std::vector<uint32_t>
.
|
inline |
Returns a const reference to the points adjacent to a given point.
i | the point. |
std::vector<uint32_t>
.Replaces the contents of this
by the product of x
and y
.
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 member function with the same value of thread_id
then bad things will happen.
LibsemigroupsException | if: |
Replaces the contents of this
by the product of x
and y
.
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 member function with the same value of thread_id
then bad things will happen.
x
and y
have different degrees, then bad things will happen.
|
related |
Construct and check a PBR.
Return | the return type. Must satisfy std::is_same<Return, PBR> . |
T | the types of the arguments. |
args | the arguments to forward to the PBR constructor. |
args
and checked.LibsemigroupsException | if libsemigroups::throw_if_invalid(PBR const&) throws when called with the constructed PBR. |
args
prior to the construction of the PBR object.Compare two PBRs for inequality.
true
if this
is not equal to that
, and false
otherwise.x
and y
. Convenience function that just calls operator< and operator==.
Convenience function that just calls operator<.
Convenience function that just calls operator<=.
|
related |
Return a human readable representation of a PBR.
x | the PBR object. |