FLINT3.7.0-dev

fmpq_mat_mul, fmpq_mat_mul_cleared, fmpq_mat_mul_direct

Synopsis#include <flint/fmpq_mat.h>
void fmpq_mat_mul(fmpq_mat_t C, const fmpq_mat_t A, const fmpq_mat_t B)source
void fmpq_mat_mul_cleared(fmpq_mat_t C, const fmpq_mat_t A, const fmpq_mat_t B)source
void fmpq_mat_mul_direct(fmpq_mat_t C, const fmpq_mat_t A, const fmpq_mat_t B)source

Sets C = AB. fmpq_mat_mul calls fmpq_mat_mul_cleared, which clears denominators of the rows of A and of the columns of B, multiplies the integer matrices with fmpz_mat_mul and divides entry (i, j) by the product of the i-th row and j-th column denominators. fmpq_mat_mul_direct computes the dot products in rational arithmetic and throws if C is A or B. fmpq_mat_mul and fmpq_mat_mul_cleared allow aliasing.

Cite this page

The FLINT team, “fmpq_mat_mul, fmpq_mat_mul_cleared, fmpq_mat_mul_direct (fmpq_mat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fmpq_mat/fmpq_mat_mul.html (generated 2026-10-20).