I'm just learning to use C++, so this question migth be very basic.
I need to usesome LAPACKfunction so solve a LLS problem. As it is the simplest I tried with zgels. The main problem is that I don't know how to define matrices with complex16. The only examples I could find are the ones in:
http://developer.intel.com/support/performancetools/libraries/mkl/30484.htm#4
But they doesn't work! I used to work with complex, using the standard complex library. Is there any way I could still use this? I think I just need a simple example to understand how MKL works. As I said the examples I found doesn't work for me. I put the example I'm trying (in this case just to work with complex, with doubleI made itwork):
//Example 2: Calling a Complex BLAS Level 1 Function from C++
#include
#include
typedef struct{ double re; double im; } complex16;
extern "C" void zdotc (complex16*, int *, complex16 *, int *, complex16 *, int *);
#define N 5
void main()
{
int n, inca = 1, incb = 1, i;
complex16 a[N], b[N], c;
n = N;
for( i = 0; i < n; i++ ){
a[i].re = (double)i; a[i].im = (double)i * 2.0;
b[i].re = (double)(n - i); b[i].im = (double)i * 2.0;
}
zdotc(&c, &n, a, &inca, b, &incb );
printf( "The complex dot product is: ( %6.2f, %6.2f)
", c.re, c.im );
}
ERROR MESSAGE:
c:Documents and SettingsAdministratorMy DocumentsVisual Studio ProjectsIntel MKL testsExample2.cpp(7): error C2733: second C linkage of overloaded function 'zdotc' not allowed
If I comment the line of the linkage (It made the example to work with double) I get the following erro message:
c:Documents and SettingsAdministratorMy DocumentsVisual Studio ProjectsIntel MKL testsExample2.cpp(22): error C2664: 'zdotc' : cannot convert parameter 1 from 'complex16 *' to 'MKL_Complex16 *'
Could you please give me an example that work so I can analyze it and learn how
to use MKL with complex numbers? And just in case how to define a complex matix?
Sorry to post such a basic question, but I'm trying to learn by my own and, as most of you migth know, sometimes we need some help like this.
Thank you again,
Leandro.

