nmod_mat_mul_classical
Synopsis
#include <flint/nmod_mat.h>void nmod_mat_mul_classical(nmod_mat_t C, const nmod_mat_t A, const nmod_mat_t B)sourceSets C = AB by classical multiplication, computing each entry as a dot product with a single reduction. C must not be aliased with A or B.
The dot products use the parameters of _nmod_vec_dot_params for length k (Dot products modulo a word-size integer). The code takes one of three forms.
- If the unreduced sums fit in one word and all dimensions exceed 10, B is transposed and several of its entries are packed into each word, as many as fit with \lceil \log_2 (k (n-1)^2 + 1) \rceil bits each, so that one word product computes several dot products at once.
- If k < 20, or if m < 20 and neither m \ge 4, k \ge 256 nor m \ge 2, k \ge 1000, the dot products read the columns of B in place with
NMOD_VEC_DOT. - Otherwise B is transposed into a temporary matrix (
NMOD_MAT_MUL_TRANSPOSE_CUTOFFis 20) and the dot products use_nmod_vec_doton contiguous rows.
Cite this page
The FLINT team, “nmod_mat_mul_classical (nmod_mat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/nmod_mat/nmod_mat_mul_classical.html (generated 2026-10-20).
@misc{flint-doc-nmod-mat-nmod-mat-mul-classical,
author = {{The FLINT team}},
title = {{nmod\_mat\_mul\_classical (nmod\_mat.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/nmod_mat/nmod_mat_mul_classical.html},
note = {Generated 2026-10-20}
}