Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
conversion from finite fields
Browse files Browse the repository at this point in the history
  • Loading branch information
saraedum committed Jan 4, 2014
1 parent 8f255a9 commit 244b3a8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/sage/rings/padics/padic_template_element.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ include "sage/libs/pari/decl.pxi"
include "sage/ext/python.pxi"

import sage.rings.finite_rings.integer_mod
from sage.rings.finite_rings.element_base
from sage.libs.pari.gen cimport gen as pari_gen
cdef extern from "convert.h":
cdef void t_INT_to_ZZ( mpz_t value, GEN g )
Expand Down Expand Up @@ -107,6 +108,8 @@ cdef class pAdicTemplateElement(pAdicGenericElement):
elif PY_TYPE_CHECK(x, pAdicGenericElement):
if not ((<pAdicGenericElement>x)._is_base_elt(self.prime_pow.prime) or x.parent() is self.parent()):
raise NotImplementedError("conversion between padic extensions not implemented")
elif sage.rings.finite_rings.element_base.is_FiniteFieldElement(x) and x.parent() is self.parent().residue_field():
x = x.polynomial().list()
elif not (PY_TYPE_CHECK(x, Integer) or \
PY_TYPE_CHECK(x, Rational) or \
PY_TYPE_CHECK(x, pari_gen) or \
Expand Down

0 comments on commit 244b3a8

Please sign in to comment.