FLINT3.7.0-dev

gr_mat_swap_rows, _gr_mat_swap_rows, gr_mat_swap_cols, _gr_mat_swap_cols

Synopsis#include <flint/gr_mat.h>
int gr_mat_swap_rows(gr_mat_t mat, slong * perm, slong r, slong s, gr_ctx_t ctx)source
void _gr_mat_swap_rows(gr_mat_t mat, slong * perm, slong r, slong s, gr_ctx_t ctx)source
int gr_mat_swap_cols(gr_mat_t mat, slong * perm, slong r, slong s, gr_ctx_t ctx)source
void _gr_mat_swap_cols(gr_mat_t mat, slong * perm, slong r, slong s, gr_ctx_t ctx)source

Swap rows (columns) r and s of mat, and the entries r and s of the permutation perm if it is not NULL. The non-underscore versions return GR_DOMAIN for indices out of bounds; the underscore versions do not check them.

Cite this page

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