Skip to content

Document generic polynomial context macros (and make them consistent?) #2318

@rburing

Description

@rburing

We currently have:

flint/src/gr.h

Lines 1418 to 1419 in 3473f0c

#define POLYNOMIAL_CTX(ring_ctx) ((polynomial_ctx_t *)((ring_ctx)))
#define POLYNOMIAL_ELEM_CTX(ring_ctx) (POLYNOMIAL_CTX(ring_ctx)->base_ring)

flint/src/gr.h

Lines 1468 to 1470 in 3473f0c

#define SERIES_CTX(ring_ctx) ((series_ctx_t *)((ring_ctx)))
#define SERIES_ELEM_CTX(ring_ctx) (SERIES_CTX(ring_ctx)->base_ring)
#define SERIES_SCTX(ring_ctx) (&(((series_ctx_t *)((ring_ctx)))->sctx))

flint/src/gr.h

Lines 1472 to 1474 in 3473f0c

#define SERIES_MOD_CTX(ring_ctx) ((series_mod_ctx_t *)((ring_ctx)))
#define SERIES_MOD_ELEM_CTX(ring_ctx) (SERIES_MOD_CTX(ring_ctx)->base_ring)
#define SERIES_MOD_N(ring_ctx) (SERIES_MOD_CTX(ring_ctx)->n)

flint/src/gr_mpoly.h

Lines 57 to 60 in 3473f0c

#define GR_MPOLY_MCTX(ctx) (((_gr_mpoly_ctx_struct *) (ctx->data))->mctx)
#define GR_MPOLY_CCTX(ctx) (((_gr_mpoly_ctx_struct *) (ctx->data))->cctx)
#define GR_MPOLY_VARS(ctx) (((_gr_mpoly_ctx_struct *) (ctx->data))->vars)
#define GR_MPOLY_NVARS(ctx) (GR_MPOLY_MCTX(ctx)->nvars)

(And later we will have macros for Ore polynomials.)

These are all useful, but only the gr_mpoly ones are documented.

Also the naming scheme of the gr_mpoly macros is inconsistent with the others.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions