Am Di., 25. Juni 2019 um 10:49 Uhr 'luisfe' :
| When n =0, k ranges from 0 to -1 so there is no k and the list
constructed in ib(n,m)
| is just the empty list. Not an empty list of polynomials, just an empty
list.
Well, then the way 'sum' is implemented is possibly improvable?
The type information for "binomial(m*n-1, m*k)*polynomial(m,k)"
is there, regardless of what the value of the integers m, n, and k is.
(The definition of 'polynomial' here does not matter as long as it is a
polynomial.)
To see this try this:
def ib(m, n):
R = ZZ['x']
p = lambda m,n,k: binomial(m*n-1, m*k)*cyclotomic_polynomial(m*(k+1))
print type(R(p(2,n,0)))
return [p(m,n,k) for k in (0..n-1)]
for n in (0..3):
r = ib(2,n)
print(type(r), r)
The output includes in *all* cases
<type
'sage.rings.polynomial.polynomial_integer_dense_flint.Polynomial_integer_dense_flint'>
So why not use this information to return the zero of this ring if the sum
range (a..b) has not a <= b?
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sage-support/CAMMbGZb0BL_hJG12U88D678gPT0Y9iiAR_3vDeghazOBDmfS7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.