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=PLUA = PLU of the m×nm \times n matrix A, writes the rank to rank and the row permutation to the array P of length mm, and returns 1. Returns 0 if a pivot can neither be proved zero nor nonzero, in which case the outputs are meaningless.

If AA is square and nonsingular, LU holds a unit lower triangular LL (its diagonal not stored) and an upper triangular UU. If AA has 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 the first rr diagonal entries. If rank_check is nonzero, the computation stops as soon as AA 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-11-02).