Skip to content

Commit

Permalink
Merge pull request #1725 from flintlib/parse
Browse files Browse the repository at this point in the history
Generic expression parsing
  • Loading branch information
fredrik-johansson authored Jan 19, 2024
2 parents 1b566ba + b91945c commit d4f7a49
Show file tree
Hide file tree
Showing 30 changed files with 992 additions and 35 deletions.
13 changes: 13 additions & 0 deletions doc/source/fmpz_mpoly_q.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,24 @@ Special values
Input and output
-------------------------------------------------------------------------------

The variable strings in *x* start with the variable of most significance at index `0`. If *x* is ``NULL``, the variables are named ``x1``, ``x2``, etc.

.. function:: void fmpz_mpoly_q_print_pretty(const fmpz_mpoly_q_t f, const char ** x, const fmpz_mpoly_ctx_t ctx)

Prints *res* to standard output. If *x* is not *NULL*, the strings in
*x* are used as the symbols for the variables.

.. function:: char * fmpz_mpoly_q_get_str_pretty(const fmpz_mpoly_q_t f, const char ** x, const fmpz_mpoly_ctx_t ctx)

Return a string, which the user is responsible for cleaning up, representing *f*, given an array of variable strings *x*.

.. function:: int fmpz_mpoly_q_set_str_pretty(fmpz_mpoly_q_t res, const char * s, const char ** x, fmpz_mpoly_ctx_t ctx)

Set *res* to the fraction in the null-terminated string *str* given an array *x* of variable strings.
If parsing *str* fails, *res* is set to zero, and `-1` is returned. Otherwise, `0` is returned.
The operations ``+``, ``-``, ``*``, and ``/`` are permitted along with integers and the variables in *x*.
The character ``^`` must be immediately followed by the (integer) exponent.
If division by zero occurs, parsing fails.

Random generation
-------------------------------------------------------------------------------
Expand Down
24 changes: 24 additions & 0 deletions doc/source/gr_generic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,30 @@
.. function:: int gr_generic_set_other(gr_ptr res, gr_srcptr x, gr_ctx_t xctx, gr_ctx_t ctx)
int gr_generic_set_fmpq(gr_ptr res, const fmpq_t y, gr_ctx_t ctx)

Generic string parsing
-----------------------------------------------------------------------------------------

.. macro :: GR_PARSE_BALANCE_ADDITIONS
.. macro :: GR_PARSE_RING_EXPONENTS
.. function:: int gr_generic_set_str_expr(gr_ptr res, const char * s, int flags, gr_ctx_t ctx)
int gr_generic_set_str(gr_ptr res, const char * s, gr_ctx_t ctx)
int gr_generic_set_str_balance_additions(gr_ptr res, const char * s, gr_ctx_t ctx)
int gr_generic_set_str_ring_exponents(gr_ptr res, const char * s, gr_ctx_t ctx)

Parses expression string. Generators returned by :func:`gr_gens_recursive` are handled
automatically. We have the following flags:

* ``GR_PARSE_RING_EXPONENTS`` - by default, only (nonnegative) integer literals are allowed
for exponents. If this flag is set, exponents are parsed as arbitrary subexpressions
within the same ring.
* ``GR_PARSE_BALANCE_ADDITIONS`` - attempt to improve performance for huge sums
by reording additions (useful for polynomials)

Generic arithmetic
-----------------------------------------------------------------------------------------

.. function:: int gr_generic_add_fmpz(gr_ptr res, gr_srcptr x, const fmpz_t y, gr_ctx_t ctx)
int gr_generic_add_ui(gr_ptr res, gr_srcptr x, ulong y, gr_ctx_t ctx)
int gr_generic_add_si(gr_ptr res, gr_srcptr x, slong y, gr_ctx_t ctx)
Expand Down
1 change: 1 addition & 0 deletions doc/source/nmod_poly.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2310,6 +2310,7 @@ Special polynomials
:func:`_nmod_poly_conway` will always succeed.

Here, ``type`` can be the following values:

* ``0`` for which there is a bijection between the image of this function
and the database of Conway polynomials,
* ``1`` returns a random prime found in the database and sets ``degree`` to
Expand Down
2 changes: 2 additions & 0 deletions src/fmpz_mpoly_q.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ fmpz_mpoly_q_gen(fmpz_mpoly_q_t res, slong i, const fmpz_mpoly_ctx_t ctx)
/* Input and output */

