gr_mat_set_str
#include <flint/gr_mat.h>Sets mat to the matrix described by s, of the form [[e11, ..., e1n], ..., [em1, ..., emn]], where each row is parsed as by gr_vec_set_str and each entry by gr_set_str. Whitespace around brackets and separators, including the line breaks written by gr_mat_write, is ignored.
If resize is 1, mat is resized to the parsed shape; if it is 0, GR_DOMAIN is returned when the parsed shape differs from that of mat. Rows of different lengths also give GR_DOMAIN, and a string that is not a list of rows gives GR_UNABLE. The string [] has zero rows and an unspecified number of columns: with resize it gives a 0 \times 0 matrix, and without it is accepted for any 0 \times c matrix. A matrix with n > 0 rows and no columns is written [[], ..., []].
Guides#
The FLINT team, “gr_mat_set_str (gr_mat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/gr_mat/gr_mat_set_str.html (generated 2026-10-20).
@misc{flint-doc-gr-mat-gr-mat-set-str,
author = {{The FLINT team}},
title = {{gr\_mat\_set\_str (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_set_str.html},
note = {Generated 2026-10-20}
}