classmethod galois.FieldArray.compile(mode: Literal[auto] | typing.Literal[jit - lookup] | typing.Literal[jit - calculate] | typing.Literal[python - calculate])

Recompile the just-in-time compiled ufuncs for a new calculation mode.

This function updates ufunc_mode.

Parameters:
mode: Literal[auto] | typing.Literal[jit - lookup] | typing.Literal[jit - calculate] | typing.Literal[python - calculate]

The ufunc calculation mode.

  • "auto": Selects "jit-lookup" for fields with order less than \(2^{20}\), "jit-calculate" for larger fields, and "python-calculate" for fields whose elements cannot be represented with numpy.int64.

  • "jit-lookup": JIT compiles arithmetic ufuncs to use Zech log, log, and anti-log lookup tables for efficient computation. In the few cases where explicit calculation is faster than table lookup, explicit calculation is used.

  • "jit-calculate": JIT compiles arithmetic ufuncs to use explicit calculation. The "jit-calculate" mode is designed for large fields that cannot or should not store lookup tables in RAM. Generally, the "jit-calculate" mode is slower than "jit-lookup".

  • "python-calculate": Uses pure-Python ufuncs with explicit calculation. This is reserved for fields whose elements cannot be represented with numpy.int64 and instead use numpy.object_ with Python int (which has arbitrary precision).