FLINT3.7.0-dev

ca_mat_lu_classical, ca_mat_lu_recursive, ca_mat_lu

Synopsis#include <flint/ca_mat.h>
int ca_mat_lu_classical(slong * rank, slong * P, ca_mat_t LU, const ca_mat_t A, int rank_check, ca_ctx_t ctx)source
int ca_mat_lu_recursive(slong * rank, slong * P, ca_mat_t LU, const ca_mat_t A, int rank_check, ca_ctx_t ctx)source
int ca_mat_lu(slong * rank, slong * P, ca_mat_t LU, const ca_mat_t A, int rank_check, ca_ctx_t ctx)source

Computes a generalised LU decomposition A = PLU of the m \times n matrix A, writes the rank to rank and the row permutation to the array P of length m, and returns 1. Returns 0 if a pivot can neither be proved zero nor nonzero, in which case the outputs are meaningless.

If A is square and nonsingular, LU holds a unit lower triangular L (its diagonal not stored) and an upper triangular U. If A has 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 the first r diagonal entries. If rank_check is nonzero, the computation stops as soon as A is found to be rank-deficient, setting the rank to 0 and leaving LU undefined.

These are wrappers of gr_mat_lu_classical (Gaussian elimination), gr_mat_lu_recursive (block recursive elimination, which benefits from fast matrix multiplication) and gr_mat_lu_generic (an automatic choice).

Cite this page

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