#10304: PolynomialRing_field.lagrange_polynomial doesn't always return a 
polynomial
-----------------------------------+----------------------------------------
   Reporter:  mguaypaq             |       Owner:  mguaypaq                     
       
       Type:  defect               |      Status:  needs_review                 
       
   Priority:  major                |   Milestone:  sage-4.6.1                   
       
  Component:  algebra              |    Keywords:  polynomial ring, lagrange 
polynomial
     Author:  Mathieu Guay-Paquet  |    Upstream:  N/A                          
       
   Reviewer:                       |      Merged:                               
       
Work_issues:                       |  
-----------------------------------+----------------------------------------
Changes (by newvalueoldvalue):

 * cc: mvngu (added)
  * status:  new => needs_review
  * author:  => Mathieu Guay-Paquet


Comment:

 I've put up a patch that should fix the problem, at least in the case of
 {{{algorithm='divided_difference'}}}, and includes a new doctest to verify
 this.

 For the {{{algorithm='neville'}}} case, I've taken the liberty of
 rewriting the code, to clean it up and unify it a bit in addition to
 fixing the original problem. However:
  * This changes the default value of {{{previous_row}}} from {{{None}}} to
 {{{[]}}}. I doubt this would break anything, but it is a slight change in
 the function signature.
  * In the case of an empty list of points, I wasn't sure whether to return
 {{{[]}}} or {{{[0]}}}. The former is more consistent with the
 {{{previous_row}}} option, but the latter preserves the property that the
 last element of the returned list is the interpolating polynomial (as
 opposed to non-existent). I opted for the first one, but there's
 definitely a choice to be made here. (I'll note that neither choice is
 really backwards-incompatible, since the method used to fail in this
 case.)

 Minh, I've put you on CC, since (I think) you wrote the original code for
 the {{{algorithm='neville'}}} part. Do you approve of the changes?

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10304#comment:1>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to