#10604: Rewrite diagonal matrix constructor
------------------------------+---------------------------------------------
   Reporter:  rbeezer         |       Owner:  jason, was
       Type:  defect          |      Status:  new       
   Priority:  minor           |   Milestone:  sage-4.6.2
  Component:  linear algebra  |    Keywords:            
     Author:                  |    Upstream:  N/A       
   Reviewer:                  |      Merged:            
Work_issues:                  |  
------------------------------+---------------------------------------------
Description changed by rbeezer:

Old description:

> Diagonal matrix constructor fails when given a tuple, and there is a
> request to support numpy arrays as input.  This seems easiest to
> accomplish with a re-write and documentation upgrade.

New description:

 Diagonal matrix constructor fails when given a tuple, and there is a
 request to support numpy arrays as input.  This seems easiest to
 accomplish with a re-write and documentation upgrade.

 `NumPy` array request:
 http://groups.google.com/group/sage-
 devel/browse_thread/thread/f0ecd06fcf9efb1b

 {{{
 sage: diagonal_matrix( (1,2,3) )
 ---------------------------------------------------------------------------
 ValueError                                Traceback (most recent call
 last)

 /home/sage/sage-4.6.1.rc1/devel/sage-main/<ipython console> in <module>()

 /home/sage/sage-4.6.1.rc1/local/lib/python2.6/site-
 packages/sage/matrix/constructor.pyc in diagonal_matrix(arg0, arg1, arg2,
 sparse)
    1271
    1272     if ring is None:
 -> 1273         return matrix(nrows, nrows, w, sparse=sparse)
    1274     else:
    1275         return matrix(ring, nrows, nrows, w, sparse=sparse)

 /home/sage/sage-4.6.1.rc1/local/lib/python2.6/site-
 packages/sage/matrix/constructor.pyc in matrix(*args, **kwds)
     577                         ncols = len(args[0]) // nrows
     578                     elif ncols != len(args[0]) // nrows:
 --> 579                         raise ValueError, "entries has the wrong
 length"
     580                 elif len(args[0]) > 0:
     581                     raise ValueError, "entries has the wrong
 length"

 ValueError: entries has the wrong length
 }}}

--

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