The LAPACK forum has moved to https://github.com/Reference-LAPACK/lapack/discussions.

Argument of ZGEQRF -> what is COMPLEX*16 ?

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

Argument of ZGEQRF -> what is COMPLEX*16 ?

Postby Mat » Wed Jul 25, 2007 4:44 pm

Hello,

i don't know how to use methods which handle with complex input. For example the complex QR factorization ZGEQRF.

In the function documentation the usage is described:
A (input/output) COMPLEX*16 array, dimension (LDA,N)

But what is an COMPLEX*16 array?

For complex values there is the real and complex part of a number. What input is expected. I think i cannot create any array with a self-defined structure as data element for the array. Or how has the array to be defined?

Thanks for any help
Mat
 
Posts: 47
Joined: Sat Aug 19, 2006 9:54 am

Postby Julie » Wed Jul 25, 2007 4:59 pm

Mat,
DOUBLE COMPLEX or COMPLEX*16 is a Fortran "double complex" data type, two 64-bit floating point doubles;
COMPLEX is a Fortran "complex" data type, two 32-bit floating point reals

The difference between these two is the precision. They both are regular complex number with a real and a imaginary part.

To declare your double complex array, do a simple:
Code: Select all
COMPLEX*16 MYARRAY(LDA,N)

Hope it helps
Julie
Julie
 
Posts: 299
Joined: Wed Feb 23, 2005 12:32 am
Location: ICL, Denver. Colorado

Postby Mat » Wed Jul 25, 2007 5:01 pm

Thanks Julie,

sorry for my lack of knowledge.
I'm using lapack with C/C++ so ....is it possible that i have to use a structure of real and image part of a number for input?

Further help would be very nice :wink:
Mat
 
Posts: 47
Joined: Sat Aug 19, 2006 9:54 am

Postby Julie » Thu Jul 26, 2007 9:41 am

Mat,

Complex is not defined in C.
But ISO C99 introduces support for complex numbers in C. This is done with a new type qualifier, complex. It is a keyword if and only if `complex.h' has been included. There are three complex types, corresponding to the three real types: float complex, double complex, and long double complex.

Julie
Julie
 
Posts: 299
Joined: Wed Feb 23, 2005 12:32 am
Location: ICL, Denver. Colorado

Postby Mat » Thu Jul 26, 2007 10:11 am

Thanks a lot....

i found this page:
http://docs.sun.com/app/docs/doc/802-29 ... 7t8?a=view

Isn't it possible to pass to do something like this:

struct complex{double r, double i;}

complex *arr = new complex[5];

//fill arr...

_zgeqrf(m, n, arr,....);
Mat
 
Posts: 47
Joined: Sat Aug 19, 2006 9:54 am

Postby Julie » Thu Jul 26, 2007 10:14 am

Yes sure, no problem
Julie
Julie
 
Posts: 299
Joined: Wed Feb 23, 2005 12:32 am
Location: ICL, Denver. Colorado


Return to User Discussion

Who is online

Users browsing this forum: No registered users and 4 guests