Hello again, On 9/12/06, Francesc Altet <[EMAIL PROTECTED]> wrote: > Hello Pierre, > [...] > > Well, in some way, there is a temporary array creation that is > immediately bound to B, so in the end, the temporary is not so > temporary, but a new (bounded) object. Obviously, the object that was > referencing B is freed (unless there is another reference to it).
ok, I guess I was aware of all that. My worries are related to two cases: 1) When the mere creation of a new array is prohibitive. 2) When what I really want to change is the _content_ of an array. Using assignment (=) disconnects B from the array it refers to, so that what used to be true (C=B) is not anymore. I understant that B[:] = ... solves the problem 2), though I don't know if this notation is recommended; but I would like to know if there is anyway to solve 1), in the way ufuncs can do. I had fun using kde's "performance monitor" (ksysguard) to see the difference between a = numpy.random.rand(2048,2048) + 1j * numpy.random.rand(2048,2048) a = numpy.exp(a) and a = numpy.random.rand(2048,2048) + 1j * numpy.random.rand(2048,2048) numpy.exp(a,out=a) Not only is the latter faster, but I could see a large glitch in the memory usage for the former. Pierre -- Pierre Thibault 616 Clark Hall, Cornell University (607) 255-5522 ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Numpy-discussion mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/numpy-discussion
