ILNumerics multiply complex with matrix<double>

Posted by nik on Stack Overflow See other posts from Stack Overflow or by nik
Published on 2014-05-31T13:14:14Z Indexed on 2014/05/31 15:27 UTC
Read the original article Hit count: 198

Filed under:
|

I m looking at ILNumerics to translate some matlab code into c#.

How would I multiply a complex and a double?

Simplified description:

In Matlab:

A=[1 2 3] 
i*A*A'

Returns a complex number.

How would I do the same in ILNumerics:

        ILArray<double> A = ILMath.array(1.0, 2.0, 3.0);
        complex B = complex.i * ILMath.multiply(A,A.T);

Throws the error:

Operator '*' cannot be applied to operands of type 'ILNumerics.complex' and 'ILNumerics.ILRetArray<double>' 

Update

This works:

        double C = 14.0;
        complex D = complex.i * C;

But shouldnt: ILMath.multiply(A,A.T)

also return 14.0?

© Stack Overflow or respective owner

Related posts about c#

Related posts about ilnumerics