gr_mat_qr, gr_mat_lq, gr_mat_lq_generic, gr_mat_lq_gso, gr_mat_lq_recursive
#include <flint/gr_mat.h>Compute a reduced QR decomposition A = QR of an m \times n matrix of full column rank (m \ge n; Q is m \times n with orthonormal columns and R is n \times n upper triangular), or the transposed LQ decomposition A = LQ of a matrix of full row rank (m \le n; L is m \times m lower triangular and Q is m \times n with orthonormal rows).
The entries should be real (a subfield of \mathbb{R} or real floating-point numbers); for other rings the functions may succeed but the normalisations need not be meaningful. A full QR decomposition with a square Q is obtained by extending Q with an orthonormal basis of the complement and padding R (or L) with zeros. The gso algorithm is Gram-Schmidt orthogonalisation of the rows and the recursive algorithm a block recursion that benefits from fast matrix multiplication. gr_mat_qr is a wrapper of the LQ decomposition, which works on rows because the matrices are stored by rows. gr_mat_lq calls the ring method GR_METHOD_MAT_LQ (overridden by nfloat). Aliasing of A and Q is handled in place; aliasing of A with R or L uses a temporary copy. The functions return GR_DOMAIN for incompatible shapes, rank-deficient input, or when the divisions or square roots of the normalisation are not possible in the ring.
The FLINT team, “gr_mat_qr, gr_mat_lq, gr_mat_lq_generic, gr_mat_lq_gso, gr_mat_lq_recursive (gr_mat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/gr_mat/gr_mat_qr.html (generated 2026-10-20).
@misc{flint-doc-gr-mat-gr-mat-qr,
author = {{The FLINT team}},
title = {{gr\_mat\_qr, gr\_mat\_lq, gr\_mat\_lq\_generic, gr\_mat\_lq\_gso, gr\_mat\_lq\_recursive (gr\_mat.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/gr_mat/gr_mat_qr.html},
note = {Generated 2026-10-20}
}