FLINT3.7.0-dev

nmod_mat_solve_tril_classical, nmod_mat_solve_triu_classical

Synopsis#include <flint/nmod_mat.h>
void nmod_mat_solve_tril_classical(nmod_mat_t X, const nmod_mat_t L, const nmod_mat_t B, int unit)source
void nmod_mat_solve_triu_classical(nmod_mat_t X, const nmod_mat_t U, const nmod_mat_t B, int unit)source

Forward, respectively back, substitution, for an r×rr \times r triangular matrix. If BB has at least max⁡(4,r/4)\max(4, r/4) columns (max⁡(4,r/2)\max(4, r/2) for n>231n > 2^{31}, or n>215n > 2^{15} with 32-bit words), the rows of XX are computed one after the other, each as the row of BB minus a linear combination of the rows already computed, with delayed reductions: the products are accumulated by vectors in one, two or three words and each entry is reduced once (or a few times, for some moduli below 2322^{32}). Otherwise each column of XX is computed entry by entry, each entry with one dot product and one reduction, which is faster with few long columns. The inverses of the diagonal entries are computed once.

Cite this page

The FLINT team, “nmod_mat_solve_tril_classical, nmod_mat_solve_triu_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_solve_tril_classical.html (generated 2026-11-02).