Skip to content

Commit f8d3154

Browse files
committed
suggested details
1 parent c0a666f commit f8d3154

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

src/sage/rings/polynomial/real_roots.pyx

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ cdef class interval_bernstein_polynomial_integer(interval_bernstein_polynomial):
679679

680680
cdef int degree(self):
681681
"""
682-
Returns the (formal) degree of this polynomial.
682+
Return the (formal) degree of this polynomial.
683683
"""
684684
return len(self.coeffs) - 1
685685

@@ -776,7 +776,7 @@ cdef class interval_bernstein_polynomial_integer(interval_bernstein_polynomial):
776776

777777
def get_msb_bit(self):
778778
"""
779-
Returns an approximation of the log2 of the maximum of the
779+
Return an approximation of the log2 of the maximum of the
780780
absolute values of the coefficients, as an integer.
781781
"""
782782
return self.scale_log2 + self.bitsize
@@ -1554,7 +1554,7 @@ cdef class interval_bernstein_polynomial_float(interval_bernstein_polynomial):
15541554

15551555
cdef int degree(self):
15561556
"""
1557-
Returns the (formal) degree of this polynomial.
1557+
Return the (formal) degree of this polynomial.
15581558
"""
15591559
return len(self.coeffs) - 1
15601560

@@ -1642,7 +1642,7 @@ cdef class interval_bernstein_polynomial_float(interval_bernstein_polynomial):
16421642

16431643
def get_msb_bit(self):
16441644
"""
1645-
Returns an approximation of the log2 of the maximum of the
1645+
Return an approximation of the log2 of the maximum of the
16461646
absolute values of the coefficients, as an integer.
16471647
"""
16481648
return self.scale_log2 - 53 + self.bitsize
@@ -1818,15 +1818,17 @@ def max_abs_doublevec(Vector_real_double_dense c):
18181818

18191819
def wordsize_rational(a, b, wordsize):
18201820
"""
1821-
Given rationals a and b, selects a de Casteljau split point r between
1822-
a and b. An attempt is made to select an efficient split point
1821+
Given rationals a and b, select a de Casteljau split point r between
1822+
a and b.
1823+
1824+
An attempt is made to select an efficient split point
18231825
(according to the criteria mentioned in the documentation
18241826
for de_casteljau_intvec), with a bias towards split points near a.
18251827
18261828
In full detail:
18271829
1828-
Takes as input two rationals, a and b, such that 0<=a<=1, 0<=b<=1,
1829-
and a!=b. Returns rational r, such that a<=r<=b or b<=r<=a.
1830+
This takes as input two rationals, a and b, such that 0<=a<=1, 0<=b<=1,
1831+
and a!=b. This returns rational r, such that a<=r<=b or b<=r<=a.
18301832
The denominator of r is a power of 2. Let m be min(r, 1-r),
18311833
nm be numerator(m), and dml be log2(denominator(m)). The return value
18321834
r is taken from the first of the following classes to have any
@@ -2550,14 +2552,14 @@ class bernstein_polynomial_factory:
25502552

25512553
def lsign(self):
25522554
"""
2553-
Returns the sign of the first coefficient of this
2555+
Return the sign of the first coefficient of this
25542556
Bernstein polynomial.
25552557
"""
25562558
return self._sign(self.coeffs[0])
25572559

25582560
def usign(self):
25592561
"""
2560-
Returns the sign of the last coefficient of this
2562+
Return the sign of the last coefficient of this
25612563
Bernstein polynomial.
25622564
"""
25632565
return self._sign(self.coeffs[-1])
@@ -3077,7 +3079,7 @@ cdef class ocean:
30773079

30783080
def approx_bp(self, scale_log2):
30793081
"""
3080-
Returns an approximation to our Bernstein polynomial with the
3082+
Return an approximation to our Bernstein polynomial with the
30813083
given scale_log2.
30823084
30833085
EXAMPLES::
@@ -3830,10 +3832,10 @@ class warp_map:
38303832

38313833
def real_roots(p, bounds=None, seed=None, skip_squarefree=False, do_logging=False, wordsize=32, retval='rational', strategy=None, max_diameter=None):
38323834
"""
3833-
Compute the real roots of a given polynomial with exact
3834-
coefficients (integer, rational, and algebraic real coefficients
3835-
are supported). Returns a list of pairs of a root and its
3836-
multiplicity.
3835+
Compute the real roots of a given polynomial with exact coefficients
3836+
(integer, rational, and algebraic real coefficients are supported).
3837+
3838+
This returns a list of pairs of a root and its multiplicity.
38373839
38383840
The root itself can be returned in one of three different ways.
38393841
If retval=='rational', then it is returned as a pair of rationals
@@ -4050,7 +4052,7 @@ def real_roots(p, bounds=None, seed=None, skip_squarefree=False, do_logging=Fals
40504052

40514053
cdef ocean oc
40524054

4053-
for (factor, exp) in factors:
4055+
for factor, exp in factors:
40544056
if strategy=='warp':
40554057
if factor.constant_coefficient() == 0:
40564058
x = factor.parent().gen()
@@ -4105,7 +4107,7 @@ def real_roots(p, bounds=None, seed=None, skip_squarefree=False, do_logging=Fals
41054107
while True:
41064108
all_roots = copy(extra_roots)
41074109

4108-
for (oc, factor, exp) in oceans:
4110+
for oc, factor, exp in oceans:
41094111
rel_roots = oc.roots()
41104112

41114113
cur_roots = [oc.mapping.from_ocean(r) for r in rel_roots]
@@ -4162,7 +4164,7 @@ def real_roots(p, bounds=None, seed=None, skip_squarefree=False, do_logging=Fals
41624164
if ok:
41634165
break
41644166

4165-
for (oc, factor, exp) in oceans:
4167+
for oc, factor, exp in oceans:
41664168
oc.find_roots()
41674169

41684170
if do_logging:
@@ -4467,7 +4469,7 @@ def bernstein_expand(Vector_integer_dense c, int d2):
44674469
multiplies, but in this version all the multiplies are by single
44684470
machine words).
44694471
4470-
Returns a pair consisting of the expanded polynomial, and the maximum
4472+
This returns a pair consisting of the expanded polynomial, and the maximum
44714473
error E. (So if an element of the returned polynomial is a, and the
44724474
true value of that coefficient is b, then a <= b < a + E.)
44734475

0 commit comments

Comments
 (0)