[SciPy-dev] Possibly bug in Sparse.py

Nils Wagner nwagner at mecha.uni-stuttgart.de
Thu Feb 17 11:12:02 EST 2005


Robert Kern wrote:

> Nils Wagner wrote:
>
>> Hi all,
>>
>> I am going to solve large-scale linear systems of equations.
>>
>> The test matrices can be found at
>>
>> http://www.imtek.uni-freiburg.de/simulation/benchmark/?li=30&nr=38886
>>
>>  File "meerbergen.py", line 34, in ?
>>    y, info = linalg.bicgstab(omega[i]*B-A,v)
>>  File "/usr/lib/python2.3/site-packages/scipy/sparse/Sparse.py", line 
>> 441, in __sub__
>>    c,rowc,ptrc,ierr = 
>> func(data1,self.rowind,self.indptr,-data2,other.rowind,other.indptr)
>>  File "/usr/lib/python2.3/site-packages/scipy/sparse/Sparse.py", line 
>> 210, in __getattr__
>>    raise AttributeError, attr + " not found."
>> AttributeError: rowind not found.
>>
>>
>>  >>> A
>> <22692x22692 sparse matrix of type 'D' with 1482390 stored elements 
>> (space for 1482390) in
>>        COOrdinate format>
>>  >>> B
>> <22692x22692 sparse matrix of type 'd' with 1481988 stored elements 
>> (space for 1481988) in
>>        COOrdinate format>
>>  >>> omega[i]
>> (0.049939772810258624+0.0024533837163709009j)
>>  >>>
>>
>> Any suggestion would be appreciated.
>
>
> Well, I'm not familiar with the code, but looking around for a few 
> minutes, it appears that there are indeed bugs in the __sub__ and 
> __rsub__ methods of csc_matrix. The implementation coerces "other" to 
> be a csc_matrix, but then ignores the newly created object.
>
> Fixed in CVS, I think. Travis, could you check to make sure I did the 
> right thing?
>
Yes, but now another error arises

 Traceback (most recent call last):
  File "meerbergen.py", line 35, in ?
    y, info = linalg.gmres(omega[i]*B-A,v)
  File "/usr/lib/python2.3/site-packages/scipy/linalg/iterative.py", 
line 583, in gmres
    work = sb.zeros((6+restrt)*n,typ)
MemoryError: can't allocate memory for array


Do I need more RAM ?  The message

MemoryError: can't allocate memory for array

is not very meaningful (at least in my opinion), since the needed memory 
size is not available.

Any suggestion ?
                                     Nils




More information about the SciPy-Dev mailing list