|
From: <co...@ph...> - 2006-02-17 07:38:38
|
Tim Hochberg <tim...@co...> writes: > Gary Ruben wrote: > So, optimize: > > A**-1, A**0, A**1, A**2, etc. > >> >> and >> >> A**array([1,2,3]) >> >> but not >> >> A**array[1.0, 2.0, 3.0], A**2.0, A**(2.0+0j) > > > That makes sense. It's safer and easier to explain: "numpy optimizes > raising matrices (and possibly scalars) to integer powers)". The only > sticking point that I see is if David is still interested in > optimizing A**0.5, that's not going to mesh with this. On the other > hand, perhaps he can be persuaded that sqrt(A) is just as good. After > all, it's only one more character long ;) sigh, ok :-) -- |>|\/|< /--------------------------------------------------------------------------\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |co...@ph... |