NCAR / nclcomp

0 stars 0 forks source link

dgeevx_lapack: SENSE option doesn't seem to be having an effect [NCL-2565] #1

Open khallock opened 5 years ago

khallock commented 5 years ago

The argument I am confused by is called "sense". The Fortran description reads as follows:

SENSE (input) CHARACTER*1

The other arguments produce reasonable results and, most importantly, change the output in a way I can follow. Changing the 5th or sense argument doesn't seem o have any effect.


I am running NCL version 6.3.0 on a Linux (Ubuntu) machine with a bash shell. I am trying to use the dgeevx_lapack function for the first time. The documentation includes an option to calculate reciprocal condition numbers. Enabling that option will not lead to any error messages, but I also can't find the result of that calculation. Running the command in the following three versions:

evl = dgeevx_lapack(M,"N","V","V","N",False)

evl = dgeevx_lapack(M,"N","V","V","E",False)

evl = dgeevx_lapack(M,"N","V","V","B",False)

for any given matrix M results in variables evl that contain the same number of values and are seemingly identical otherwise, too. 20 Feb 2017:

How can I access the reciprocal condition numbers? Is there another ncl function I should use?

khallock commented 5 years ago

The following variables (in $NCLSRC/external/lapack/dgeevx.f) do not seem to be making back to NCL:

ILO,IHI (output) INTEGER
ILO and IHI are integer values determined when A was
balanced. The balanced A(i,j) = 0 if I > J and
J = 1,...,ILO-1 or I = IHI+1,...,N.
*
SCALE (output) DOUBLE PRECISION array, dimension (N)
Details of the permutations and scaling factors applied
when balancing A. If P(j) is the index of the row and column
interchanged with row and column j, and D(j) is the scaling
factor applied to row and column j, then
SCALE(J) = P(J), for J = 1,...,ILO-1
= D(J), for J = ILO,...,IHI
= P(J) for J = IHI+1,...,N.
The order in which the interchanges are made is N to IHI+1,
then 1 to ILO-1.
*
ABNRM (output) DOUBLE PRECISION
The one-norm of the balanced matrix (the maximum
of the sum of absolute values of elements of any column).
*
RCONDE (output) DOUBLE PRECISION array, dimension (N)
RCONDE(j) is the reciprocal condition number of the j-th
eigenvalue.
*
RCONDV (output) DOUBLE PRECISION array, dimension (N)
RCONDV(j) is the reciprocal condition number of the j-th
right eigenvector.
khallock commented 5 years ago

In dgeevxW.c, scalem, rconde, and rcondv are all allocated, passed to DGEEVX(), and then freed without being assigned to anything else.