# HG changeset patch
# User David Roe <roed@math.harvard.edu>
# Date 1207866613 14400
# Node ID d063c34cef0be42ba5ac5ad40a692b1e25ce48c7
# Parent 8de168217630a3ed670be088572d0e8f0e73017b
Changed some ZZ_pX_Modulus_c's to ZZ_pX_Modulus_c*'s, added a doc-test.
diff -r 8de168217630 -r d063c34cef0b sage/rings/padics/padic_ZZ_pX_CA_element.pyx
a
|
b
|
cdef class pAdicZZpXCAElement(pAdicZZpXE |
1594 | 1594 | L = [] |
1595 | 1595 | cdef ntl_ZZ_pX cur = <ntl_ZZ_pX>self._ntl_rep() |
1596 | 1596 | cur.c.restore_c() |
1597 | | cdef ZZ_pX_Modulus_c m = self.prime_pow.get_modulus_capdiv(self.absprec)[0] |
| 1597 | cdef ZZ_pX_Modulus_c* m = self.prime_pow.get_modulus_capdiv(self.absprec) |
1598 | 1598 | cdef ZZ_pX_c x |
1599 | 1599 | ZZ_pX_SetX(x) |
1600 | 1600 | cdef Py_ssize_t i, j |
… |
… |
cdef class pAdicZZpXCAElement(pAdicZZpXE |
1602 | 1602 | for i from 0 <= i < n: |
1603 | 1603 | curlist = cur.list() |
1604 | 1604 | L.extend(curlist + [zero]*(n - len(curlist))) |
1605 | | ZZ_pX_MulMod_pre(cur.x, cur.x, x, m) |
| 1605 | ZZ_pX_MulMod_pre(cur.x, cur.x, x, m[0]) |
1606 | 1606 | return matrix(R, n, n, L) |
1607 | 1607 | |
1608 | 1608 | def matrix(self, base = None): |
diff -r 8de168217630 -r d063c34cef0b sage/rings/padics/padic_ZZ_pX_CR_element.pyx
a
|
b
|
cdef class pAdicZZpXCRElement(pAdicZZpXE |
1002 | 1002 | w^5 + w^6 + 2*w^7 + 4*w^8 + 3*w^10 + w^12 + 4*w^13 + 4*w^14 + 4*w^15 + 4*w^16 + 4*w^17 + 4*w^20 + w^21 + 4*w^24 + O(w^25) |
1003 | 1003 | """ |
1004 | 1004 | cdef ZZ_pX_c tmpP |
1005 | | cdef ZZ_pX_Modulus_c mod |
| 1005 | cdef ZZ_pX_Modulus_c* mod |
1006 | 1006 | if self.prime_pow.e == 1: |
1007 | 1007 | if shift > 0: |
1008 | 1008 | ZZ_pX_left_pshift(self.unit, self.unit, self.prime_pow.pow_ZZ_tmp(shift)[0], self.prime_pow.get_context(self.relprec).x) |
… |
… |
cdef class pAdicZZpXCRElement(pAdicZZpXE |
1011 | 1011 | else: |
1012 | 1012 | if shift > 0: |
1013 | 1013 | self.prime_pow.restore_context_capdiv(self.relprec) |
1014 | | mod = self.prime_pow.get_modulus_capdiv(self.relprec)[0] |
1015 | | ZZ_pX_PowerXMod_long_pre(tmpP, shift, mod) |
1016 | | ZZ_pX_MulMod_pre(self.unit, self.unit, tmpP, mod) |
| 1014 | mod = self.prime_pow.get_modulus_capdiv(self.relprec) |
| 1015 | ZZ_pX_PowerXMod_long_pre(tmpP, shift, mod[0]) |
| 1016 | ZZ_pX_MulMod_pre(self.unit, self.unit, tmpP, mod[0]) |
1017 | 1017 | elif shift < 0: |
1018 | 1018 | self.prime_pow.eis_shift_capdiv(&self.unit, &self.unit, -shift, self.relprec) |
1019 | 1019 | |
… |
… |
cdef class pAdicZZpXCRElement(pAdicZZpXE |
1035 | 1035 | 3 + O(w^6) |
1036 | 1036 | """ |
1037 | 1037 | cdef ZZ_pX_c high_shifter, high_shifter2 |
1038 | | cdef ZZ_pX_Modulus_c modulus, modulus_up |
| 1038 | cdef ZZ_pX_Modulus_c *modulus, modulus_up |
1039 | 1039 | cdef ntl_ZZ_pContext_class c |
1040 | 1040 | cdef PowComputer_ZZ_pX_small_Eis sm |
1041 | 1041 | cdef PowComputer_ZZ_pX_big_Eis big |
… |
… |
cdef class pAdicZZpXCRElement(pAdicZZpXE |
1050 | 1050 | shift = -shift |
1051 | 1051 | c = self.prime_pow.get_context_capdiv(self.relprec) |
1052 | 1052 | c.restore_c() |
1053 | | modulus = self.prime_pow.get_modulus_capdiv(self.relprec)[0] |
| 1053 | modulus = self.prime_pow.get_modulus_capdiv(self.relprec) |
1054 | 1054 | if PY_TYPE_CHECK(self.prime_pow, PowComputer_ZZ_pX_big_Eis): |
1055 | 1055 | high_array = (<PowComputer_ZZ_pX_big_Eis>self.prime_pow).high_shifter |
1056 | 1056 | elif PY_TYPE_CHECK(self.prime_pow, PowComputer_ZZ_pX_small_Eis): |
… |
… |
cdef class pAdicZZpXCRElement(pAdicZZpXE |
1058 | 1058 | else: |
1059 | 1059 | raise RuntimeError, "unrecognized PowComputer type" |
1060 | 1060 | ZZ_pX_conv_modulus(high_shifter, high_array[0], c.x) |
1061 | | ZZ_pX_InvMod_newton_ram(high_shifter, high_shifter, modulus, c.x) |
1062 | | ZZ_pX_PowerMod_long_pre(high_shifter, high_shifter, shift, modulus) |
1063 | | ZZ_pX_MulMod_pre(self.unit, self.unit, high_shifter, modulus) |
| 1061 | ZZ_pX_InvMod_newton_ram(high_shifter, high_shifter, modulus[0], c.x) |
| 1062 | ZZ_pX_PowerMod_long_pre(high_shifter, high_shifter, shift, modulus[0]) |
| 1063 | ZZ_pX_MulMod_pre(self.unit, self.unit, high_shifter, modulus[0]) |
1064 | 1064 | |
1065 | 1065 | #modulus_up = self.prime_pow.get_modulus_capdiv(self.relprec + self.prime_pow.e)[0] |
1066 | 1066 | #c = self.prime_pow.get_context_capdiv(self.relprec + self.prime_pow.e) |
… |
… |
cdef class pAdicZZpXCRElement(pAdicZZpXE |
1086 | 1086 | i = 0 |
1087 | 1087 | c = self.prime_pow.get_context_capdiv(self.relprec) |
1088 | 1088 | c.restore_c() |
1089 | | modulus = self.prime_pow.get_modulus_capdiv(self.relprec)[0] |
| 1089 | modulus = self.prime_pow.get_modulus_capdiv(self.relprec) |
1090 | 1090 | if PY_TYPE_CHECK(self.prime_pow, PowComputer_ZZ_pX_big_Eis): |
1091 | 1091 | high_array = (<PowComputer_ZZ_pX_big_Eis>self.prime_pow).high_shifter |
1092 | 1092 | high_length = (<PowComputer_ZZ_pX_big_Eis>self.prime_pow).high_length |
… |
… |
cdef class pAdicZZpXCRElement(pAdicZZpXE |
1100 | 1100 | ZZ_pX_conv_modulus(high_shifter, high_array[high_length-1], c.x) |
1101 | 1101 | # if shift = r + s * 2^(high_length - 1) |
1102 | 1102 | # then high_shifter = p^(s*2^(high_length - 1))/x^(e*s*2^(high_length - 1)) |
1103 | | ZZ_pX_PowerMod_long_pre(high_shifter, high_shifter, (shift / (1L << (high_length - 1))), modulus) |
1104 | | ZZ_pX_MulMod_pre(self.unit, self.unit, high_shifter, modulus) |
| 1103 | ZZ_pX_PowerMod_long_pre(high_shifter, high_shifter, (shift / (1L << (high_length - 1))), modulus[0]) |
| 1104 | ZZ_pX_MulMod_pre(self.unit, self.unit, high_shifter, modulus[0]) |
1105 | 1105 | # Now we only need to multiply self.unit by p^r/x^(e*r) where r < 2^(high_length - 1), which is tractible. |
1106 | 1106 | shift = shift % (1L << (high_length - 1)) |
1107 | 1107 | while shift > 0: |
1108 | 1108 | if shift & 1: |
1109 | 1109 | ZZ_pX_conv_modulus(high_shifter, high_array[i], c.x) |
1110 | | ZZ_pX_MulMod_pre(self.unit, self.unit, high_shifter, modulus) |
| 1110 | ZZ_pX_MulMod_pre(self.unit, self.unit, high_shifter, modulus[0]) |
1111 | 1111 | shift = shift >> 1 |
1112 | 1112 | i += 1 |
1113 | 1113 | |
… |
… |
cdef class pAdicZZpXCRElement(pAdicZZpXE |
2725 | 2725 | L = [] |
2726 | 2726 | cdef ntl_ZZ_pX cur = <ntl_ZZ_pX>self._ntl_rep_abs()[0] |
2727 | 2727 | cur.c.restore_c() |
2728 | | cdef ZZ_pX_Modulus_c m = self.prime_pow.get_modulus_capdiv(self.ordp + self.relprec)[0] |
| 2728 | cdef ZZ_pX_Modulus_c* m = self.prime_pow.get_modulus_capdiv(self.ordp + self.relprec) |
2729 | 2729 | cdef ZZ_pX_c x |
2730 | 2730 | ZZ_pX_SetX(x) |
2731 | 2731 | cdef Py_ssize_t i, j |
… |
… |
cdef class pAdicZZpXCRElement(pAdicZZpXE |
2733 | 2733 | for i from 0 <= i < n: |
2734 | 2734 | curlist = cur.list() |
2735 | 2735 | L.extend(curlist + [zero]*(n - len(curlist))) |
2736 | | ZZ_pX_MulMod_pre(cur.x, cur.x, x, m) |
| 2736 | ZZ_pX_MulMod_pre(cur.x, cur.x, x, m[0]) |
2737 | 2737 | return matrix(R, n, n, L) |
2738 | 2738 | |
2739 | 2739 | def matrix(self, base = None): |
diff -r 8de168217630 -r d063c34cef0b sage/rings/padics/padic_ZZ_pX_FM_element.pyx
a
|
b
|
cdef class pAdicZZpXFMElement(pAdicZZpXE |
1166 | 1166 | L = [] |
1167 | 1167 | cdef ntl_ZZ_pX cur = <ntl_ZZ_pX>self._ntl_rep() |
1168 | 1168 | cur.c.restore_c() |
1169 | | cdef ZZ_pX_Modulus_c m = self.prime_pow.get_top_modulus()[0] |
| 1169 | cdef ZZ_pX_Modulus_c* m = self.prime_pow.get_top_modulus() |
1170 | 1170 | cdef ZZ_pX_c x |
1171 | 1171 | ZZ_pX_SetX(x) |
1172 | 1172 | cdef Py_ssize_t i, j |
… |
… |
cdef class pAdicZZpXFMElement(pAdicZZpXE |
1174 | 1174 | for i from 0 <= i < n: |
1175 | 1175 | curlist = cur.list() |
1176 | 1176 | L.extend(curlist + [zero]*(n - len(curlist))) |
1177 | | ZZ_pX_MulMod_pre(cur.x, cur.x, x, m) |
| 1177 | ZZ_pX_MulMod_pre(cur.x, cur.x, x, m[0]) |
1178 | 1178 | return matrix(R, n, n, L) |
1179 | 1179 | |
1180 | 1180 | def matrix(self, base = None): |
diff -r 8de168217630 -r d063c34cef0b sage/rings/padics/pow_computer_ext.pyx
a
|
b
|
cdef int ZZ_pX_Eis_init(PowComputer_ZZ_p |
245 | 245 | high_shifter_p[i] = into_multiplier |
246 | 246 | |
247 | 247 | cdef int ZZ_pX_eis_shift(PowComputer_ZZ_pX self, ZZ_pX_c* x, ZZ_pX_c* a, long n, long finalprec) except -1: |
| 248 | """ |
| 249 | Eis-shifts a over by n and puts the result into x. |
| 250 | |
| 251 | TESTS: |
| 252 | sage: R.<x> = QQ[] |
| 253 | sage: K = Qp(11,10) |
| 254 | sage: J.<a> = K.extension(x^30-11) |
| 255 | sage: M.<t> = PowerSeriesRing(J) |
| 256 | sage: S.<x,y> = QQ[] |
| 257 | sage: xr = O(a^152)*t + (8*a^2 + 10*a^32 + 7*a^62 + 10*a^92 + 7*a^122 + O(a^152))*t^2 + O(a^154)*t^3 + (2*a^4 + 10*a^64 + 2*a^124 + O(a^154))*t^4 + O(a^156)*t^5 + (5*a^6 + 2*a^96 + a^126 + O(a^156))*t^6 + O(a^158)*t^7 + (7*a^8 + 6*a^38 + 8*a^68 + 2*a^98 + 5*a^128 + O(a^158))*t^8 + O(a^160)*t^9 + (8*a^10 + 10*a^40 + a^70 + 5*a^130 + O(a^160))*t^10 + O(a^162)*t^11 + (9*a^12 + 7*a^42 + 8*a^72 + 6*a^102 + 9*a^132 + O(a^162))*t^12 + O(a^164)*t^13 + (2*a^14 + 5*a^44 + 3*a^74 + a^104 + 4*a^134 + O(a^164))*t^14 + O(a^166)*t^15 + (2*a^16 + 5*a^46 + 8*a^76 + 5*a^106 + 7*a^136 + O(a^166))*t^16 + O(a^168)*t^17 + (7*a^18 + 3*a^48 + 6*a^78 + 9*a^138 + O(a^168))*t^18 + O(a^172)*t^19 + (7*a^50 + 3*a^80 + 5*a^110 + 5*a^140 + 7*a^170 + O(a^172))*t^20 + O(a^172)*t^21 + (a^22 + a^52 + 3*a^82 + 3*a^112 + 2*a^142 + O(a^172))*t^22 + O(a^174)*t^23 + (4*a^24 + 7*a^54 + 9*a^84 + 4*a^114 + 7*a^144 + O(a^174))*t^24 + O(a^176)*t^25 + (3*a^26 + 8*a^56 + 8*a^116 + 5*a^146 + O(a^176))*t^26 + O(a^178)*t^27 + (2*a^28 + 2*a^58 + 6*a^88 + a^118 + 10*a^148 + O(a^178))*t^28 + O(a^180)*t^29 + (8*a^30 + 5*a^60 + 8*a^90 + 5*a^120 + 6*a^150 + O(a^180))*t^30 + O(a^184)*t^31 + (7*a^62 + 9*a^92 + 2*a^182 + O(a^184))*t^32 |
| 258 | sage: yr = xr^2 |
| 259 | sage: dtr = xr.derivative() |
| 260 | sage: f_dtr = yr*dtr; f_dtr |
| 261 | O(a^606)*t + O(a^456)*t^2 + O(a^156)*t^3 + O(a^156)*t^4 + (a^6 + 6*a^36 + 2*a^66 + 7*a^96 + 4*a^126 + O(a^156))*t^5 + O(a^156)*t^6 + (a^8 + 2*a^38 + 8*a^68 + 3*a^98 + O(a^156))*t^7 + O(a^156)*t^8 + (8*a^40 + 10*a^100 + 5*a^130 + O(a^156))*t^9 + O(a^156)*t^10 + (2*a^12 + 5*a^42 + 3*a^72 + 7*a^102 + O(a^156))*t^11 + O(a^156)*t^12 + (8*a^14 + a^44 + 6*a^74 + 4*a^104 + 7*a^134 + O(a^156))*t^13 + O(a^156)*t^14 + (2*a^16 + 8*a^46 + 5*a^106 + 4*a^136 + O(a^156))*t^15 + O(a^156)*t^16 + (a^18 + 6*a^48 + 5*a^78 + 2*a^108 + 9*a^138 + O(a^156))*t^17 + O(a^156)*t^18 + (8*a^50 + 2*a^110 + O(a^156))*t^19 + O(a^156)*t^20 + (4*a^52 + 2*a^82 + 7*a^112 + 5*a^142 + O(a^156))*t^21 + O(a^156)*t^22 + (2*a^54 + 3*a^84 + 8*a^114 + 6*a^144 + O(a^156))*t^23 + O(a^156)*t^24 + (a^26 + 6*a^56 + 4*a^86 + 9*a^116 + 3*a^146 + O(a^156))*t^25 + O(a^156)*t^26 + (10*a^28 + 5*a^58 + 4*a^88 + 10*a^118 + 6*a^148 + O(a^156))*t^27 + O(a^156)*t^28 + (5*a^30 + 5*a^60 + 4*a^90 + 9*a^120 + 3*a^150 + O(a^156))*t^29 + O(a^156)*t^30 + (4*a^32 + 10*a^62 + 5*a^92 + 7*a^122 + 3*a^152 + O(a^156))*t^31 + O(a^156)*t^32 + (5*a^34 + 9*a^94 + 3*a^124 + 6*a^154 + O(a^156))*t^33 + O(a^156)*t^34 + (4*a^36 + 3*a^66 + 10*a^96 + 2*a^126 + O(a^156))*t^35 + O(a^158)*t^36 + (6*a^38 + 9*a^68 + 7*a^128 + O(a^158))*t^37 + O(a^160)*t^38 + (7*a^40 + 3*a^70 + 4*a^100 + 4*a^130 + O(a^160))*t^39 + O(a^162)*t^40 + (a^42 + 10*a^72 + 10*a^102 + a^132 + O(a^162))*t^41 + O(a^164)*t^42 + (8*a^74 + 8*a^104 + 9*a^134 + O(a^164))*t^43 + O(a^166)*t^44 + (10*a^136 + O(a^166))*t^45 + O(a^168)*t^46 + (7*a^48 + 10*a^78 + 5*a^108 + 8*a^138 + O(a^168))*t^47 + O(a^170)*t^48 + (6*a^50 + 5*a^80 + a^110 + O(a^170))*t^49 + O(a^172)*t^50 + (a^52 + 8*a^82 + 2*a^112 + O(a^172))*t^51 + O(a^176)*t^52 + (9*a^54 + 2*a^84 + 6*a^114 + 4*a^144 + O(a^176))*t^53 + O(a^178)*t^54 + (2*a^56 + 5*a^86 + 2*a^116 + 4*a^146 + a^176 + O(a^178))*t^55 + O(a^178)*t^56 + (3*a^58 + 3*a^88 + a^118 + 5*a^148 + O(a^178))*t^57 + O(a^180)*t^58 + (5*a^60 + 10*a^90 + 9*a^120 + a^150 + O(a^180))*t^59 + O(a^182)*t^60 + (4*a^62 + 9*a^92 + 7*a^122 + 7*a^152 + O(a^182))*t^61 + O(a^184)*t^62 + (10*a^64 + 8*a^94 + 6*a^124 + 8*a^154 + O(a^184))*t^63 + O(a^188)*t^64 + (4*a^126 + 10*a^156 + 9*a^186 + O(a^188))*t^65 + O(a^192)*t^66 + (7*a^98 + 4*a^128 + 6*a^158 + 6*a^188 + O(a^192))*t^67 + O(a^196)*t^68 + (3*a^70 + 6*a^100 + 8*a^130 + 9*a^160 + 10*a^190 + O(a^196))*t^69 + O(a^200)*t^70 + (9*a^72 + 5*a^102 + 9*a^132 + 3*a^162 + 10*a^192 + O(a^200))*t^71 + O(a^204)*t^72 + (3*a^74 + 8*a^104 + 7*a^134 + 2*a^164 + O(a^204))*t^73 + O(a^208)*t^74 + (10*a^76 + a^106 + 2*a^136 + 4*a^166 + 9*a^196 + O(a^208))*t^75 + O(a^212)*t^76 + (3*a^78 + 6*a^108 + 9*a^138 + 4*a^168 + 5*a^198 + O(a^212))*t^77 + O(a^216)*t^78 + (4*a^80 + 10*a^110 + 7*a^170 + 8*a^200 + O(a^216))*t^79 + O(a^222)*t^80 + (5*a^82 + 4*a^112 + 9*a^142 + 8*a^172 + 8*a^202 + O(a^222))*t^81 + O(a^224)*t^82 + (4*a^84 + 9*a^114 + 8*a^144 + 2*a^174 + 6*a^204 + O(a^224))*t^83 + O(a^228)*t^84 + (3*a^86 + 5*a^116 + 4*a^146 + 8*a^206 + O(a^228))*t^85 + O(a^232)*t^86 + (a^118 + 7*a^148 + 6*a^208 + O(a^232))*t^87 + O(a^236)*t^88 + (4*a^90 + 9*a^120 + 9*a^150 + 6*a^180 + 6*a^210 + O(a^236))*t^89 + O(a^240)*t^90 + (10*a^122 + 3*a^152 + 8*a^182 + 4*a^212 + O(a^240))*t^91 + O(a^272)*t^92 + (9*a^154 + 10*a^184 + 10*a^214 + 7*a^244 + O(a^272))*t^93 + O(a^308)*t^94 + (9*a^186 + 4*a^216 + 5*a^246 + a^276 + 10*a^306 + O(a^308))*t^95 |
| 262 | """ |
248 | 263 | ##print "starting..." |
249 | 264 | cdef ZZ_pX_c low_part |
250 | 265 | cdef ZZ_pX_c shifted_high_part |
… |
… |
cdef int ZZ_pX_eis_shift(PowComputer_ZZ_ |
254 | 269 | cdef ZZ_pX_c highshift |
255 | 270 | cdef ZZ_pX_c working, working2 |
256 | 271 | cdef ntl_ZZ_pContext_class c |
257 | | cdef ZZ_pX_Modulus_c m |
| 272 | cdef ZZ_pX_Modulus_c* m |
258 | 273 | cdef long pshift = n / self.e |
259 | 274 | cdef long eis_part = n % self.e |
260 | 275 | cdef long two_shift = 1 |
… |
… |
cdef int ZZ_pX_eis_shift(PowComputer_ZZ_ |
287 | 302 | if n < 0: |
288 | 303 | if fm: |
289 | 304 | c = self.get_top_context() |
290 | | m = self.get_top_modulus()[0] |
| 305 | m = self.get_top_modulus() |
291 | 306 | else: |
292 | 307 | c = self.get_context(finalprec) |
293 | | m = self.get_modulus(finalprec)[0] |
| 308 | m = self.get_modulus(finalprec) |
294 | 309 | c.restore_c() |
295 | 310 | ##printer = ntl_ZZ_pX([],c) |
296 | | ZZ_pX_PowerXMod_long_pre(powerx, -n, m) |
| 311 | ZZ_pX_PowerXMod_long_pre(powerx, -n, m[0]) |
297 | 312 | ##printer.x = powerx |
298 | 313 | ##print printer |
299 | 314 | ZZ_pX_conv_modulus(x[0], a[0], c.x) |
300 | | ZZ_pX_MulMod_pre(x[0], powerx, a[0], m) |
| 315 | ZZ_pX_MulMod_pre(x[0], powerx, a[0], m[0]) |
301 | 316 | ##printer.x = x[0] |
302 | 317 | ##print printer |
303 | 318 | return 0 |
… |
… |
cdef int ZZ_pX_eis_shift(PowComputer_ZZ_ |
356 | 371 | # pshift = pshift >> 1 |
357 | 372 | if fm: |
358 | 373 | c = self.get_top_context() |
359 | | m = self.get_top_modulus()[0] |
| 374 | m = self.get_top_modulus() |
360 | 375 | else: |
361 | 376 | c = self.get_context(finalprec + pshift + 1) |
362 | 377 | c.restore_c() |
… |
… |
cdef int ZZ_pX_eis_shift(PowComputer_ZZ_ |
366 | 381 | pshift -= 1 |
367 | 382 | if fm: |
368 | 383 | ZZ_pX_right_pshift(working, working, self.pow_ZZ_tmp(1)[0],c.x) |
369 | | ZZ_pX_MulMod_premul(working, working, high_shifter_fm[0], m) |
| 384 | ZZ_pX_MulMod_premul(working, working, high_shifter_fm[0], m[0]) |
370 | 385 | else: |
371 | 386 | c = self.get_context(finalprec + pshift + 1) |
372 | | m = self.get_modulus(finalprec + pshift + 1)[0] |
| 387 | m = self.get_modulus(finalprec + pshift + 1) |
373 | 388 | ZZ_pX_right_pshift(working, working, self.pow_ZZ_tmp(1)[0],c.x) |
374 | 389 | ZZ_pX_conv_modulus(highshift, high_shifter[0], c.x) |
375 | | ZZ_pX_MulMod_pre(working, working, highshift, m) |
| 390 | ZZ_pX_MulMod_pre(working, working, highshift, m[0]) |
376 | 391 | elif not fm: |
377 | | m = self.get_modulus(finalprec + 1)[0] |
| 392 | m = self.get_modulus(finalprec + 1) |
378 | 393 | ZZ_pX_conv_modulus(working2, working, c.x) |
379 | 394 | i = 0 |
380 | 395 | two_shift = 1 |
… |
… |
cdef int ZZ_pX_eis_shift(PowComputer_ZZ_ |
396 | 411 | ##printer.x = low_part |
397 | 412 | ##print "low_part = %s"%(printer) |
398 | 413 | if fm: |
399 | | ZZ_pX_MulMod_premul(low_part, low_part, low_shifter_fm[i], m) |
| 414 | ZZ_pX_MulMod_premul(low_part, low_part, low_shifter_fm[i], m[0]) |
400 | 415 | else: |
401 | 416 | ZZ_pX_conv_modulus(lowshift, low_shifter[i], c.x) |
402 | | ZZ_pX_MulMod_pre(low_part, low_part, lowshift, m) |
| 417 | ZZ_pX_MulMod_pre(low_part, low_part, lowshift, m[0]) |
403 | 418 | ##printer.x = low_part |
404 | 419 | ##print "low_part = %s"%(printer) |
405 | 420 | ZZ_pX_add(working2, low_part, shifted_high_part) |
… |
… |
cdef class PowComputer_ZZ_pX_FM_Eis(PowC |
1278 | 1293 | sage_free(self.high_shifter) |
1279 | 1294 | |
1280 | 1295 | cdef int eis_shift(self, ZZ_pX_c* x, ZZ_pX_c* a, long n, long finalprec) except -1: |
1281 | | return ZZ_pX_eis_shift(self, x, a, n, finalprec) |
| 1296 | return ZZ_pX_eis_shift_a(self, x, a, n, finalprec) |
1282 | 1297 | |
1283 | 1298 | # ##print "starting..." |
1284 | 1299 | # cdef ZZ_pX_c low_part |
… |
… |
cdef class PowComputer_ZZ_pX_small_Eis(P |
1608 | 1623 | sage_free(self.high_shifter) |
1609 | 1624 | |
1610 | 1625 | cdef int eis_shift(self, ZZ_pX_c* x, ZZ_pX_c* a, long n, long finalprec) except -1: |
1611 | | return ZZ_pX_eis_shift(self, x, a, n, finalprec) |
| 1626 | return ZZ_pX_eis_shift_a(self, x, a, n, finalprec) |
1612 | 1627 | |
1613 | 1628 | cdef class PowComputer_ZZ_pX_big(PowComputer_ZZ_pX): |
1614 | 1629 | """ |
… |
… |
cdef class PowComputer_ZZ_pX_big_Eis(Pow |
1906 | 1921 | sage_free(self.high_shifter) |
1907 | 1922 | |
1908 | 1923 | cdef int eis_shift(self, ZZ_pX_c* x, ZZ_pX_c* a, long n, long finalprec) except -1: |
1909 | | return ZZ_pX_eis_shift(self, x, a, n, finalprec) |
| 1924 | return ZZ_pX_eis_shift_a(self, x, a, n, finalprec) |
1910 | 1925 | |
1911 | 1926 | def PowComputer_ext_maker(prime, cache_limit, prec_cap, ram_prec_cap, in_field, poly, prec_type = "small", ext_type = "u", shift_seed = None): |
1912 | 1927 | """ |