FLINT3.7.0-dev

fmpz_mod_mat_lu

Synopsis#include <flint/fmpz_mod_mat.h>
slong fmpz_mod_mat_lu(slong * P, fmpz_mod_mat_t A, int rank_check, const fmpz_mod_ctx_t ctx)source

Computes a generalised LU decomposition PA = LU of A in place and returns the rank of A. P must have room for as many entries as A has rows; it receives the row permutation. A wrapper of gr_mat_lu.

If A is a nonsingular square matrix, it is overwritten with a unit lower triangular matrix L (whose diagonal is not stored) and an upper triangular matrix U. For a matrix of rank r, U is in row echelon form with r nonzero rows, and L is lower triangular, truncated to r columns, with implicit ones on its first r diagonal entries.

If rank_check is nonzero, the function gives up as soon as A is found to be rank-deficient, returns 0 and leaves A in an undefined state.

Guides#

Cite this page

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