#include "nmod_vec.h"
#include "fq_nmod.h"
#include "mpoly.h"
#include "fq_nmod_mpoly.h"
static void fq_nmod_mpoly_setform(fq_nmod_mpoly_t A, fq_nmod_mpoly_t B,
const fq_nmod_mpoly_ctx_t ctx)
{
slong d = fq_nmod_ctx_degree(ctx->fqctx);
flint_bitcnt_t bits = B->bits;
slong N = mpoly_words_per_exp(bits, ctx->minfo);
fq_nmod_mpoly_fit_length_reset_bits(A, B->length, bits, ctx);
mpoly_copy_monomials(A->exps, B->exps, B->length, N);
_nmod_vec_zero(A->coeffs, d*B->length);
A->length = B->length;
}
void fq_nmod_mpolyu_setform(fq_nmod_mpolyu_t A, fq_nmod_mpolyu_t B,
const fq_nmod_mpoly_ctx_t ctx)
{
slong i;
fq_nmod_mpolyu_fit_length(A, B->length, ctx);
for (i = 0; i < B->length; i++)
{
fq_nmod_mpoly_setform(A->coeffs + i, B->coeffs + i, ctx);
A->exps[i] = B->exps[i];
}
A->length = B->length;
}