void fmpz_mpoly_q_print_pretty(const fmpz_mpoly_q_t f, const char ** x, const fmpz_mpoly_ctx_t ctx);
char * fmpz_mpoly_q_get_str_pretty(const fmpz_mpoly_q_t f, const char ** vars, const fmpz_mpoly_ctx_t ctx);
int fmpz_mpoly_q_set_str_pretty(fmpz_mpoly_q_t res, const char * s, const char ** vars, fmpz_mpoly_ctx_t ctx);

/* Random generation */

Expand Down
30 changes: 30 additions & 0 deletions src/fmpz_mpoly_q/print_pretty.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/

#include "fmpz_mpoly_q.h"
#include "gr.h"

void
fmpz_mpoly_q_print_pretty(const fmpz_mpoly_q_t f, const char ** x, const fmpz_mpoly_ctx_t ctx)
Expand All @@ -34,3 +35,32 @@ fmpz_mpoly_q_print_pretty(const fmpz_mpoly_q_t f, const char ** x, const fmpz_mp
flint_printf(")");
}
}

char * fmpz_mpoly_q_get_str_pretty(const fmpz_mpoly_q_t f, const char ** vars, const fmpz_mpoly_ctx_t ctx)
{
gr_ctx_t grctx;
char * s;

gr_ctx_init_fmpz_mpoly_q(grctx, ctx->minfo->nvars, ctx->minfo->ord);
if (vars != NULL)
GR_MUST_SUCCEED(gr_ctx_set_gen_names(grctx, vars));
GR_MUST_SUCCEED(gr_get_str(&s, f, grctx));
gr_ctx_clear(grctx);

return s;
}

int
fmpz_mpoly_q_set_str_pretty(fmpz_mpoly_q_t res, const char * s, const char ** vars, fmpz_mpoly_ctx_t ctx)
{
gr_ctx_t grctx;
int ret;

gr_ctx_init_fmpz_mpoly_q(grctx, ctx->minfo->nvars, ctx->minfo->ord);
if (vars != NULL)
GR_MUST_SUCCEED(gr_ctx_set_gen_names(grctx, vars));
ret = (GR_SUCCESS == gr_set_str(res, s, grctx)) ? 0 : -1;

gr_ctx_clear(grctx);
return ret;
}
2 changes: 2 additions & 0 deletions src/fmpz_mpoly_q/test/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "t-div.c"
#include "t-div_fmpq.c"
#include "t-div_fmpz.c"
#include "t-get_set_str.c"
#include "t-inv.c"
#include "t-mul.c"
#include "t-mul_fmpq.c"
Expand All @@ -39,6 +40,7 @@ test_struct tests[] =
TEST_FUNCTION(fmpz_mpoly_q_div),
TEST_FUNCTION(fmpz_mpoly_q_div_fmpq),
TEST_FUNCTION(fmpz_mpoly_q_div_fmpz),
TEST_FUNCTION(fmpz_mpoly_q_get_set_str),
TEST_FUNCTION(fmpz_mpoly_q_inv),
TEST_FUNCTION(fmpz_mpoly_q_mul),
TEST_FUNCTION(fmpz_mpoly_q_mul_fmpq),
Expand Down
54 changes: 54 additions & 0 deletions src/fmpz_mpoly_q/test/t-get_set_str.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
Copyright (C) 2024 Fredrik Johansson
This file is part of FLINT.
FLINT is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version. See <https://www.gnu.org/licenses/>.
*/

#include "test_helpers.h"
#include "fmpz_mpoly_q.h"

