Skip to content

Commit dedfbf7

Browse files
committed
rename __fld_numerator -> _fld_numerator
1 parent d799994 commit dedfbf7

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

src/sage/algebras/quatalg/quaternion_algebra_element.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1727,7 +1727,7 @@ cdef class QuaternionAlgebraElement_number_field(QuaternionAlgebraElement_abstra
17271727
fmpz_poly_set_ZZX(self.a, a._numerator) # we will assume that the denominator of a and b are 1
17281728
fmpz_poly_set_ZZX(self.b, b._numerator)
17291729

1730-
fmpz_poly_set_ZZX(self.modulus, (<NumberFieldElement>x).__fld_numerator.x) # and same for the modulus
1730+
fmpz_poly_set_ZZX(self.modulus, (<NumberFieldElement>x)._fld_numerator.x) # and same for the modulus
17311731

17321732
def __getitem__(self, int i):
17331733
"""

src/sage/rings/number_field/number_field_element.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ cdef class NumberFieldElement(NumberFieldElement_base):
1515
cdef ZZ_c _denominator
1616
# Pointers to the defining polynomial (with numerator) for the field.
1717
# I keep these as pointers for arithmetic speed.
18-
cdef ntl_ZZX __fld_numerator
18+
cdef ntl_ZZX _fld_numerator
1919
cdef ntl_ZZ _fld_denominator
2020
cdef object __multiplicative_order
2121
cdef object __pari

src/sage/rings/number_field/number_field_element.pyx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ cdef class NumberFieldElement(NumberFieldElement_base):
218218
cdef type t = type(self)
219219
cdef NumberFieldElement x = <NumberFieldElement>t.__new__(t)
220220
x._parent = self._parent
221-
x.__fld_numerator = self.__fld_numerator
221+
x._fld_numerator = self._fld_numerator
222222
x._fld_denominator = self._fld_denominator
223223
return x
224224

@@ -317,7 +317,7 @@ cdef class NumberFieldElement(NumberFieldElement_base):
317317
True
318318
"""
319319
FieldElement.__init__(self, parent)
320-
self.__fld_numerator, self._fld_denominator = parent.absolute_polynomial_ntl()
320+
self._fld_numerator, self._fld_denominator = parent.absolute_polynomial_ntl()
321321

322322
cdef ZZ_c coeff
323323
if isinstance(f, (int, Integer_sage)):
@@ -417,7 +417,7 @@ cdef class NumberFieldElement(NumberFieldElement_base):
417417
cdef type t = type(self)
418418
cdef NumberFieldElement x = <NumberFieldElement>t.__new__(t)
419419
x._parent = <ParentWithBase>new_parent
420-
x.__fld_numerator, x._fld_denominator = new_parent.polynomial_ntl()
420+
x._fld_numerator, x._fld_denominator = new_parent.polynomial_ntl()
421421
x._denominator = self._denominator
422422
cdef ZZX_c result
423423
cdef ZZ_c tmp
@@ -427,7 +427,7 @@ cdef class NumberFieldElement(NumberFieldElement_base):
427427
for i from 0 <= i <= ZZX_deg(self._numerator):
428428
tmp = ZZX_coeff(self._numerator, i)
429429
ZZX_SetCoeff(result, i*rel, tmp)
430-
ZZX_rem(x._numerator, result, x.__fld_numerator.x)
430+
ZZX_rem(x._numerator, result, x._fld_numerator.x)
431431
return x
432432

433433
def __reduce__(self):
@@ -966,7 +966,7 @@ cdef class NumberFieldElement(NumberFieldElement_base):
966966
# set the denominator
967967
mpz_set_si(denom_temp.value, 1)
968968
mpz_to_ZZ(&self._denominator, (<Integer>denom_temp).value)
969-
for i from 0 <= i < ZZX_deg(self.__fld_numerator.x):
969+
for i from 0 <= i < ZZX_deg(self._fld_numerator.x):
970970
tmp_integer = <Integer>(ZZ.random_element(x=num_bound,
971971
distribution=distribution))
972972
mpz_to_ZZ(&ntl_temp, (<Integer>tmp_integer).value)
@@ -977,7 +977,7 @@ cdef class NumberFieldElement(NumberFieldElement_base):
977977
mpz_set_si(denom_temp.value, 1)
978978
tmp_integer = Integer.__new__(Integer)
979979

980-
for i from 0 <= i < ZZX_deg(self.__fld_numerator.x):
980+
for i from 0 <= i < ZZX_deg(self._fld_numerator.x):
981981
tmp_rational = <Rational>(QQ.random_element(num_bound=num_bound,
982982
den_bound=den_bound,
983983
distribution=distribution))
@@ -992,7 +992,7 @@ cdef class NumberFieldElement(NumberFieldElement_base):
992992
mpz_to_ZZ(&self._denominator, (<Integer>denom_temp).value)
993993

994994
# now the coefficients themselves.
995-
for i from 0 <= i < ZZX_deg(self.__fld_numerator.x):
995+
for i from 0 <= i < ZZX_deg(self._fld_numerator.x):
996996
# calculate the new numerator. if our old entry is
997997
# p/q, and the lcm is k, it's just pk/q, which we
998998
# also know is integral -- so we can use mpz_divexact
@@ -2572,14 +2572,14 @@ cdef class NumberFieldElement(NumberFieldElement_base):
25722572
# MulMod doesn't handle non-monic polynomials.
25732573
# Therefore, we handle the non-monic case entirely separately.
25742574
ZZ_mul(x._denominator, self._denominator, _right._denominator)
2575-
if ZZ_IsOne(ZZX_LeadCoeff(self.__fld_numerator.x)):
2576-
ZZX_MulMod(x._numerator, self._numerator, _right._numerator, self.__fld_numerator.x)
2575+
if ZZ_IsOne(ZZX_LeadCoeff(self._fld_numerator.x)):
2576+
ZZX_MulMod(x._numerator, self._numerator, _right._numerator, self._fld_numerator.x)
25772577
else:
25782578
ZZX_mul(x._numerator, self._numerator, _right._numerator)
2579-
if ZZX_deg(x._numerator) >= ZZX_deg(self.__fld_numerator.x):
2579+
if ZZX_deg(x._numerator) >= ZZX_deg(self._fld_numerator.x):
25802580
ZZX_mul_ZZ( x._numerator, x._numerator, self._fld_denominator.x )
2581-
ZZX_mul_ZZ( temp, self.__fld_numerator.x, x._denominator )
2582-
ZZ_power(temp1,ZZX_LeadCoeff(temp),ZZX_deg(x._numerator)-ZZX_deg(self.__fld_numerator.x)+1)
2581+
ZZX_mul_ZZ( temp, self._fld_numerator.x, x._denominator )
2582+
ZZ_power(temp1,ZZX_LeadCoeff(temp),ZZX_deg(x._numerator)-ZZX_deg(self._fld_numerator.x)+1)
25832583
ZZX_PseudoRem(x._numerator, x._numerator, temp)
25842584
ZZ_mul(x._denominator, x._denominator, self._fld_denominator.x)
25852585
ZZ_mul(x._denominator, x._denominator, temp1)
@@ -2835,7 +2835,7 @@ cdef class NumberFieldElement(NumberFieldElement_base):
28352835
# but may fail if NTL runs out of FFT primes.
28362836
x = self._new()
28372837
sig_on()
2838-
ZZX_XGCD(x._denominator, x._numerator, temp, self._numerator, self.__fld_numerator.x, 1)
2838+
ZZX_XGCD(x._denominator, x._numerator, temp, self._numerator, self._fld_numerator.x, 1)
28392839
ZZX_mul_ZZ(x._numerator, x._numerator, self._denominator)
28402840
x._reduce_c_()
28412841
sig_off()
@@ -5322,7 +5322,7 @@ cdef class OrderElement_absolute(NumberFieldElement_absolute):
53225322
cdef OrderElement_absolute x = <OrderElement_absolute>t.__new__(t)
53235323
x._parent = self._parent
53245324
x._number_field = self._parent.number_field()
5325-
x.__fld_numerator = self.__fld_numerator
5325+
x._fld_numerator = self._fld_numerator
53265326
x._fld_denominator = self._fld_denominator
53275327
return x
53285328

@@ -5443,7 +5443,7 @@ cdef class OrderElement_relative(NumberFieldElement_relative):
54435443
cdef OrderElement_relative x = <OrderElement_relative>t.__new__(t)
54445444
x._parent = self._parent
54455445
x._number_field = self._parent.number_field()
5446-
x.__fld_numerator = self.__fld_numerator
5446+
x._fld_numerator = self._fld_numerator
54475447
x._fld_denominator = self._fld_denominator
54485448
return x
54495449

src/sage/rings/number_field/number_field_element_quadratic.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ cdef class NumberFieldElement_quadratic(NumberFieldElement_absolute):
610610
mpz_clear(tmp_mpz)
611611

612612
x._parent = <ParentWithBase>new_parent
613-
x.__fld_numerator, x._fld_denominator = new_parent.polynomial_ntl()
613+
x._fld_numerator, x._fld_denominator = new_parent.polynomial_ntl()
614614
x._denominator = elt_den
615615
cdef ZZX_c result
616616
cdef ZZ_c tmp

0 commit comments

Comments
 (0)