# HG changeset patch
# User Jeroen Demeyer <jdemeyer@cage.ugent.be>
# Date 1358431691 -3600
# Node ID 5d5c2b6936150cd26e87d20871c3bd40175dcaf1
# Parent 4e5f1201d2e87cd8afbe7431f148b4ed3389d84b
Small fixes to the FLINT2 patch
diff --git a/module_list.py b/module_list.py
a
|
b
|
|
1433 | 1433 | sources = ['sage/rings/fraction_field_FpT.pyx'], |
1434 | 1434 | language = 'c++', |
1435 | 1435 | libraries = ["csage", "flint", "gmp", "gmpxx", "ntl", "zn_poly"], |
1436 | | extra_compile_args=["-std=c99", "-D_XPG6"], |
1437 | 1436 | include_dirs = [SAGE_INC + 'flint/'], |
1438 | 1437 | depends = flint_depends), |
1439 | 1438 | |
… |
… |
|
1708 | 1707 | sources = ['sage/rings/polynomial/polynomial_zmod_flint.pyx'], |
1709 | 1708 | language = 'c++', |
1710 | 1709 | libraries = ["csage", "flint", "gmp", "gmpxx", "ntl", "zn_poly"], |
1711 | | extra_compile_args=["-std=c99", "-D_XPG6"], |
1712 | 1710 | include_dirs = [SAGE_INC + 'flint/'], |
1713 | 1711 | depends = flint_depends), |
1714 | 1712 | |
… |
… |
|
1728 | 1726 | Extension('sage.rings.polynomial.polynomial_rational_flint', |
1729 | 1727 | sources = ['sage/rings/polynomial/polynomial_rational_flint.pyx'], |
1730 | 1728 | language = 'c++', |
1731 | | extra_compile_args=["-std=c99"] + uname_specific('SunOS', [], ['-D_XPG6']), |
1732 | 1729 | libraries = ["csage", "flint", "ntl", "gmpxx", "gmp"], |
1733 | 1730 | include_dirs = [SAGE_INC + 'flint/', 'sage/libs/flint/'], |
1734 | 1731 | depends = flint_depends), |
diff --git a/sage/rings/polynomial/polynomial_zmod_flint.pxd b/sage/rings/polynomial/polynomial_zmod_flint.pxd
a
|
b
|
|
9 | 9 | |
10 | 10 | cdef class Polynomial_zmod_flint(Polynomial_template): |
11 | 11 | cdef Polynomial_template _new(self) |
12 | | cdef void _set_list(self, x) |
13 | | cdef void _set_fmpz_poly(self, fmpz_poly_t) |
| 12 | cdef int _set_list(self, x) except -1 |
| 13 | cdef int _set_fmpz_poly(self, fmpz_poly_t) except -1 |
14 | 14 | cpdef _mul_trunc(self, Polynomial_zmod_flint other, length) |
15 | 15 | cpdef _mul_trunc_opposite(self, Polynomial_zmod_flint other, length) |
16 | 16 | cpdef rational_reconstruct(self, m, n_deg=?, d_deg=?) |
diff --git a/sage/rings/polynomial/polynomial_zmod_flint.pyx b/sage/rings/polynomial/polynomial_zmod_flint.pyx
a
|
b
|
|
146 | 146 | celement_set_si(&r.x, int(x), get_cparent(P)) |
147 | 147 | return r |
148 | 148 | |
149 | | cdef void _set_list(self, x): |
| 149 | cdef int _set_list(self, x) except -1: |
150 | 150 | """ |
151 | 151 | Set the coefficients of ``self`` from a list of coefficients. |
152 | 152 | |
… |
… |
|
170 | 170 | cdef int i |
171 | 171 | if length == 0: |
172 | 172 | nmod_poly_zero(&self.x) |
173 | | return |
| 173 | return 0 |
174 | 174 | |
175 | 175 | # resize to length of list |
176 | 176 | sig_on() |
… |
… |
|
181 | 181 | for i from 0 <= i < length: |
182 | 182 | nmod_poly_set_coeff_ui(&self.x, i, l_in[i]) |
183 | 183 | sig_off() |
| 184 | return 0 |
184 | 185 | |
185 | | cdef void _set_fmpz_poly(self, fmpz_poly_t x): |
| 186 | cdef int _set_fmpz_poly(self, fmpz_poly_t x) except -1: |
186 | 187 | """ |
187 | 188 | Set the coefficients of ``self`` from the coefficients of an ``fmpz_poly_t`` element. |
188 | 189 | |
… |
… |
|
209 | 210 | sig_on() |
210 | 211 | fmpz_poly_get_nmod_poly(&self.x, x) |
211 | 212 | sig_off() |
| 213 | return 0 |
212 | 214 | |
213 | 215 | def __getitem__(self, i): |
214 | 216 | """ |