Functions | |
| void | fmpq_poly_gcd (fmpq_poly_ptr rop, const fmpq_poly_ptr a, const fmpq_poly_ptr b) |
| void | fmpq_poly_xgcd (fmpq_poly_ptr rop, fmpq_poly_ptr s, fmpq_poly_ptr t, const fmpq_poly_ptr a, const fmpq_poly_ptr b) |
| void | fmpq_poly_lcm (fmpq_poly_ptr rop, const fmpq_poly_ptr a, const fmpq_poly_ptr b) |
| void fmpq_poly_gcd | ( | fmpq_poly_ptr | rop, | |
| const fmpq_poly_ptr | a, | |||
| const fmpq_poly_ptr | b | |||
| ) |
Returns the (monic) greatest common divisor res of a and b.
Corner cases: If a and b are both zero, returns zero. If only one of them is zero, returns the other polynomial, up to normalisation.
| void fmpq_poly_lcm | ( | fmpq_poly_ptr | rop, | |
| const fmpq_poly_ptr | a, | |||
| const fmpq_poly_ptr | b | |||
| ) |
Computes the monic (or zero) least common multiple of a and b.
If either of a and b is zero, returns zero. This behaviour ensures that the relation
holds, where
denotes equality up to units.
| void fmpq_poly_xgcd | ( | fmpq_poly_ptr | rop, | |
| fmpq_poly_ptr | s, | |||
| fmpq_poly_ptr | t, | |||
| const fmpq_poly_ptr | a, | |||
| const fmpq_poly_ptr | b | |||
| ) |
Returns polynomials s, t and rop such that rop is (monic) greatest common divisor of a and b, and such that rop = s a + t b.
Corner cases: If a and b are zero, returns zero polynomials. Otherwise, if only a is zero, returns (res, s, t) = (b, 0, 1) up to normalisation, and similarly if only b is zero.
Assumes that the output parameters rop, s, and t refer to distinct objects in memory. Otherwise, an exception is raised in the form of an abort statement.
1.6.3