-
classmethod galois.Array.repr(element_repr: Literal[int] | Literal[poly] | Literal[power] =
'int'
) Generator[None, None, None] Sets the element representation for all arrays from this
FieldArray
subclass.- Parameters:¶
- element_repr: Literal[int] | Literal[poly] | Literal[power] =
'int'
¶ The field element representation.
"int"
(default): Sets the representation to the integer representation."poly"
: Sets the representation to the polynomial representation."power"
: Sets the representation to the power representation.
Slower performance
To display elements in the power representation,
galois
must compute the discrete logarithm of each element displayed. For large fields or fields using explicit calculation, this process can take a while. However, when using lookup tables this representation is just as fast as the others.
- element_repr: Literal[int] | Literal[poly] | Literal[power] =
- Returns:¶
A context manager for use in a
with
statement. If permanently setting the element representation, disregard the return value.
Notes¶
This function updates
element_repr
.