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=LUPA = LU of AA in place and returns the rank of AA. P must have room for as many entries as AA has rows; it receives the row permutation. A wrapper of gr_mat_lu.

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

If rank_check is nonzero, the function gives up as soon as AA is found to be rank-deficient, returns 0 and leaves AA 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-11-02).