## Workspace in dsbgvd, zhbgvd

Post here if you want to report a bug to the LAPACK team

### Workspace in dsbgvd, zhbgvd

1. In dsbgvd.f (ssbgvd.f)

with the case WANTZ = .False.
LWMIN = 2*N (line 282)

But, (line 140)

Call dsbgst(.....,work(INDWRK), iinfo)

where INDWRK = N+1 and dsbgst requires a workspace of 2*N

Therefore either
i. line 282 should be LWMIN = 3*N; or,
ii. line 140 should use WORK(INDE)

2. In zhbgvd.f (chbgvd.f)
Line 312: LRWMIN = N
Line 374: Call ZHBGST(....,RWORK(INDWRK), IINFO)
INDWRK = N+1 and ZHBGST requires RWORK(N)

Therefore either
i. line 312 should be LWMIN = 2*N; or,
ii. line 374 should use RWORK(INDE)
lawrence mulholland

Posts: 25
Joined: Mon Jun 11, 2012 6:33 am
Location: NAG Ltd, Oxford, UK

### Re: Workspace in dsbgvd, zhbgvd

Hi Lawrence,

Thanks for the bug reports.

1. In dsbgvd.f (ssbgvd.f)

with the case WANTZ = .False.
LWMIN = 2*N (line 282)

But, (line 140) (correction: line 340)

Call dsbgst(.....,work(INDWRK), iinfo)

where INDWRK = N+1 and dsbgst requires a workspace of 2*N

Therefore either
i. line 282 should be LWMIN = 3*N; or,
ii. line 140 should use WORK(INDE)
(correction: line 340)

Let us go with fix (ii) then.
Note: I simply used "WORK", not "WORK(INDE)"

2. In zhbgvd.f (chbgvd.f)
Line 312: LRWMIN = N
Line 374: Call ZHBGST(....,RWORK(INDWRK), IINFO)
INDWRK = N+1 and ZHBGST requires RWORK(N)

Therefore either
i. line 312 should be LWMIN = 2*N; or,
ii. line 374 should use RWORK(INDE)

Let us go with fix (ii) then.
Note: I simply used "RWORK", not "RWORK(INDE)".

Thanks a lot Lawrence!
Julien.
Julien Langou

Posts: 828
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA