#20571: Newton method for nth_root of polynomial
-------------------------------------+-------------------------------------
Reporter: vdelecroix | Owner:
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-7.3
Component: algebra | Resolution:
Keywords: | Merged in:
Authors: Vincent Delecroix | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/vdelecroix/20571 | f1996ab8f035d548bec7d2e518da0081ab211b29
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Changes (by bruno):
* status: needs_review => needs_work
Comment:
Hi Vincent,
1. For the Newton method, your loop ranges over
`newton_method_sizes(p.degree()+1)`: if you are computing an `n`-th root,
isn't it sufficient to loop up to `p.degree()//n + 1`? It would fasten the
case when `p.nth_root(n)` raises an `Exception`.
2. Instead of the following code, you may use `i = self.valuation()`. The
code would gain in legibility, and it is slightly faster if I ran my tests
correctly:
{{{#!python
i = 1
while self[i].is_zero():
i += 1
}}}
3. Two typos:
{{{#!diff
This is computed using Newton method in the ring of power series.
This
method works only when the base ring is an integral domain.
Morever, for
polynomial whose coefficient of lower degree is different from 1,
the
- elemehts of the base ring should have a method ``nth_root``
implemented.
+ elements of the base ring should have a method ``nth_root``
implemented.
}}}
{{{#!diff
- # begining of Newton method
+ # beginning of Newton method
Sorig = p.parent()
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/20571#comment:11>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" 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-trac.
For more options, visit https://groups.google.com/d/optout.