summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Caruso <xavier.caruso@univ-rennes1.fr>2017-08-02 11:14:12 +0200
committerXavier Caruso <xavier.caruso@univ-rennes1.fr>2017-08-02 11:14:12 +0200
commit1951205a93d24cf59df6ce9ed4b9095efa5db5c0 (patch)
tree33158b13bc212ae00a51d31a0e9965669c03f9e1
parentFix element_class (diff)
Fix convert_multiple
-rw-r--r--src/sage/rings/padics/padic_base_leaves.py8
-rw-r--r--src/sage/rings/padics/padic_lattice_element.py8
2 files changed, 9 insertions, 7 deletions
diff --git a/src/sage/rings/padics/padic_base_leaves.py b/src/sage/rings/padics/padic_base_leaves.py
index fd020d4..5553c37 100644
--- a/src/sage/rings/padics/padic_base_leaves.py
+++ b/src/sage/rings/padics/padic_base_leaves.py
@@ -903,13 +903,13 @@ class pAdicLatticeGeneric(pAdicGeneric):
for i in range(j):
dx.append([L[i], lattice[i,j]])
prec = lattice[j,j].valuation(p)
- y = self.element_class(self, x.value(), prec, dx=dx, dx_mode='values', check=False)
+ y = self._element_class(self, x.value(), prec, dx=dx, dx_mode='values', check=False, reduce=False)
for i in indices[id(x)]:
ans[i] = y
L[j] = y
# Now the other elements
for x in elt_other:
- y = self.element_class(self, x)
+ y = self._element_class(self, x)
for i in indices[id(x)]:
ans[i] = y
@@ -921,7 +921,7 @@ class pAdicLatticeGeneric(pAdicGeneric):
class pAdicRingLattice(pAdicLatticeGeneric, pAdicRingBaseGeneric):
def __init__(self, p, prec, print_mode, name, label=None, proof=False):
pAdicLatticeGeneric.__init__(self, p, prec, label, proof)
- pAdicRingBaseGeneric.__init__(self, p, prec, print_mode, str(p), pAdicLatticeElement)
+ pAdicRingBaseGeneric.__init__(self, p, prec, print_mode, str(p), None)
def _repr_(self, do_latex=False):
if do_latex:
@@ -963,7 +963,7 @@ class pAdicRingLattice(pAdicLatticeGeneric, pAdicRingBaseGeneric):
class pAdicFieldLattice(pAdicLatticeGeneric, pAdicFieldBaseGeneric):
def __init__(self, p, prec, print_mode, name, label=None, proof=False):
pAdicLatticeGeneric.__init__(self, p, prec, label, proof)
- pAdicFieldBaseGeneric.__init__(self, p, prec, print_mode, str(p), pAdicLatticeElement)
+ pAdicFieldBaseGeneric.__init__(self, p, prec, print_mode, str(p), None)
def _repr_(self, do_latex=False):
if do_latex:
diff --git a/src/sage/rings/padics/padic_lattice_element.py b/src/sage/rings/padics/padic_lattice_element.py
index 007d2fe..289fe05 100644
--- a/src/sage/rings/padics/padic_lattice_element.py
+++ b/src/sage/rings/padics/padic_lattice_element.py
@@ -10,7 +10,7 @@ from sage.rings.padics.lattice_precision import pRational
class pAdicLatticeElement(pAdicGenericElement):
- def __init__(self, parent, x, prec=None, dx=[], dx_mode='linear_combinaison', valuation=None, check=True):
+ def __init__(self, parent, x, prec=None, dx=[], dx_mode='linear_combinaison', valuation=None, check=True, reduce=True):
self._parent = parent
pAdicGenericElement.__init__(self, parent)
self._precision = parent.precision()
@@ -31,9 +31,11 @@ class pAdicLatticeElement(pAdicGenericElement):
prec = cap
self._precision.new_element(self, dx, bigoh=prec, dx_mode=dx_mode)
if isinstance(x, pRational):
- self._value = x.reduce(prec)
+ self._value = x
else:
- self._value = pRational(parent.prime(), QQ(x)).reduce(prec)
+ self._value = pRational(parent.prime(), QQ(x))
+ if reduce:
+ self._value = self._value.reduce(prec)
self._approx_one = pRational(parent.prime(), 1)
self._approx_minusone = pRational(parent.prime(), -1)