#12348: variable ind has the wrong type in matrix indexing; and why are big 
sparse
matrices so slow to make?
------------------------------+---------------------------------------------
   Reporter:  was             |          Owner:  jason, was
       Type:  defect          |         Status:  new       
   Priority:  minor           |      Milestone:  sage-5.0  
  Component:  linear algebra  |       Keywords:            
Work_issues:                  |       Upstream:  N/A       
   Reviewer:                  |         Author:            
     Merged:                  |   Dependencies:            
------------------------------+---------------------------------------------
 Oops, in the function  {{{def __getitem__(self, key)}}} in matrix0.pyx,
 the variable {{{ind}}} is of type int.

 This will work fine on 32-bit, but will be totally broken/buggy in subtle
 and surprising ways on 64-bit machines.  The type of ind should be
 {{{Py_ssize_t}}}, just like the type of {{{i}}}.  Nobody will notice this
 now, because there is some sort of massive weird inefficiency in the
 creation of sparse matrices (maybe the parent space has its basis
 constructed or something idiotic like that), which makes it impossible to
 make a large sparse matrix, even though this should be trivial, instant,
 fast, and take no memory:
 {{{
 sage: time a = matrix(QQ, 2^25, sparse=True)
 Time: CPU 5.88 s, Wall: 8.46 s
 sage: get_memory_usage()   # what ?
 3908.29296875
 }}}

 The ind being an int was introduced in #4973.

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