> On 7 Nov 2019, at 17:31, Eric Barnhill <ericbarnh...@gmail.com> wrote:
> 
> […]
> 
> Well that's interesting, I did not see that the standard specified
> all-vs-all methods in all those cases. There isn't a performance gain for
> multiplying by an imaginary double like there is for a real double,

Not for imaginary against real, but the matrix states there is for imaginary 
against complex:

Multiplying by a real double:

u * (x + iy) = (xu) + i (yu)

Multiplying by an imaginary (no real):

iv * (x + iy) = (-yv) + i (xv)

So the performance gain is the same. One use case is in the previously 
mentioned trigonomic identities where you wish to multiply by I or -I. In this 
case v is 1 or -1 and so the specialisation is:

i * (x + iy) = -y + ix
-i * (x + iy) = y + i-x

I’ve used this specialisation internally but I wonder if it would be useful in 
the API.

Alex


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to