TEST_FUNCTION_START(fmpz_mpoly_q_get_set_str, state)
{
slong iter;

for (iter = 0; iter < 1000 * 0.1 * flint_test_multiplier(); iter++)
{
fmpz_mpoly_ctx_t ctx;
fmpz_mpoly_q_t A, B;
char * s;
char * vars[] = { "x", "y", "z", "t", "u" };
int use_vars, ok;

fmpz_mpoly_ctx_init(ctx, 1 + n_randint(state, 4), ORD_LEX);
fmpz_mpoly_q_init(A, ctx);
fmpz_mpoly_q_init(B, ctx);

fmpz_mpoly_q_randtest(A, state, 10, 2 + n_randint(state, 100), 5, ctx);
fmpz_mpoly_q_randtest(B, state, 10, 2 + n_randint(state, 100), 5, ctx);
use_vars = n_randint(state, 2);

s = fmpz_mpoly_q_get_str_pretty(A, use_vars ? (const char **) vars : NULL, ctx);
ok = !fmpz_mpoly_q_set_str_pretty(B, s, use_vars ? (const char **) vars : NULL, ctx);
ok = ok && fmpz_mpoly_q_equal(A, B, ctx);

if (!ok)
{
flint_printf("FAIL\n");
flint_printf("A = "); fmpz_mpoly_q_print_pretty(A, NULL, ctx); flint_printf("\n\n");
flint_printf("B = "); fmpz_mpoly_q_print_pretty(B, NULL, ctx); flint_printf("\n\n");
flint_abort();
}

flint_free(s);
fmpz_mpoly_q_clear(A, ctx);
fmpz_mpoly_q_clear(B, ctx);
fmpz_mpoly_ctx_clear(ctx);
}

TEST_FUNCTION_END(state);
}
6 changes: 6 additions & 0 deletions src/gr.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ typedef enum
GR_METHOD_WRITE,
GR_METHOD_WRITE_N,

_GR_METHOD_LENGTH,

