FLINT3.7.0-dev

_gr_vec_gather, _gr_vec_scatter

Synopsis#include <flint/gr_vec.h>
int _gr_vec_gather(gr_ptr res, gr_srcptr vec, const slong * idx, slong len, gr_ctx_t ctx)source
int _gr_vec_scatter(gr_ptr vec, const slong * idx, gr_srcptr src, slong len, gr_ctx_t ctx)source

Indexed copies: res[i] = vec[idx[i]], respectively vec[idx[i]] = src[i], for 0 \le i < \mathit{len} (methods GR_METHOD_VEC_GATHER and GR_METHOD_VEC_SCATTER). The indices need not be distinct; when they repeat in a scatter, the last write wins. The defaults loop over gr_set; rings whose elements own no memory override them with plain copies.

Cite this page

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