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

ZGETRI error

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

Re: ZGETRI error

Postby sven » Mon Sep 15, 2008 5:56 am

Please read the documentation for ZGETRI which can be found in the LAPACK Users' Guide, or as the leading comment to the source code.

Firstly, ZGETRI has to be preceded by a call to ZGETRF in order to perform an LU factorization of the matrix A. Secondly, when you call ZGETRI with LWORK = -1, that is a workspace query - the routine simply computes the optimal size of the array WORK, which is returned in WORK(1).

Sven Hammarling.
sven
 
Posts: 146
Joined: Wed Dec 22, 2004 4:28 am

Re: ZGETRI error

Postby sven » Tue Sep 16, 2008 5:26 am

On your second question as to "Why the decimal point error in the output of A?", that is because 0.8 is not exactly representable as a binary floating point value. By the way, a statement such as

A(1,2)=cmplx(1.0d0,0.8d0)

stores the value in single precision, even though A is declared as DOUBLE COMPLEX. If you want to store the value as double precision you need to include the optional argument 'kind' to 'cmplx'; for example

A(1,2)=cmplx(1.0d0,0.8d0,kind(1.0d0))

Sven.
sven
 
Posts: 146
Joined: Wed Dec 22, 2004 4:28 am


Return to User Discussion

Who is online

Users browsing this forum: No registered users and 7 guests