FLINT3.7.0-dev
Module · 18 functions

fmpq_mpoly_factor.h

#include <flint/fmpq_mpoly_factor.h>

This module factors polynomials in \mathbb{Q}[x_0, \ldots, x_{n-1}] (see fmpq_mpoly.h). Since an fmpq_mpoly_t is stored as a rational content times an integer polynomial, factoring over \mathbb{Q} amounts to factoring the integer part with fmpz_mpoly_factor and multiplying the rational content into the constant. The factorisation over \mathbb{Q} is unique up to multiplying the bases by nonzero rationals; the two normalising functions below fix this freedom.

Types#

A factored polynomial c \prod_{i < \mathit{num}} p_i^{e_i} with a rational constant: the fields are constant (an fmpq_t), poly (the bases, of type fmpq_mpoly_struct), exp (the exponents, of type fmpz), num and alloc.

Memory management#

Initialises f as the empty product with constant 1.

Change the allocation to exactly alloc factors (freeing the factors beyond it, and everything if \mathit{alloc} \le 0), respectively ensure room for at least len factors.

Frees the memory used by f.

Basic manipulation#

Returns the number of bases of f.

Sets c to the constant of f.

Set p to, respectively swap p with, the base of index i.

Returns the exponent of the base of index i, which must fit an slong.

Sorts the factors by increasing exponent, and factors with equal exponents by fmpq_mpoly_cmp.

Sets A to the product represented by f. Returns 0 if an exponent is negative or a power cannot be computed, and 1 otherwise.

Rescale the bases and adjust the constant so that the product is unchanged: make_monic makes every base monic (leading coefficient 1 in the monomial ordering), and make_integral moves the rational content of every base into the constant, leaving the integer part (primitive, with positive leading coefficient). Return 0 if a base is zero or a power of a content cannot be computed, and 1 otherwise.

Factorisation#

The factoring functions return 1 for success and 0 for failure, in which case f is unspecified; failure happens only in the circumstances described for fmpz_mpoly_factor. They overwrite f. The normalisation of the bases is not part of the specification: currently they are integral, primitive and with positive leading coefficients, as after fmpq_mpoly_factor_make_integral, but code that depends on a normalisation should call one of the normalising functions.

Sets f to a factorisation of A whose bases are squarefree and pairwise coprime, computed with fmpz_mpoly_factor_squarefree on the integer part of A. One multiplicity can occur in several bases; to get one base for each multiplicity, sort with fmpq_mpoly_factor_sort and multiply the bases with equal exponents.

Sets f to the factorisation of A into a rational constant and distinct irreducible polynomials, computed with fmpz_mpoly_factor on the integer part of A. See Factoring multivariate polynomials over the integers for the methods.

Internal functions#

Sets f to c times the factorisation g over the integers, moving the bases out of g (which is left with unspecified bases). g must be over the integer context ctx->zctx.

Cite this page

The FLINT team, “fmpq_mpoly_factor.h (module overview),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fmpq_mpoly_factor/index.html (generated 2026-10-20).