Intel(R) - Computational and Systems Biology at MIT
Intel(R) - Computational and Systems Biology at MIT
Intel(R) - Computational and Systems Biology at MIT
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
7 <strong>Intel</strong>® M<strong>at</strong>h Kernel Library User’s GuideExample 7-2Below is the C++ implement<strong>at</strong>ion:Calling a complex BLAS Level 1 function from C++#include "mkl.h"typedef struct{ double re; double im; } complex16;extern "C" void zdotc (complex16*, int *, complex16 *, int *, complex16*, int *);#define N 5void 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)\n", c.re, c.im );}7-8