Calculate CUNMLQ LWORK consistently when K=0#1225
Open
ndingle-arm wants to merge 1 commit intoReference-LAPACK:masterfrom
Open
Calculate CUNMLQ LWORK consistently when K=0#1225ndingle-arm wants to merge 1 commit intoReference-LAPACK:masterfrom
ndingle-arm wants to merge 1 commit intoReference-LAPACK:masterfrom
Conversation
CUNMLQ's documentation says LWORK must be:
If SIDE = 'L', LWORK >= max(1,N);
if SIDE = 'R', LWORK >= max(1,M).
In the current implementation, however, when K=0 a workspace query
will return LWORK=1 in WORK(1). This means a subsequent call to CUNMLQ
with a workspace of that size will fail with INFO = -12.
The other ???MLQ routines return consistent values of LWORK when K=0
(that is, equal to or greater than NW) so this patch makes CUNMLQ's
behaviour match theirs.
Collaborator
|
Assuming that the caller then goes ahead and allocates a large work array as told, wouldn't a more efficient alternative be to amend the LWORK size test in CUNMLQ with a special case for K=0 ? (Or simply |
Contributor
Author
|
I was unsure why CUNMLQ handles workspace queries differently from ZUNMLQ and DORMLQ/SORMLQ when K=0. Those subroutines do not have the condition:
so behave in accordance with the API specifications in their documentation (that is, they return a value of LWORK >= MAX(1,M) or MAX(1,N) regardless of the value of K). Is there a need for CUNMLQ to have this special behaviour when K=0? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
CUNMLQ's documentation says LWORK must be:
In the current implementation, however, when K=0 a workspace query will return LWORK=1 in WORK(1). This means a subsequent call to CUNMLQ with a workspace of that size will fail with INFO = -12.
The other ???MLQ routines return consistent values of LWORK when K=0 (that is, equal to or greater than NW) so this patch makes CUNMLQ's behaviour match theirs.
Checklist