[SciPy-User] scipy.linalg.solve()'s overwrite option does not work
Sat Nov 6 12:13:38 CDT 2010
> On 2010-11-05, at 9:21 PM, braingateway wrote:
>> Hi everyone,
>> I believe the overwrite option is used for reduce memory usage. But I
>> did following test, and find out it does not work at all. Maybe I
>> misunderstood the purpose of overwrite option. If anybody could explain
>> this, I shall highly appreciate your help.
> First of all, this is a SciPy issue, so please don't crosspost to NumPy-discussion.
>>>>> import scipy.linalg as sla
>>>>> a is a0
>>>>> b is b0
> You shouldn't use 'is' to compare arrays unless you mean to compare them by object identity. Use all(b == b0) to compare by value.
Thanks for reply, but I have to say u did not understand my post at all.
I did this 'is' comparison on purpose, because I wanna know if the
overwrite flag is work or not.
See following example:
matrix([[0, 0, 1]])
>>> a0 is a
This means a0 and a is actually point to a same object. Then a0 act
similar to the C pointer of a.
I compared a0/b0 and a/b by 'is' first to show I did create a new object
from the original matrix, so the following (a0==a).all() comparison can
actually prove the values inside the a and b were not overwritten.
> SciPy-User mailing list
More information about the SciPy-User