|
From: Travis O. <oli...@ee...> - 2005-10-12 19:09:49
|
Chris Barker wrote: > Arnd, > > You've written some nice compact code, but it only works for rank-2 > arrays. Did you see Travis' solution? I think he's put it (or a C > version, I'm not sure about that) in scipy_base. However, not using > flat is nice, as in Numeric and numarray is sometimes makes a copy, > and sometimes doesn't. Yes, for Numeric and numarray a.flat does that. But, for scipy core, a.flat never makes a copy. It just returns an iterator object (that can be indexed and has an .__array__() method). So using a.flat is not a problem. Right now the solution I have is in Python. -Travis |