#11356: Companion matrix constructor
------------------------------+---------------------------------------------
   Reporter:  rbeezer         |          Owner:  jason, was    
       Type:  enhancement     |         Status:  needs_work    
   Priority:  minor           |      Milestone:  sage-4.7.1    
  Component:  linear algebra  |       Keywords:  beginner, sd31
Work_issues:                  |       Upstream:  N/A           
   Reviewer:                  |         Author:  Rob Beezer    
     Merged:                  |   Dependencies:                
------------------------------+---------------------------------------------
Changes (by ddrake):

  * status:  needs_review => needs_work


Comment:

 If you feed `companion_matrix` the empty list, it complains about an
 `IndexError`. I'd rather see it:

   * return the empty matrix, or
   * change line 2839 to `if n == 0 or or not poly[n] == 1:` so that the
 `ValueError` actually gets raised.

 Returning the empty matrix seems about right, but I can imagine people
 having strong opinions about the zero polynomial not being monic. I don't
 know about the conventions in this corner case, so do whatever seems best.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11356#comment:13>
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