I do not think that sorting the output is important. AFAICT f.roots
contains a sort routine for some base rings only. For instance, the
behavior differs between ZZ and RR:
sage: R.<x> = ZZ[]
sage: p = (x-3)*(x+5)*(x-6)
sage: p.roots(multiplicities=False)
[6, 3, -5]
sage: p.change_ring(RR).roots(multiplicities=False)
[-5.00000000000000, 3.00000000000000, 6.00000000000000]
I'm thus in favor of removing the sort routine.
Bruno
Le 12/06/2017 à 07:21, Nils Bruin a écrit :
How attached are people to creating deterministic output where none is
warranted?
Currently, there is a "sort" routine in f.roots which creates a 60%
overhead:
sage: C=ComplexField(100)
sage: %timeit f.roots(multiplicities=False)
1000 loops, best of 3: 703 µs per loop
sage: %timeit [C(a) for a in F.polroots(precision=C.prec())]
The slowest run took 4.22 times longer than the fastest. This could
mean that an intermediate result is being cached.
1000 loops, best of 3: 432 µs per loop
Is it really worth that much to enforce output to be in some arbitrary
order?
I'd hope we can do away with this and instead just sort stuff in
doctests, if people want to test their floating point results using
string matching.
--
You received this message because you are subscribed to the Google
Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"sage-devel" 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-devel.
For more options, visit https://groups.google.com/d/optout.