FLINT3.7.0-dev

fmpz_mat_similarity

Synopsis#include <flint/fmpz_mat.h>
void fmpz_mat_similarity(fmpz_mat_t A, slong r, fmpz_t d)source

Replaces the square matrix AA by P−1APP^{-1} A P, where PP is the identity matrix with the entries in row rr and every column j∉{r−1,r}j \notin \{r - 1, r\} replaced by dd. Requires 0≤r<n0 \le r < n.

Equivalently, dd times column rr is added to every column j∉{r−1,r}j \notin \{r - 1, r\}, and then dd times the sum of the rows j∉{r−1,r}j \notin \{r - 1, r\} is subtracted from row rr. Such transforms preserve the determinant and the characteristic and minimal polynomials.

Cite this page

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