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

WORK(1) bug in ZHBGVD?

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

WORK(1) bug in ZHBGVD?

Postby mickpont » Tue Aug 28, 2007 7:36 am

I think there is a bug in the value of WORK(1) returned by ZHBGVD
when N = 1. In the LAPACK 3.1.1 version of the routine, WORK(1)
is always set to 1 when N = 1. However, if WANTZ = .TRUE. (i.e.
when JOBZ = 'V'), an extra element of workspace is needed
for use by the later calls of ZSTEDC, ZGEMM and ZLACPY.

I suggest that instead of

INFO = 0
IF( N.LE.1 ) THEN
LWMIN = 1
LRWMIN = 1
LIWMIN = 1
ELSE IF( WANTZ ) THEN
LWMIN = 2*N**2
LRWMIN = 1 + 5*N + 2*N**2
LIWMIN = 3 + 5*N
ELSE
LWMIN = N
LRWMIN = N
LIWMIN = 1
END IF

the code should read something like this:

INFO = 0
IF( WANTZ ) THEN
LWMIN = MAX( 1, 2*N**2 )
LRWMIN = MAX( 1, 1 + 5*N + 2*N**2 )
IF ( N.LE.1 ) THEN
LIWMIN = 1
ELSE
LIWMIN = 3 + 5*N
END IF
ELSE
LWMIN = MAX( 1, N )
LRWMIN = MAX( 1, N )
LIWMIN = 1
END IF


Similar problems may apply to CHBGVD, SSBGVD and DSBGVD.

Mick Pont
mickpont
 
Posts: 6
Joined: Wed Jul 18, 2007 4:31 am
Location: Oxford, UK

Return to User Discussion

Who is online

Users browsing this forum: No registered users and 4 guests