Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
6590 Discussions

## MKL_Complex16 arrays for mathematical operations problems

Beginner
146 Views

Hello everyone

I am using icc compiler to deal with my mkl_complex16 arrays, i was trying out my mathematical formula that i want to implement on the mic... but i got these errors:

essai.c(136): error: expression must have struct or union type
sum.real= sum.real+w.real*y_in.real[z+1][s+1];
^

essai.c(137): error: expression must have struct or union type
sum.imag= sum.imag+w.imag*y_in.imag[z+1][s+1];
^

Here is my code:

MKL_Complex16 y_in[4][16];

MKL_Complex16 w,sum;
int s,z,y;

int l =20;

for (s=0;s<(l-1);s++)
{
{

{
w.real= y;
w.imag=-y;
sum.real= sum.real+w.real*y_in.real[z+1][s+1];
sum.imag= sum.imag+w.imag*y_in.imag[z+1][s+1];
}
}
}

Any help would be apperciated

Thank you

Employee
146 Views

Hi MooN K.

I try build your code and the error looks be in y_in.real[z+1][s+1].

complex16.cpp(28): error: expression must have class type

sum.real= sum.real+w.real*y_in.real[z+1][s+1];

You can fix the problem as below

sum.real=0;

sum.imag=0;

....

sum.real= sum.real+w.real*y_in[z+1][s+1].real;
sum.imag= sum.imag+w.imag*y_in[z+1][s+1].imag;

Regards,

Ying