How to use complex number in Blas/CBlas in C

Open discussion regarding features, bugs, issues, vendors, etc.

How to use complex number in Blas/CBlas in C

Postby ncu571633 » Wed Sep 07, 2011 11:15 am

As I know, Blas is written in FORTRAN and in Fortran there is complex type. But for zher2k in C, I have to use complex number as an argument. I found there is a "complex.h" in C99. But I tried it and it doesn't work.
http://en.wikipedia.org/wiki/Complex.h

So I want to use CBlas. There are two functions called cblas_her2k and cblas_syr2k. For the places I use complex number, I have to pass a number as void* type to the function. So how can I use it? Are there any examples for these complex numbers in C?

Many thanks and appreciate.
ncu571633
 
Posts: 2
Joined: Wed Sep 07, 2011 10:53 am

Re: How to use complex number in Blas/CBlas in C

Postby error5772 » Mon Sep 12, 2011 1:06 pm

Hey try this, but no guarantee:

void * vp;

vp = pointer_on_real_part_of_your_data_field;

// Then pass the void-Pointer to the Routine:

cblas_yourroutine(..,vp,...);

// Look into your your Header-File, if its possible (not for ATLAS).
// Good Luck!
error5772
 
Posts: 19
Joined: Thu Sep 01, 2011 5:02 am


Return to User Discussion

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 3 guests