gr_ctx_struct, gr_ctx_t
Synopsis
#include <flint/gr.h>gr_ctx_structgr_ctx_tA context object representing a mathematical structure R. A gr_ctx_t is an array of length one of gr_ctx_struct, so that it is passed by reference. The structure has the fields
data:GR_CTX_STRUCT_DATA_BYTES(six words) of storage for the parameters of the ring, for example a modulus, a precision, or a pointer to a base ring or to heap-allocated data;which_ring: a code of typegr_which_structureidentifying the implementation;sizeof_elem: the size of an element in bytes;methods: a pointer to the method table;size_limit: a bound on the size of elements (for example a number of terms), beyond which some rings refuse operations withGR_UNABLE;WORD_MAXfor most rings.
Contexts are not passed as const, so that a ring can keep mutable data such as caches or a table of discovered zero divisors.
Guides#
- Using ca (
ca) - Decimal ball arithmetic (
decimal) - Getting started with decimal arithmetic (
decimal) - Using dfloat (
dfloat) - Getting started with finite fields (
fq_default) - Getting started with generic rings
- Implementing a ring
- Getting started (
gr_dft) - Algorithms, complex mode and threads (
gr_dft) - Linear algebra over general and inexact rings (
gr_mat) - Getting started with multivariate polynomials (
gr_mpoly) - Getting started with gr_poly (
gr_poly) - Working with power series rings (
gr_series) - Using mpn_mod (
mpn_mod) - Getting started with nfloat (
nfloat) - Getting started with padic_radix (
padic_radix)
Cite this page
The FLINT team, “gr_ctx_struct, gr_ctx_t (gr.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/gr/gr_ctx_struct.html (generated 2026-10-20).
@misc{flint-doc-gr-gr-ctx-struct,
author = {{The FLINT team}},
title = {{gr\_ctx\_struct, gr\_ctx\_t (gr.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/gr/gr_ctx_struct.html},
note = {Generated 2026-10-20}
}