# HG changeset patch
# User Kiran S. Kedlaya <kedlaya@mit.edu>
# Date 1202513078 18000
# Node ID 75d53ed84c0643926dc87622e0422bd0a1b52716
# Parent efd8a8c9dda18e4189e01fb7376ed77373a53b10
Fix uninitialized value in ZZ_pX constructor, add normalized_valuation
diff -r efd8a8c9dda1 -r 75d53ed84c06 sage/rings/padics/local_generic_element.pyx
|
a
|
b
|
cdef class LocalGenericElement(Commutati |
| 282 | 282 | #def valuation(self): |
| 283 | 283 | # raise NotImplementedError |
| 284 | 284 | |
| | 285 | def normalized_valuation(self): |
| | 286 | r""" |
| | 287 | Returns the normalized valuation of this local ring element, |
| | 288 | i.e., the valuation divided by the absolute ramification index. |
| | 289 | |
| | 290 | INPUT: |
| | 291 | self -- a local ring element. |
| | 292 | |
| | 293 | OUTPUT: |
| | 294 | rational -- the normalized valuation of self. |
| | 295 | |
| | 296 | EXAMPLES: |
| | 297 | sage: Q7 = Qp(7) |
| | 298 | sage: R.<x> = Q7[] |
| | 299 | sage: F.<z> = Q7.ext(x^3+7*x+7) |
| | 300 | sage: z.normalized_valuation() |
| | 301 | 1/3 |
| | 302 | """ |
| | 303 | F = self.parent() |
| | 304 | return self.valuation()/F.ramification_index() |
| | 305 | |
| 285 | 306 | def _min_valuation(self): |
| 286 | 307 | r""" |
| 287 | 308 | Returns the valuation of this local ring element. |
diff -r efd8a8c9dda1 -r 75d53ed84c06 sage/rings/padics/padic_ZZ_pX_CA_element.pyx
|
a
|
b
|
cdef class pAdicZZpXCAElement(pAdicZZpXE |
| 168 | 168 | aprec = mpz_get_si((<Integer>absprec).value) |
| 169 | 169 | if aprec > self.prime_pow.ram_prec_cap: |
| 170 | 170 | aprec = self.prime_pow.ram_prec_cap |
| 171 | | if relprec is not infinity: |
| | 171 | if relprec is infinity: |
| | 172 | # This might not be the right default |
| | 173 | rprec = self.prime_pow.ram_prec_cap |
| | 174 | else: |
| 172 | 175 | if not PY_TYPE_CHECK(relprec, Integer): |
| 173 | | relprec = Integer(relprec) |
| | 176 | rprec = Integer(relprec) |
| 174 | 177 | if mpz_cmp_ui((<Integer>relprec).value, aprec) >= 0: |
| 175 | | relprec = infinity |
| | 178 | rprec = self.prime_pow.ram_prec_cap |
| 176 | 179 | elif relprec < 0: |
| 177 | 180 | rprec = 0 |
| 178 | 181 | else: |