FLINT3.7.0-dev

nmod_mat_similarity

Synopsis#include <flint/nmod_mat.h>
void nmod_mat_similarity(nmod_mat_t M, slong r, ulong d)source

Replaces the square matrix M by P^{-1} M P, where P is the identity matrix with the entries in row r and every column j \notin \{r-1, r\} replaced by d. Requires d < n.

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

Cite this page

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