FLINT3.7.0-dev

padic_radix_mat_nonsingular_solve, padic_radix_mat_inv

Synopsis#include <flint/padic_radix.h>
int padic_radix_mat_nonsingular_solve(gr_mat_t X, const gr_mat_t A, const gr_mat_t B, gr_ctx_t ctx)source
int padic_radix_mat_inv(gr_mat_t X, const gr_mat_t A, gr_ctx_t ctx)source

Set X=A−1BX = A^{-1} B (respectively X=A−1X = A^{-1}), returning GR_DOMAIN if AA is singular and GR_UNABLE if this cannot be decided. The algorithm is Gauss-Jordan elimination with full pivoting by valuation levels on [A∣B][A \mid B]: at each level the pivot block (as in padic_radix_mat_det_levels) is applied to its rows, and its columns are eliminated from all the other rows, including the pivot rows of the previous levels, with one matrix product. This order of operations (that of Gauss-Jordan elimination with full pivoting) gives every entry of the solution with the optimal precision, that of the differential dX=A−1(dB−dA X)dX = A^{-1}(dB - dA\, X); LU decompositions with column pivots and back substitution lose some digits when AA is not invertible modulo pp. When A/paA / p^a is invertible modulo pp for the minimal valuation aa of its entries, all pivots have valuation aa and the generic LU solve (with the pivots of padic_radix_mat_find_nonzero_pivot) is used directly, as it is always with the context flag PADIC_RADIX_FAST_LINALG. These functions implement the generic methods gr_mat_nonsingular_solve and gr_mat_inv.

Cite this page

The FLINT team, “padic_radix_mat_nonsingular_solve, padic_radix_mat_inv (padic_radix.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/padic_radix/padic_radix_mat_nonsingular_solve.html (generated 2026-11-02).