The Transf16 class

Class representing transformations.

SIMD accelerated class Transf16 representing transformations on up to 16 points.

This class belongs to the hpcombi subpackage of libsemigroups_pybind11.

The functionality described on this page is only available if LIBSEMIGROUPS_HPCOMBI_ENABLED is True.

Transf16 inherits from PTransf16.

Contents

Transf16

Class representing transformations.

Transf16.copy(…)

Copy a Transf16.

Transf16.one(…)

Returns the identity partial transformation.

Transf16.validate(…)

Check whether or not a Transf16 is well-defined.

Full API

class hpcombi.Transf16
__init__(*args, **kwargs)

Overloaded function.

__init__(self: Transf16) None

Default constructor.

Constructs a Transf16 object with its entries uninitialized. This means there is no guarantee about the values in the constructed object.

>>> from libsemigroups_pybind11.hpcombi import Transf16
>>> x = Transf16()
__init__(self: Transf16, img: list[int]) None

Construct a Transf16 from a list of images.

This function constructs a Transf16 from the list img of its entries. If the length of img is less than 16, then the constructed Transf16 is padded with fixed points at the end.

Parameters:

img (list[int]) – The list of images.

Raises:
>>> from libsemigroups_pybind11.hpcombi import Transf16
>>> Transf16([1, 3, 1, 10])
Transf16([ 1, 3, 1,10, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15])
__init__(self: Transf16, n: int) None

Construct a transformation from its 64 bits compressed.

This function constructs a Transf16 from its integer representation n.

Parameters:

n (int) – the integer representation.

Raises:

TypeError – if n is not in the range \([0, 2 ^{64})\).

>>> from libsemigroups_pybind11.hpcombi import Transf16
>>> Transf16(2 ** 64 - 1)
Transf16([15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15])
>>> int(Transf16([15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15]))
18446744073709551615
copy(self: Transf16) Transf16

Copy a Transf16.

Returns:

A copy of the argument.

Return type:

Transf16

>>> from libsemigroups_pybind11.hpcombi import Transf16
>>> x = Transf16([1, 2, 3, 4, 4])
>>> x.copy() is not x
True
>>> x.copy() == x
True
static one() Transf16

Returns the identity partial transformation.

This function returns the identity Transf16 which fixes every value in \([0, 16)\).

Returns:

The identity transformation.

Return type:

Transf16

>>> from libsemigroups_pybind11.hpcombi import Transf16
>>> x = Transf16([1, 0, 1])
>>> x * x.one() == Transf16.one() * x == x
True
validate(self: Transf16, bound: int = 16) bool

Check whether or not a Transf16 is well-defined.

This function returns True if self is a well-defined partial transformation (i.e. no image value is larger than 15) on the values 0 up to bound.

Parameters:

bound (int) – the bound (defaults to 16).

Returns:

Whether or not self is valid.

Return type:

bool

Note

It should not be possible to create an invalid Transf16 in libsemigroups_pybind11, and this function is only included for completeness.

>>> from libsemigroups_pybind11.hpcombi import Transf16
>>> Transf16([1, 0, 1]).validate()
True