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 AA and det to its determinant, so that adj⁡(A)A=Aadj⁡(A)=det⁡(A)I\operatorname{adj}(A) A = A \operatorname{adj}(A) = \det(A) I. The cofactor version computes n2n^2 minors; the charpoly version evaluates (−1)n−1(An−1+cn−1An−2+⋯+c1I)(-1)^{n-1}(A^{n-1} + c_{n-1} A^{n-2} + \cdots + c_1 I) from the characteristic polynomial xn+cn−1xn−1+⋯+c0x^n + c_{n-1} x^{n-1} + \cdots + c_0 by rectangular splitting, with O(n)O(\sqrt{n}) matrix products. The default uses cofactors for n≤5n \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-11-02).