1 /*
2     Copyright (C) 2011, 2012 Sebastian Pancratz
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 "qadic.h"
13 
qadic_set_fmpz_poly(qadic_t rop,const fmpz_poly_t op,const qadic_ctx_t ctx)14 void qadic_set_fmpz_poly(qadic_t rop, const fmpz_poly_t op,
15                          const qadic_ctx_t ctx)
16 {
17     const slong len = op->length;
18 
19     if (len == 0)
20     {
21         qadic_zero(rop);
22     }
23     else
24     {
25         padic_poly_fit_length(rop, len);
26         _padic_poly_set_length(rop, len);
27         _fmpz_vec_set(rop->coeffs, op->coeffs, len);
28         rop->val = 0;
29 
30         qadic_reduce(rop, ctx);
31     }
32 }
33 
34