1 /*
2     Copyright (C) 2018 Daniel Schultz
3 
4     This file is part of FLINT.
5 
6     FLINT is free software: you can redistribute it and/or modify it under
7     the terms of the GNU Lesser General Public License (LGPL) as published
8     by the Free Software Foundation; either version 2.1 of the License, or
9     (at your option) any later version.  See <http://www.gnu.org/licenses/>.
10 */
11 
12 #include "nmod_mpoly.h"
13 
14 
nmod_mpoly_set_term_ui_ui(nmod_mpoly_t poly,ulong c,const ulong * exp,const nmod_mpoly_ctx_t ctx)15 void nmod_mpoly_set_term_ui_ui(nmod_mpoly_t poly,
16                         ulong c, const ulong * exp, const nmod_mpoly_ctx_t ctx)
17 {
18     slong i, nvars = ctx->minfo->nvars;
19     fmpz * newexp;
20     TMP_INIT;
21 
22     TMP_START;
23     newexp = (fmpz *) TMP_ALLOC(nvars*sizeof(fmpz));
24     for (i = 0; i < nvars; i++)
25         fmpz_init_set_ui(newexp + i, exp[i]);
26 
27     _nmod_mpoly_set_term_ui_fmpz(poly, c, newexp, ctx);
28 
29     for (i = 0; i < nvars; i++)
30         fmpz_clear(newexp + i);
31 
32     TMP_END;
33 }
34