GR_METHOD_RANDTEST,
GR_METHOD_RANDTEST_NOT_ZERO,
GR_METHOD_RANDTEST_SMALL,
Expand Down Expand Up @@ -851,6 +853,7 @@ typedef int ((*gr_method_poly_binary_op)(gr_ptr, gr_srcptr, slong, gr_srcptr, sl
typedef int ((*gr_method_poly_binary_binary_op)(gr_ptr, gr_ptr, gr_srcptr, slong, gr_srcptr, slong, gr_ctx_ptr));
typedef int ((*gr_method_poly_binary_trunc_op)(gr_ptr, gr_srcptr, slong, gr_srcptr, slong, slong, gr_ctx_ptr));
typedef int ((*gr_method_vec_ctx_op)(gr_vec_t, gr_ctx_ptr));
typedef slong ((*_gr_method_get_si_op)(gr_srcptr, gr_ctx_ptr));

#ifdef FEXPR_H
typedef int ((*gr_method_get_fexpr_op)(fexpr_t, gr_srcptr, gr_ctx_ptr));
Expand Down Expand Up @@ -945,6 +948,7 @@ typedef int ((*gr_method_set_fexpr_op)(gr_ptr, fexpr_vec_t, gr_vec_t, const fexp
#define GR_POLY_BINARY_BINARY_OP(ctx, NAME) (((gr_method_poly_binary_binary_op *) ctx->methods)[GR_METHOD_ ## NAME])
#define GR_POLY_BINARY_TRUNC_OP(ctx, NAME) (((gr_method_poly_binary_trunc_op *) ctx->methods)[GR_METHOD_ ## NAME])
#define GR_VEC_CTX_OP(ctx, NAME) (((gr_method_vec_ctx_op *) ctx->methods)[GR_METHOD_ ## NAME])
#define _GR_GET_SI_OP(ctx, NAME) (((_gr_method_get_si_op *) ctx->methods)[_GR_METHOD_ ## NAME])
#ifdef FEXPR_H
#define GR_GET_FEXPR_OP(ctx, NAME) (((gr_method_get_fexpr_op *) ctx->methods)[GR_METHOD_ ## NAME])
#define GR_SET_FEXPR_OP(ctx, NAME) (((gr_method_set_fexpr_op *) ctx->methods)[GR_METHOD_ ## NAME])
Expand Down Expand Up @@ -993,6 +997,8 @@ GR_INLINE void gr_clear(gr_ptr res, gr_ctx_t ctx) { GR_INIT_CLEAR_OP(ctx, CLEAR)
GR_INLINE void gr_swap(gr_ptr x, gr_ptr y, gr_ctx_t ctx) { GR_SWAP_OP(ctx, SWAP)(x, y, ctx); }
GR_INLINE void gr_set_shallow(gr_ptr res, gr_srcptr x, gr_ctx_t ctx) { GR_VOID_UNARY_OP(ctx, SET_SHALLOW)(res, x, ctx); }

GR_INLINE void _gr_length(gr_srcptr x, gr_ctx_t ctx) { _GR_GET_SI_OP(ctx, LENGTH)(x, ctx); }

GR_INLINE WARN_UNUSED_RESULT int gr_randtest(gr_ptr x, flint_rand_t state, gr_ctx_t ctx) { return GR_RANDTEST(ctx, RANDTEST)(x, state, ctx); }
GR_INLINE WARN_UNUSED_RESULT int gr_randtest_not_zero(gr_ptr x, flint_rand_t state, gr_ctx_t ctx) { return GR_RANDTEST(ctx, RANDTEST_NOT_ZERO)(x, state, ctx); }
GR_INLINE WARN_UNUSED_RESULT int gr_randtest_small(gr_ptr x, flint_rand_t state, gr_ctx_t ctx) { return GR_RANDTEST(ctx, RANDTEST_SMALL)(x, state, ctx); }
Expand Down
1 change: 1 addition & 0 deletions src/gr/acb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2026,6 +2026,7 @@ gr_method_tab_input _acb_methods_input[] =
{GR_METHOD_SET_FMPZ, (gr_funcptr) _gr_acb_set_fmpz},
{GR_METHOD_SET_FMPQ, (gr_funcptr) _gr_acb_set_fmpq},
{GR_METHOD_SET_OTHER, (gr_funcptr) _gr_acb_set_other},
{GR_METHOD_SET_STR, (gr_funcptr) gr_generic_set_str_ring_exponents},
{GR_METHOD_SET_D, (gr_funcptr) _gr_acb_set_d},
{GR_METHOD_GET_SI, (gr_funcptr) _gr_acb_get_si},
{GR_METHOD_GET_UI, (gr_funcptr) _gr_acb_get_ui},
Expand Down
2 changes: 1 addition & 1 deletion src/gr/acf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ gr_method_tab_input _acf_methods_input[] =
{GR_METHOD_SET_FMPZ, (gr_funcptr) _gr_acf_set_fmpz},
{GR_METHOD_SET_FMPQ, (gr_funcptr) _gr_acf_set_fmpq},
{GR_METHOD_SET_D, (gr_funcptr) _gr_acf_set_d},
/* {GR_METHOD_SET_STR, (gr_funcptr) _gr_acf_set_str}, */
{GR_METHOD_SET_STR, (gr_funcptr) gr_generic_set_str_ring_exponents},
{GR_METHOD_SET_OTHER, (gr_funcptr) _gr_acf_set_other},

{GR_METHOD_GET_FMPZ, (gr_funcptr) _gr_acf_get_fmpz},
Expand Down
8 changes: 4 additions & 4 deletions src/gr/arb.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,12 @@ _gr_arb_set_fmpq(arb_t res, const fmpq_t v, const gr_ctx_t ctx)
}

int
_gr_arb_set_str(arb_t res, const char * x, const gr_ctx_t ctx)
_gr_arb_set_str(arb_t res, const char * x, gr_ctx_t ctx)
{
if (arb_set_str(res, x, ARB_CTX_PREC(ctx)))
return GR_DOMAIN;
if (!arb_set_str(res, x, ARB_CTX_PREC(ctx)))
return GR_SUCCESS;

return GR_SUCCESS;
return gr_generic_set_str_ring_exponents(res, x, ctx);
}

int
Expand Down
20 changes: 16 additions & 4 deletions src/gr/arf.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "gr.h"
#include "gr_vec.h"
#include "gr_poly.h"
#include "gr_generic.h"

typedef struct
{
Expand Down Expand Up @@ -152,14 +153,25 @@ _gr_arf_set(arf_t res, const arf_t x, const gr_ctx_t ctx)
}

int
_gr_arf_set_str(arf_t res, const char * x, const gr_ctx_t ctx)
_gr_arf_set_str(arf_t res, const char * x, gr_ctx_t ctx)
{
int status;

arb_t t;
arb_init(t);
arb_set_str(t, x, ARF_CTX_PREC(ctx) + 20);
arf_set_round(res, arb_midref(t), ARF_CTX_PREC(ctx), ARF_CTX_RND(ctx));

if (!arb_set_str(t, x, ARF_CTX_PREC(ctx) + 20))
{
arf_set_round(res, arb_midref(t), ARF_CTX_PREC(ctx), ARF_CTX_RND(ctx));
status = GR_SUCCESS;
}
else
{
status = gr_generic_set_str_ring_exponents(res, x, ctx);
}

arb_clear(t);
return GR_SUCCESS;
return status;
}


Expand Down
1 change: 1 addition & 0 deletions src/gr/ca.c
Original file line number Diff line number Diff line change
Expand Up @@ -1689,6 +1689,7 @@ gr_method_tab_input _ca_methods_input[] =
{GR_METHOD_SET_FMPZ, (gr_funcptr) _gr_ca_set_fmpz},
{GR_METHOD_SET_FMPQ, (gr_funcptr) _gr_ca_set_fmpq},
{GR_METHOD_SET_OTHER, (gr_funcptr) _gr_ca_set_other},
{GR_METHOD_SET_STR, (gr_funcptr) gr_generic_set_str_ring_exponents},

{GR_METHOD_GET_SI, (gr_funcptr) _gr_ca_get_si},
{GR_METHOD_GET_UI, (gr_funcptr) _gr_ca_get_ui},
Expand Down
2 changes: 1 addition & 1 deletion src/gr/fmpq_poly.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ gr_method_tab_input _fmpq_poly_methods_input[] =
{GR_METHOD_SET_UI, (gr_funcptr) _gr_fmpq_poly_set_ui},
{GR_METHOD_SET_FMPZ, (gr_funcptr) _gr_fmpq_poly_set_fmpz},
{GR_METHOD_SET_OTHER, (gr_funcptr) _gr_fmpq_poly_set_other},
/* {GR_METHOD_SET_STR, (gr_funcptr) _gr_fmpq_poly_set_str}, */
{GR_METHOD_SET_STR, (gr_funcptr) gr_generic_set_str_balance_additions},
{GR_METHOD_GET_UI, (gr_funcptr) _gr_fmpq_poly_get_ui},
{GR_METHOD_GET_SI, (gr_funcptr) _gr_fmpq_poly_get_si},
{GR_METHOD_GET_FMPZ, (gr_funcptr) _gr_fmpq_poly_get_fmpz},
Expand Down
8 changes: 4 additions & 4 deletions src/gr/fmpz.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,12 @@ _gr_fmpz_set_other(fmpz_t res, gr_srcptr x, gr_ctx_t x_ctx, gr_ctx_t ctx)
}

int
_gr_fmpz_set_str(fmpz_t res, const char * x, const gr_ctx_t ctx)
_gr_fmpz_set_str(fmpz_t res, const char * x, gr_ctx_t ctx)
{
if (fmpz_set_str(res, x, 10))
return GR_DOMAIN;
if (!fmpz_set_str(res, x, 10))
return GR_SUCCESS;

return GR_SUCCESS;
return gr_generic_set_str(res, x, ctx);
}

int
Expand Down
8 changes: 8 additions & 0 deletions src/gr/fmpz_mpoly.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ _gr_fmpz_mpoly_randtest_small(fmpz_mpoly_t res, flint_rand_t state, gr_ctx_t ctx
return GR_SUCCESS;
}

slong
_gr_fmpz_mpoly_length(const fmpz_mpoly_t x, gr_ctx_t ctx)
{
return x->length;
}

int
_gr_fmpz_mpoly_write(gr_stream_t out, fmpz_mpoly_t poly, gr_ctx_t ctx)
{
Expand Down Expand Up @@ -545,6 +551,7 @@ gr_method_tab_input _gr_fmpz_mpoly_methods_input[] =
{GR_METHOD_SET_SHALLOW, (gr_funcptr) _gr_fmpz_mpoly_set_shallow},
{GR_METHOD_RANDTEST, (gr_funcptr) _gr_fmpz_mpoly_randtest},
{GR_METHOD_RANDTEST_SMALL, (gr_funcptr) _gr_fmpz_mpoly_randtest_small},
{_GR_METHOD_LENGTH, (gr_funcptr) _gr_fmpz_mpoly_length},
{GR_METHOD_WRITE, (gr_funcptr) _gr_fmpz_mpoly_write},
{GR_METHOD_ZERO, (gr_funcptr) _gr_fmpz_mpoly_zero},
{GR_METHOD_ONE, (gr_funcptr) _gr_fmpz_mpoly_one},
Expand All @@ -558,6 +565,7 @@ gr_method_tab_input _gr_fmpz_mpoly_methods_input[] =
{GR_METHOD_SET_FMPZ, (gr_funcptr) _gr_fmpz_mpoly_set_fmpz},
{GR_METHOD_SET_FMPQ, (gr_funcptr) _gr_fmpz_mpoly_set_fmpq},
{GR_METHOD_SET_OTHER, (gr_funcptr) _gr_fmpz_mpoly_set_other},
{GR_METHOD_SET_STR, (gr_funcptr) gr_generic_set_str_balance_additions},
{GR_METHOD_NEG, (gr_funcptr) _gr_fmpz_mpoly_neg},
{GR_METHOD_ADD, (gr_funcptr) _gr_fmpz_mpoly_add},
{GR_METHOD_ADD_SI, (gr_funcptr) _gr_fmpz_mpoly_add_si},
Expand Down
9 changes: 9 additions & 0 deletions src/gr/fmpz_mpoly_q.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "fmpz_mpoly.h"
#include "fmpz_mpoly_q.h"
#include "fmpz_mpoly_factor.h"
#include "gr_generic.h"

typedef struct
{
Expand Down Expand Up @@ -94,6 +95,12 @@ _gr_fmpz_mpoly_q_randtest_small(fmpz_mpoly_q_t res, flint_rand_t state, gr_ctx_t
return GR_SUCCESS;
}

slong
_gr_fmpz_mpoly_q_length(const fmpz_mpoly_q_t x, gr_ctx_t ctx)
{
return fmpz_mpoly_q_numref(x)->length + fmpz_mpoly_q_denref(x)->length;
}

int
_gr_fmpz_mpoly_q_write(gr_stream_t out, fmpz_mpoly_q_t f, gr_ctx_t ctx)
{
Expand Down Expand Up @@ -533,6 +540,7 @@ gr_method_tab_input _gr_fmpz_mpoly_q_methods_input[] =
{GR_METHOD_SET_SHALLOW, (gr_funcptr) _gr_fmpz_mpoly_q_set_shallow},
{GR_METHOD_RANDTEST, (gr_funcptr) _gr_fmpz_mpoly_q_randtest},
{GR_METHOD_RANDTEST_SMALL, (gr_funcptr) _gr_fmpz_mpoly_q_randtest_small},
{_GR_METHOD_LENGTH, (gr_funcptr) _gr_fmpz_mpoly_q_length},
{GR_METHOD_WRITE, (gr_funcptr) _gr_fmpz_mpoly_q_write},
{GR_METHOD_ZERO, (gr_funcptr) _gr_fmpz_mpoly_q_zero},
{GR_METHOD_ONE, (gr_funcptr) _gr_fmpz_mpoly_q_one},
Expand All @@ -545,6 +553,7 @@ gr_method_tab_input _gr_fmpz_mpoly_q_methods_input[] =
{GR_METHOD_SET_SI, (gr_funcptr) _gr_fmpz_mpoly_q_set_si},
{GR_METHOD_SET_FMPZ, (gr_funcptr) _gr_fmpz_mpoly_q_set_fmpz},
{GR_METHOD_SET_FMPQ, (gr_funcptr) _gr_fmpz_mpoly_q_set_fmpq},
{GR_METHOD_SET_STR, (gr_funcptr) gr_generic_set_str_balance_additions},
{GR_METHOD_NEG, (gr_funcptr) _gr_fmpz_mpoly_q_neg},
{GR_METHOD_ADD, (gr_funcptr) _gr_fmpz_mpoly_q_add},
{GR_METHOD_ADD_SI, (gr_funcptr) _gr_fmpz_mpoly_q_add_si},
Expand Down
Loading

0 comments on commit d4f7a49

Please sign in to comment.