1 /*
2 Copyright (C) 2012 Andres Goens
3 Copyright (C) 2013 Mike Hansen
4
5 This file is part of FLINT.
6
7 FLINT is free software: you can redistribute it and/or modify it under
8 the terms of the GNU Lesser General Public License (LGPL) as published
9 by the Free Software Foundation; either version 2.1 of the License, or
10 (at your option) any later version. See <https://www.gnu.org/licenses/>.
11 */
12
13 #ifdef T
14
15 #include "templates.h"
16
17 void
TEMPLATE(T,TEMPLATE (poly_set,T))18 TEMPLATE(T, TEMPLATE(poly_set, T)) (TEMPLATE(T, poly_t) poly,
19 const TEMPLATE(T, t) c,
20 const TEMPLATE(T, ctx_t) ctx)
21 {
22 if (TEMPLATE(T, is_zero) (c, ctx))
23 {
24 TEMPLATE(T, poly_zero) (poly, ctx);
25 }
26 else
27 {
28 TEMPLATE(T, poly_fit_length) (poly, 1, ctx);
29 TEMPLATE(T, set) (poly->coeffs + 0, c, ctx);
30 _TEMPLATE(T, poly_set_length) (poly, 1, ctx);
31 }
32 }
33
34
35 #endif
36