FLINT3.7.0-dev

gr_mat_adjugate, gr_mat_adjugate_cofactor, gr_mat_adjugate_charpoly

Synopsis#include <flint/gr_mat.h>
int gr_mat_adjugate(gr_mat_t adj, gr_ptr det, const gr_mat_t mat, gr_ctx_t ctx)source
int gr_mat_adjugate_cofactor(gr_mat_t adj, gr_ptr det, const gr_mat_t mat, gr_ctx_t ctx)source
int gr_mat_adjugate_charpoly(gr_mat_t adj, gr_ptr det, const gr_mat_t mat, gr_ctx_t ctx)source

Set adj to the adjugate of A and det to its determinant, so that \operatorname{adj}(A) A = A \operatorname{adj}(A) = \det(A) I. The cofactor version computes n^2 minors; the charpoly version evaluates (-1)^{n-1}(A^{n-1} + c_{n-1} A^{n-2} + \cdots + c_1 I) from the characteristic polynomial x^n + c_{n-1} x^{n-1} + \cdots + c_0 by rectangular splitting, with O(\sqrt{n}) matrix products. The default uses cofactors for n \le 5 and the characteristic polynomial otherwise. All versions are division-free when the characteristic polynomial is.

Guides#

Cite this page

The FLINT team, “gr_mat_adjugate, gr_mat_adjugate_cofactor, gr_mat_adjugate_charpoly (gr_mat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/gr_mat/gr_mat_adjugate.html (generated 2026-10-20).