- class property galois.FieldArray.default_ufunc_mode : 'jit-lookup' | 'jit-calculate' | 'python-calculate'
The default ufunc compilation mode for this
FieldArray
subclass. The ufuncs may be recompiled withcompile()
.Examples¶
Fields with order less than \(2^{20}\) are compiled, by default, using lookup tables for speed.
In [1]: galois.GF(65537).default_ufunc_mode Out[1]: 'jit-lookup' In [2]: galois.GF(2**16).default_ufunc_mode Out[2]: 'jit-lookup'
Fields with order greater than \(2^{20}\) are compiled, by default, using explicit calculation for memory savings. The field elements and arithmetic must still fit within
numpy.int64
.In [3]: galois.GF(2147483647).default_ufunc_mode Out[3]: 'jit-calculate' In [4]: galois.GF(2**32).default_ufunc_mode Out[4]: 'jit-calculate'
Fields whose elements and arithmetic cannot fit within
numpy.int64
use pure-Python explicit calculation.In [5]: galois.GF(36893488147419103183).default_ufunc_mode Out[5]: 'python-calculate' In [6]: galois.GF(2**100).default_ufunc_mode Out[6]: 'python-calculate'