13.07.2015 Views

Intel(R) - Computational and Systems Biology at MIT

Intel(R) - Computational and Systems Biology at MIT

Intel(R) - Computational and Systems Biology at MIT

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Language-specific Usage Options 7NOTE. The complex value comes back expressly in this case.The following example illustr<strong>at</strong>es a call from a C program to the complex BLAS Level 1function zdotc(). This function computes the dot product of two double-precision complexvectors.In this example, the complex dot product is returned in the structure c.Example 7-1 Calling a complex BLAS Level 1 function from C#include "mkl.h"#define N 5void main(){int n, inca = 1, incb = 1, i;typedef struct{ double re; double im; } complex16;complex16 a[N], b[N], c;void zdotc();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-7

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!