@@ -628,6 +628,126 @@ Univariate Functions
628628 Try to set *D * to the discriminant of *Ax *.
629629
630630
631+ Vectors
632+ --------------------------------------------------------------------------------
633+
634+ .. type :: fmpz_mod_mpoly_vec_struct
635+
636+ .. type :: fmpz_mod_mpoly_vec_t
637+
638+ A type holding a vector of :type: `fmpz_mod_mpoly_t `.
639+
640+ .. macro :: fmpz_mod_mpoly_vec_entry(vec, i)
641+
642+ Macro for accessing the entry at position *i * in *vec *.
643+
644+ .. function :: void fmpz_mod_mpoly_vec_init(fmpz_mod_mpoly_vec_t vec, slong len, const fmpz_mod_mpoly_ctx_t ctx)
645+
646+ Initializes *vec * to a vector of length *len *, setting all entries to the zero polynomial.
647+
648+ .. function :: void fmpz_mod_mpoly_vec_clear(fmpz_mod_mpoly_vec_t vec, const fmpz_mod_mpoly_ctx_t ctx)
649+
650+ Clears *vec *, freeing its allocated memory.
651+
652+ .. function :: void fmpz_mod_mpoly_vec_print(const fmpz_mod_mpoly_vec_t vec, const fmpz_mod_mpoly_ctx_t ctx)
653+
654+ Prints *vec * to standard output.
655+
656+ .. function :: void fmpz_mod_mpoly_vec_swap(fmpz_mod_mpoly_vec_t x, fmpz_mod_mpoly_vec_t y, const fmpz_mod_mpoly_ctx_t ctx)
657+
658+ Swaps *x * and *y * efficiently.
659+
660+ .. function :: void fmpz_mod_mpoly_vec_fit_length(fmpz_mod_mpoly_vec_t vec, slong len, const fmpz_mod_mpoly_ctx_t ctx)
661+
662+ Allocates room for *len * entries in *vec *.
663+
664+ .. function :: void fmpz_mod_mpoly_vec_set(fmpz_mod_mpoly_vec_t dest, const fmpz_mod_mpoly_vec_t src, const fmpz_mod_mpoly_ctx_t ctx)
665+
666+ Sets *dest * to a copy of *src *.
667+
668+ .. function :: void fmpz_mod_mpoly_vec_append(fmpz_mod_mpoly_vec_t vec, const fmpz_mod_mpoly_t f, const fmpz_mod_mpoly_ctx_t ctx)
669+
670+ Appends *f * to the end of *vec *.
671+
672+ .. function :: slong fmpz_mod_mpoly_vec_insert_unique(fmpz_mod_mpoly_vec_t vec, const fmpz_mod_mpoly_t f, const fmpz_mod_mpoly_ctx_t ctx)
673+
674+ Inserts *f * without duplication into *vec * and returns its index.
675+ If this polynomial already exists, *vec * is unchanged. If this
676+ polynomial does not exist in *vec *, it is appended.
677+
678+ .. function :: void fmpz_mod_mpoly_vec_set_length(fmpz_mod_mpoly_vec_t vec, slong len, const fmpz_mod_mpoly_ctx_t ctx)
679+
680+ Sets the length of *vec * to *len *, truncating or zero-extending
681+ as needed.
682+
683+ .. function :: void fmpz_mod_mpoly_vec_randtest_not_zero(fmpz_mod_mpoly_vec_t vec, flint_rand_t state, slong len, slong poly_len, ulong exp_bound, fmpz_mod_mpoly_ctx_t ctx)
684+
685+ Sets *vec * to a random vector with exactly *len * entries, all nonzero,
686+ with random parameters defined by *poly_len * and *exp_bound *.
687+
688+
689+ Ideals and Gröbner bases
690+ -------------------------------------------------------------------------------
691+
692+ The following methods deal with ideals in `\mathbb{Z}/n\mathbb{Z}[x_1, \dots, x_m] `.
693+ We use monic polynomials as normalised generators.
694+
695+ .. function :: void fmpz_mod_mpoly_spoly(fmpz_mod_mpoly_t res, const fmpz_mod_mpoly_t f, const fmpz_mod_mpoly_t g, const fmpz_mod_mpoly_ctx_t ctx)
696+
697+ Sets *res * to the *S *-polynomial of *f * and *g *, scaled by making *f * and *g * monic first.
698+
699+ .. function :: void fmpz_mod_mpoly_reduction_monic_part(fmpz_mod_mpoly_t res, const fmpz_mod_mpoly_t f, const fmpz_mod_mpoly_vec_t vec, const fmpz_mod_mpoly_ctx_t ctx)
700+
701+ Sets *res * to the monic remainder of multivariate
702+ division with remainder with respect to the polynomials *vec *.
703+
704+ .. function :: int fmpz_mod_mpoly_vec_is_groebner(const fmpz_mod_mpoly_vec_t G, const fmpz_mod_mpoly_vec_t F, const fmpz_mod_mpoly_ctx_t ctx)
705+
706+ If *F * is *NULL *, checks if *G * is a Gröbner basis. If *F * is not *NULL *,
707+ checks if *G * is a Gröbner basis for *F *.
708+
709+ .. function :: int fmpz_mod_mpoly_vec_is_autoreduced(const fmpz_mod_mpoly_vec_t F, const fmpz_mod_mpoly_ctx_t ctx)
710+
711+ Checks whether the vector *F * is autoreduced (or inter-reduced).
712+
713+ .. function :: void fmpz_mod_mpoly_vec_autoreduction(fmpz_mod_mpoly_vec_t H, const fmpz_mod_mpoly_vec_t F, const fmpz_mod_mpoly_ctx_t ctx)
714+
715+ Sets *H * to the autoreduction (inter-reduction) of *F *.
716+
717+ .. function :: void fmpz_mod_mpoly_vec_autoreduction_groebner(fmpz_mod_mpoly_vec_t H, const fmpz_mod_mpoly_vec_t G, const fmpz_mod_mpoly_ctx_t ctx)
718+
719+ Sets *H * to the autoreduction (inter-reduction) of *G *.
720+ Assumes that *G * is a Gröbner basis.
721+ This produces a reduced Gröbner basis, which is unique
722+ (up to the sort order of the entries in the vector).
723+
724+ .. function :: void fmpz_mod_mpoly_buchberger_naive(fmpz_mod_mpoly_vec_t G, const fmpz_mod_mpoly_vec_t F, const fmpz_mod_mpoly_ctx_t ctx)
725+
726+ Sets *G * to a Gröbner basis for *F *, computed using
727+ a naive implementation of Buchberger's algorithm.
728+
729+ .. function :: int fmpz_mod_mpoly_buchberger_naive_with_limits(fmpz_mod_mpoly_vec_t G, const fmpz_mod_mpoly_vec_t F, slong ideal_len_limit, slong poly_len_limit, const fmpz_mod_mpoly_ctx_t ctx)
730+
731+ As :func: `fmpz_mod_mpoly_buchberger_naive `, but halts if during the
732+ execution of Buchberger's algorithm the length of the
733+ ideal basis set exceeds *ideal_len_limit *, or the length of any
734+ polynomial exceeds *poly_len_limit *.
735+ Returns 1 for success and 0 for failure. On failure, *G * is
736+ a valid basis for *F * but it might not be a Gröbner basis.
737+
738+
739+ Converting to/from other polynomial types
740+ -------------------------------------------------------------------------------
741+
742+ .. function :: void fmpz_mod_mpoly_set_fmpz_mpoly(fmpz_mod_mpoly_t A, const fmpz_mpoly_t B, const fmpz_mod_mpoly_ctx_t ctxm, const fmpz_mpoly_ctx_t ctx)
743+
744+ Sets :type: `fmpz_mod_mpoly_t ` *A * to :type: `fmpz_mpoly_t ` *B * with coefficients modulo the modulus in *ctxm *.
745+
746+ .. function :: void fmpz_mod_mpoly_get_fmpz_mpoly(fmpz_mpoly_t A, const fmpz_mod_mpoly_t B, const fmpz_mpoly_ctx_t ctx)
747+
748+ Sets :type: `fmpz_mpoly_t ` *A * to the :type: `fmpz_mod_mpoly_t ` *B *.
749+
750+
631751Internal Functions
632752--------------------------------------------------------------------------------
633753
0 commit comments