@@ -780,6 +780,82 @@ TODO: currently only fields of characteristic 0 are supported.
780780
781781 Sets *res * to the squarefreepart of *poly *.
782782
783+ Shift equivalence
784+ -------------------------------------------------------------------------------
785+
786+ .. function :: truth_t gr_poly_shift_equivalent(fmpz_t shift, const gr_poly_t p, const gr_poly_t q, gr_ctx_t ctx)
787+
788+ Returns whether there exists an integer *n * such that `p(x + n) = q(x) `. If
789+ the result is ``T_TRUE `` and *shift * is not ``NULL ``, *shift * is set to
790+ such an *n *.
791+
792+ .. function :: int gr_poly_leading_taylor_shift(gr_ptr shift, const gr_poly_t p, const gr_poly_t q, gr_ctx_t ctx)
793+
794+ Computes (if possible) *s * such that `p(x+s) = q(x)(1+O(x^2)) `.
795+
796+ .. function :: int gr_poly_dispersion_resultant(fmpz_t disp, gr_vec_t disp_set, const gr_poly_t f, const gr_poly_t g, gr_ctx_t ctx);
797+ int gr_poly_dispersion_factor(fmpz_t disp, gr_vec_t disp_set, const gr_poly_t f, const gr_poly_t g, gr_ctx_t ctx);
798+ int gr_poly_dispersion(fmpz_t disp, gr_vec_t disp_set, const gr_poly_t f, const gr_poly_t g, gr_ctx_t ctx);
799+
800+ Computes the dispersion and/or the dispersion set of *f * and *g*.
801+
802+ The dispersion set of two polynomials *f * and *g * (over a unique
803+ factorization domain of characteristic zero) is the set of nonnegative
804+ integers *n* such that `f(x + n) ` and `g(x) ` have a nonconstant common
805+ factor. The dispersion is the largest element of the dispersion set.
806+
807+ The output variables *disp * and/or *disp_set * can be ``NULL ``, in which case
808+ the corresponding result is not stored.
809+ When the dispersion set is empty, *disp * is left unchanged.
810+ The elements of *disp_set * are sorted in increasing order.
811+
812+ The *factor * version uses the algorithm described in [ManWright1994 ]_.
813+ The *resultant * version computes the integer roots of a bivariate resultant
814+ and is mainly intended for testing.
815+
816+ .. function :: int gr_poly_dispersion_from_factors(fmpz_t disp, gr_vec_t disp_set, const gr_vec_t ffac, const gr_vec_t gfac, gr_ctx_t ctx);
817+
818+ Same as :func: `gr_poly_dispersion_factor ` for nonzero *f* and *g* but takes
819+ as input their nonconstant irreducible factors (without multiplicities)
820+ instead of the polynomials themselves.
821+
822+ .. function :: int gr_poly_shiftless_decomposition_factor(gr_ptr c, gr_vec_t slfac, gr_vec_t slshifts, gr_vec_t slmult, const gr_poly_t f, gr_ctx_t ctx)
823+ int gr_poly_shiftless_decomposition(gr_ptr c, gr_vec_t slfac, gr_vec_t slshifts, gr_vec_t slmult, const gr_poly_t f, gr_ctx_t ctx)
824+
825+
826+ Computes a decomposition of *f * of the form
827+
828+ .. math :: c \prod_i \prod_j g_i(x + h_{i,j})^{e_{i,j}}
829+
830+ where
831+
832+ * `c ` is a constant,
833+ * the `g_i ` are squarefree polynomials of degree at least one,
834+ * `g_i(x) ` and `g_j(x + h) ` (with `i \neq j `) are coprime for all
835+ `h \in \mathbb Z `,
836+ * `g_i(x) ` and `g_i(x + h) ` are coprime for all nonzero `h \in \mathbb Z `,
837+ * `e_{i,j} ` and `h_{i,j} ` are integers with `e_{i,j} \geq 1 `
838+ and `0 = h_{i,1} < h_{i,2} < \cdots `.
839+
840+ The output variable *slfac * must be initialized to a vector of polynomials
841+ of the same type as *f *. The other two output vectors *slshift * and
842+ *slmult * must be initialized to vectors *of vectors * with entries of type
843+ *fmpz *.
844+
845+ The *factor * version computes an irreducible factorization and sorts the
846+ factors into shift-equivalence classes.
847+
848+ No algorithm avoiding a full irreducible factorization is currently
849+ implemented.
850+
851+ .. function :: int _gr_poly_shiftless_decomposition_from_factors(gr_vec_t slfac, gr_vec_t slshifts, gr_vec_t slmult, const gr_vec_t fac, const gr_vec_t mult, gr_ctx_t ctx)
852+ int gr_poly_shiftless_decomposition_from_factors(gr_vec_t slfac, gr_vec_t slshifts, gr_vec_t slmult, const gr_vec_t fac, const gr_vec_t mult, gr_ctx_t ctx)
853+
854+ Same as :func: `gr_poly_shiftless_decomposition_factor ` but takes as input
855+ an irreducible factorization (*fac *, *mult *) of *f* (without the
856+ prefactor *c*). The underscore method does not support aliasing of *slfac *
857+ with *fac *.
858+
783859Roots
784860-------------------------------------------------------------------------------
785861
0 commit comments