1 /*
2 Copyright (C) 2020 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 <https://www.gnu.org/licenses/>.
10 */
11
12 #include "fmpz_mod_mpoly.h"
13
fmpz_mod_mpoly_set(fmpz_mod_mpoly_t A,const fmpz_mod_mpoly_t B,const fmpz_mod_mpoly_ctx_t ctx)14 void fmpz_mod_mpoly_set(
15 fmpz_mod_mpoly_t A,
16 const fmpz_mod_mpoly_t B,
17 const fmpz_mod_mpoly_ctx_t ctx)
18 {
19 slong N = mpoly_words_per_exp(B->bits, ctx->minfo);
20
21 if (A == B)
22 return;
23
24 fmpz_mod_mpoly_fit_length_reset_bits(A, B->length, B->bits, ctx);
25
26 _fmpz_vec_set(A->coeffs, B->coeffs, B->length);
27 mpoly_copy_monomials(A->exps, B->exps, B->length, N);
28 _fmpz_mod_mpoly_set_length(A, B->length, ctx);
29 }
30