[SciPy-dev] Segfault

Nils Wagner nwagner at iam.uni-stuttgart.de
Thu Apr 27 10:57:19 CDT 2006


Travis Oliphant wrote:
> Nils Wagner wrote:
>   
>> Hi all,
>>
>> I am going to visualize the sparsity pattern of large matrices using
>> numpy/scipy/matplotlib.
>> I received a segfault running the following script
>>
>> from pylab import show, plot, axis, xlabel, subplot, title, spy
>> from scipy import *
>>
>> K = io.mmread('k.mtx')
>> M = io.mmread('m.mtx')
>> print 'Reading finished'
>>
>> K = K.todense()
>> spy(K)
>> show()
>>
>>   
>>     
>
> Thanks for the traceback.  It looks like an error was not being caught.  
> This is now fixed in SVN f2py.  Your code should now raise an error that 
> is occurring in trying to convert an object to an array in mmread...
>
> -Travis
>   
Reading finished
Traceback (most recent call last):
  File "matrixstructure.py", line 8, in ?
    K = K.todense()
  File "/usr/lib64/python2.4/site-packages/scipy/sparse/sparse.py", line
356, in todense
    return asmatrix(self.toarray())
  File "/usr/lib64/python2.4/site-packages/scipy/sparse/sparse.py", line
360, in toarray
    return csc.toarray()
  File "/usr/lib64/python2.4/site-packages/scipy/sparse/sparse.py", line
969, in toarray
    return func(self.shape[0], self.data, self.rowind, self.indptr)
MemoryError

Nils

> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-dev
>   
 




More information about the Scipy-dev mailing list