Macaulay2 Engine
Loading...
Searching...
No Matches
aring-zzp-flint.hpp File Reference

M2::ARingZZpFlintZ/p via FLINT's nmod_t precomputed-reciprocal reduction. More...

#include "interface/random.h"
#include "aring.hpp"
#include "buffer.hpp"
#include "ringelem.hpp"
#include "exceptions.hpp"
#include <M2/gc-include.h>
#include <flint/flint.h>
#include <flint/fmpz.h>

Go to the source code of this file.

Classes

class  M2::ARingZZpFlint
 aring-style adapter for Z/p with p a word-size prime, backed by FLINT's nmod_* routines. More...

Namespaces

namespace  M2

Detailed Description

M2::ARingZZpFlintZ/p via FLINT's nmod_t precomputed-reciprocal reduction.

Note
AI-generated documentation. Verify against the source before relying on it.

ARingZZpFlint stores a Z/p value as a single mp_limb_t reduced representative in [0, p); per the in-source comment, p can be any prime that fits in mp_limb_t (i.e., up to the largest prime less than 2^64 on a 64-bit platform). FLINT's nmod_t bundles the modulus with a precomputed reciprocal ninv so each nmod_add, nmod_mul, nmod_neg, and nmod_div reduces via multiply-and-shift instead of a hardware division. This makes the class the default Z/p choice for primes that fall outside the small table-based path of aring-zzp.hpp.

The FLINT-include dance is the usual one: M2/gc-include.h first so allocations route through bdwgc, diagnostic pragmas wrapping FLINT's own headers. HAVE_FLINT_NMOD_H accommodates the FLINT release that split nmod_* out of flint.h into its own nmod.hconfigure decides which path applies. Engine consumers are dmat-zzp-flint.hpp and its LU companion dmat-lu-zzp-flint.hpp, the corresponding dense linear-algebra paths in mat-linalg.hpp, and the ConcreteVectorArithmetic<ARingZZpFlint> specialisation in VectorArithmetic.hpp that exposes the ring to the gb-f4 / new-F4 pipeline. aring-zzp-ffpack.hpp is the BLAS-dispatch alternative for the small-prime range that FFLAS-FFPACK supports.

See also
aring-zzp.hpp
aring-zzp-ffpack.hpp
VectorArithmetic.hpp
aring.hpp

Definition in file aring-zzp-flint.hpp.