FLINT3.7.0-dev

arb_mat_mul_classical, arb_mat_mul_threaded, arb_mat_mul_block, arb_mat_mul

Synopsis#include <flint/arb_mat.h>
void arb_mat_mul_classical(arb_mat_t C, const arb_mat_t A, const arb_mat_t B, slong prec)source
void arb_mat_mul_threaded(arb_mat_t C, const arb_mat_t A, const arb_mat_t B, slong prec)source
void arb_mat_mul_block(arb_mat_t C, const arb_mat_t A, const arb_mat_t B, slong prec)source
void arb_mat_mul(arb_mat_t res, const arb_mat_t mat1, const arb_mat_t mat2, slong prec)source

Set C (res) to the matrix product AB. The classical version computes each entry with arb_dot; the threaded version does the same with the rows of the output distributed over the threads of flint_get_num_threads(); the block version multiplies the midpoints exactly as integer matrices and bounds the radii separately. The default chooses automatically.

arb_mat_mul uses the block version if all three dimensions exceed a cutoff (60 for \mathit{prec} \le 128, 50 for \mathit{prec} \le 512, 40 otherwise), and the classical (or, with several threads and more than 10^5 bit operations per thread unit, the threaded) version otherwise.

The block version groups consecutive columns of A and rows of B into blocks in which the entries of each row of A (each column of B) have exponents within about 1.25 \min(\mathit{prec}, b) + 192 bits, where b is the largest midpoint size; converts each block to an integer matrix scaled per row (per column); multiplies the integer matrices with fmpz_mat_mul (multimodular or BLAS-like algorithms, see Multiplying matrices over the integers); and rounds and accumulates the results. Blocks with fewer than 30 columns are multiplied by dot products instead. The radii are bounded by |A_m| B_r + A_r(|B_m| + B_r), computed as products of nonnegative matrices with _arb_mat_addmul_rad_mag_fast. Matrices with entries whose exponents are not small, or whose midpoints have more than 8000 bits, or that are very sparse at high precision, are multiplied classically (Ball matrix multiplication).

Guides#

Cite this page

The FLINT team, “arb_mat_mul_classical, arb_mat_mul_threaded, arb_mat_mul_block, arb_mat_mul (arb_mat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/arb_mat/arb_mat_mul_classical.html (generated 2026-10-20).