The PBR class
Class for representing PBRs.
Partitioned binary relations (PBRs) are a generalisation of a bipartitions, and were introduced by Martin and Mazorchuk in [MM11].
Contents
Class for representing PBRs. |
|
|
Copy a |
|
Returns the degree of a |
Returns the number of points of a |
|
Multiply two PBR objects and store the product in self. |
Full API
- class PBR
- __init__(*args, **kwargs)
Overloaded function.
- __init__(self: PBR, n: int) None
Construct empty PBR of given degree.
- Parameters:
n (int) – the degree
- __init__(self: PBR, left: list[list[int]], right: list[list[int]]) None
Construct from adjacencies
1
ton
and-1
to-n
.Construct from adjacencies
1
ton
and-1
to-n
. The parameters left and right should be containers ofn
lists of integer values, so that the list in positioni
of left is the list of points adjacent toi
in thePBR
, and the list in positioni
of right is the list of points adjacent ton + i
in thePBR
. A negative valuei
corresponds ton - i
.- Parameters:
- Raises:
if the resultant PBR:
would not describe a binary relation on an even number of points; or
would have a point related to a point that is greater than
PBR.degree
;
- __init__(self: PBR, x: list[list[int]]) None
Construct from adjacencies
0
to2n - 1
.Construct from adjacencies
0
to2n - 1
. The parameter x must be a container of lists ofint
with size2n
for some integern
, and the list in positioni
is the list of points adjacent toi
in thePBR
constructed.- Parameters:
x (list[list[int]]) – the container of lists of adjacencies.
- Raises:
if the resultant PBR:
would not describe a binary relation on an even number of points; or
would have a point related to a point that is greater than
PBR.degree
;x contains a list of points related to a point that is not sorted.
- degree(self: PBR) int
Returns the degree of a
PBR
.Returns the degree of a
PBR
, where the degree of aPBR
is half the number of points in thePBR
.- Returns:
The degree of the PBR.
- Return type:
- Complexity:
Constant.
- number_of_points(self: PBR) int
Returns the number of points of a
PBR
.- Returns:
A value of type
int
.- Return type:
- Complexity:
Constant.
- product_inplace(self: PBR, x: PBR, y: PBR, thread_id: int) None
Multiply two PBR objects and store the product in self.
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.
- Parameters:
- Raises:
LibsemigroupsError – if: * the
PBR.degree
of x is not the same as thePBR.degree
of y; * thePBR.degree
of self is not the same as thePBR.degree
of x; or * either x or y is the same object as self.