gr_mat_permute_rows, gr_mat_permute_rows_inv, gr_mat_permute_cols, gr_mat_permute_cols_inv
#include <flint/gr_mat.h>int gr_mat_permute_rows(gr_mat_t mat, slong * perm_store, const slong * perm_act, gr_ctx_t ctx)sourceint gr_mat_permute_rows_inv(gr_mat_t mat, slong * perm_store, const slong * perm_act, gr_ctx_t ctx)sourceint gr_mat_permute_cols(gr_mat_t mat, slong * perm_store, const slong * perm_act, gr_ctx_t ctx)sourceint gr_mat_permute_cols_inv(gr_mat_t mat, slong * perm_store, const slong * perm_act, gr_ctx_t ctx)sourcePermute the rows (columns) by perm_act, or by its inverse for the inv versions, and apply the same permutation to perm_store if it is not NULL. gr_mat_permute_rows moves row perm_act[i] to row i (and perm_store[perm_act[i]] to perm_store[i]); the inv version moves row i to row perm_act[i], without computing the inverse permutation. perm_store and perm_act may be the same array.
Swapping rows with gr_mat_swap_rows and gr_mat_invert_rows while recording the swaps in a permutation that starts as the identity, and then calling gr_mat_permute_rows_inv with that permutation, restores the original matrix (and likewise for columns).
The FLINT team, “gr_mat_permute_rows, gr_mat_permute_rows_inv, gr_mat_permute_cols, gr_mat_permute_cols_inv (gr_mat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/gr_mat/gr_mat_permute_rows.html (generated 2026-10-20).
@misc{flint-doc-gr-mat-gr-mat-permute-rows,
author = {{The FLINT team}},
title = {{gr\_mat\_permute\_rows, gr\_mat\_permute\_rows\_inv, gr\_mat\_permute\_cols, gr\_mat\_permute\_cols\_inv (gr\_mat.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/gr_mat/gr_mat_permute_rows.html},
note = {Generated 2026-10-20}
}