FLINT3.7.0-dev

ca_mat_mul_classical, ca_mat_mul_same_nf, ca_mat_mul

Synopsis#include <flint/ca_mat.h>
void ca_mat_mul_classical(ca_mat_t C, const ca_mat_t A, const ca_mat_t B, ca_ctx_t ctx)source
void ca_mat_mul_same_nf(ca_mat_t C, const ca_mat_t A, const ca_mat_t B, ca_field_t K, ca_ctx_t ctx)source
void ca_mat_mul(ca_mat_t C, const ca_mat_t A, const ca_mat_t B, ca_ctx_t ctx)source

Sets C to the matrix product AB. The dimensions must be compatible; otherwise an exception is raised.

The classical version computes each entry as a dot product (wrapper of gr_mat_mul_classical). The same_nf version requires, without checking, that all entries of A and B are rational numbers or elements of the number field K = \mathbb{Q}(a); it writes the entries as polynomials in a over common denominators, multiplies the integer polynomial matrices with fmpz_poly_mat_mul and reduces modulo the minimal polynomial of a. The default version converts matrices with rational entries (and at least 3 rows of B) to fmpz_mat.h or fmpq_mat.h, uses the same_nf version when all entries lie in one number field and the dimensions are at least about 3, and otherwise the classical algorithm.

Cite this page

The FLINT team, “ca_mat_mul_classical, ca_mat_mul_same_nf, ca_mat_mul (ca_mat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/ca_mat/ca_mat_mul_classical.html (generated 2026-10-20).