FLINT3.7.0-dev

gr_mat_set_str

Synopsis#include <flint/gr_mat.h>
int gr_mat_set_str(gr_mat_t mat, const char * s, int resize, gr_ctx_t ctx)source

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#

Cite this page

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).