@@ -679,7 +679,7 @@ cdef class interval_bernstein_polynomial_integer(interval_bernstein_polynomial):
679
679
680
680
cdef int degree(self ):
681
681
"""
682
- Returns the (formal) degree of this polynomial.
682
+ Return the (formal) degree of this polynomial.
683
683
"""
684
684
return len (self .coeffs) - 1
685
685
@@ -776,7 +776,7 @@ cdef class interval_bernstein_polynomial_integer(interval_bernstein_polynomial):
776
776
777
777
def get_msb_bit (self ):
778
778
"""
779
- Returns an approximation of the log2 of the maximum of the
779
+ Return an approximation of the log2 of the maximum of the
780
780
absolute values of the coefficients, as an integer.
781
781
"""
782
782
return self .scale_log2 + self .bitsize
@@ -1554,7 +1554,7 @@ cdef class interval_bernstein_polynomial_float(interval_bernstein_polynomial):
1554
1554
1555
1555
cdef int degree(self ):
1556
1556
"""
1557
- Returns the (formal) degree of this polynomial.
1557
+ Return the (formal) degree of this polynomial.
1558
1558
"""
1559
1559
return len (self .coeffs) - 1
1560
1560
@@ -1642,7 +1642,7 @@ cdef class interval_bernstein_polynomial_float(interval_bernstein_polynomial):
1642
1642
1643
1643
def get_msb_bit (self ):
1644
1644
"""
1645
- Returns an approximation of the log2 of the maximum of the
1645
+ Return an approximation of the log2 of the maximum of the
1646
1646
absolute values of the coefficients, as an integer.
1647
1647
"""
1648
1648
return self .scale_log2 - 53 + self .bitsize
@@ -1818,15 +1818,17 @@ def max_abs_doublevec(Vector_real_double_dense c):
1818
1818
1819
1819
def wordsize_rational (a , b , wordsize ):
1820
1820
"""
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
1823
1825
(according to the criteria mentioned in the documentation
1824
1826
for de_casteljau_intvec), with a bias towards split points near a.
1825
1827
1826
1828
In full detail:
1827
1829
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.
1830
1832
The denominator of r is a power of 2. Let m be min(r, 1-r),
1831
1833
nm be numerator(m), and dml be log2(denominator(m)). The return value
1832
1834
r is taken from the first of the following classes to have any
@@ -2550,14 +2552,14 @@ class bernstein_polynomial_factory:
2550
2552
2551
2553
def lsign (self ):
2552
2554
"""
2553
- Returns the sign of the first coefficient of this
2555
+ Return the sign of the first coefficient of this
2554
2556
Bernstein polynomial.
2555
2557
"""
2556
2558
return self ._sign(self .coeffs[0 ])
2557
2559
2558
2560
def usign (self ):
2559
2561
"""
2560
- Returns the sign of the last coefficient of this
2562
+ Return the sign of the last coefficient of this
2561
2563
Bernstein polynomial.
2562
2564
"""
2563
2565
return self ._sign(self .coeffs[- 1 ])
@@ -3077,7 +3079,7 @@ cdef class ocean:
3077
3079
3078
3080
def approx_bp (self , scale_log2 ):
3079
3081
"""
3080
- Returns an approximation to our Bernstein polynomial with the
3082
+ Return an approximation to our Bernstein polynomial with the
3081
3083
given scale_log2.
3082
3084
3083
3085
EXAMPLES::
@@ -3830,10 +3832,10 @@ class warp_map:
3830
3832
3831
3833
def real_roots (p , bounds = None , seed = None , skip_squarefree = False , do_logging = False , wordsize = 32 , retval = ' rational' , strategy = None , max_diameter = None ):
3832
3834
"""
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.
3837
3839
3838
3840
The root itself can be returned in one of three different ways.
3839
3841
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
4050
4052
4051
4053
cdef ocean oc
4052
4054
4053
- for ( factor, exp) in factors:
4055
+ for factor, exp in factors:
4054
4056
if strategy== ' warp' :
4055
4057
if factor.constant_coefficient() == 0 :
4056
4058
x = factor.parent().gen()
@@ -4105,7 +4107,7 @@ def real_roots(p, bounds=None, seed=None, skip_squarefree=False, do_logging=Fals
4105
4107
while True :
4106
4108
all_roots = copy(extra_roots)
4107
4109
4108
- for ( oc, factor, exp) in oceans:
4110
+ for oc, factor, exp in oceans:
4109
4111
rel_roots = oc.roots()
4110
4112
4111
4113
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
4162
4164
if ok:
4163
4165
break
4164
4166
4165
- for ( oc, factor, exp) in oceans:
4167
+ for oc, factor, exp in oceans:
4166
4168
oc.find_roots()
4167
4169
4168
4170
if do_logging:
@@ -4467,7 +4469,7 @@ def bernstein_expand(Vector_integer_dense c, int d2):
4467
4469
multiplies, but in this version all the multiplies are by single
4468
4470
machine words).
4469
4471
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
4471
4473
error E. (So if an element of the returned polynomial is a, and the
4472
4474
true value of that coefficient is b, then a <= b < a + E.)
4473
4475
0 commit comments