|
Macaulay2 Engine
|
Legacy Z_mod — a Ring-derived Z/p with log / exp tables. More...
Go to the source code of this file.
Classes | |
| class | Z_mod |
| Engine-side Z/p ring for small primes (p < 32767), using a discrete-log (Zech) representation. More... | |
Namespaces | |
| namespace | M2 |
Legacy Z_mod — a Ring-derived Z/p with log / exp tables.
Z_mod is the original Z/p class, pre-dating the aring framework. Elements are stored as log indices of a chosen primitive root alpha, but the encoding differs from the aring sibling: here the high index P - 1 (stored as _ZERO) represents the field zero, and 0 <= n <= P - 2 represent alpha^n mod p (so alpha^0 = 1 lives at index 0). Multiplication of non-zero values reduces to (a + b) mod (P - 1) on the indices, and addition is performed via parallel _exp_table / _log_table lookups built at construction. The class supports characteristic < 32767.
Z_mod retains pointers to a CoefficientRingZZp and an M2::ARingZZp for the same prime — exposed via get_CoeffRing() and get_ARing() — so callers on either side of the legacy / aring boundary can ask for the form they need. M2::ARingZZp (aring-zzp.hpp) uses the inverted convention (0 is the field zero), and M2::ARingZZpFlint (aring-zzp-flint.hpp) / M2::ARingZZpFFPACK (aring-zzp-ffpack.hpp) are the FLINT- and FFLAS-backed variants.
Definition in file ZZp.hpp.