[Numpy-discussion] optimizing power() for complex and real cases
David M. Cooke
cookedm at physics.mcmaster.ca
Thu Feb 16 23:39:02 CST 2006
Tim Hochberg <tim.hochberg at cox.net> 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/
|cookedm at physics.mcmaster.ca
More information about the Numpy-discussion
mailing list