FLINT3.7.0-dev

gr_ctx_init_debug

Synopsis#include <flint/gr.h>
void gr_ctx_init_debug(gr_ctx_t ctx, gr_ctx_t elem_ctx, int flags, double unable_probability)source

Initialises ctx to a wrapper around the ring elem_ctx that computes as elem_ctx but adds checks. Only a few methods are wrapped (memory management, printing, gr_zero, gr_one, gr_is_zero, gr_is_one, gr_equal, gr_set, gr_neg, gr_add, gr_sub, gr_mul, gr_div, gr_inv, gr_is_invertible, gr_sqrt, gr_rsqrt, gr_pow); the others use the generic defaults. If unable_probability is positive, the wrapped methods randomly return GR_UNABLE and predicates randomly return T_UNKNOWN with that probability, which tests the error handling of algorithms. flags is a combination of the GR_DEBUG_* flags.

Guides#

Cite this page

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