fix missing II update in NPROW=1 branch of p?lanhs#159
Merged
Conversation
In the NPROW=1 path of PCLANHS/PDLANHS/PSLANHS/PZLANHS, II was not incremented by JB after processing the first (alignment) block of columns. As a result, the row bound MIN(II+LL-JJ+1, IIA+NP-1) used inside the subsequent column-block loop tracked the Hessenberg diagonal at the wrong row, causing upper-triangle entries past the first block to be skipped and the computed norm to be incorrect. Add II = II + JB after the first-block END IF in each of the four norm branches (M, 1, I, F), matching the equivalent update already present in the NPROW>1 branch.
langou
approved these changes
Apr 29, 2026
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.
In the
NPROW=1path ofPCLANHS/PDLANHS/PSLANHS/PZLANHS,IIwas not incremented byJBafter processing the first block of columns. As a result, the row boundMIN(II+LL-JJ+1, IIA+NP-1)used inside the subsequent column-block loop tracked the Hessenberg diagonal at the wrong row, causing upper-triangle entries past the first block to be skipped and the computed norm to be incorrect.Add II = II + JB after the first-block END IF in each of the four norm branches (M, 1, I, F), matching the equivalent update already present in the NPROW>1 branch.
Repro
NORM=M,N = 8,NB = 4,1×1grid, with99planted atA(6,5)(true||A||_max = 99):min(LL - 3, 8)rows instead ofmin(LL + 1, 8), missing theentry at row 6.