Skip to content

Misc fixes#1284

Open
jschueller wants to merge 10 commits into
Reference-LAPACK:masterfrom
jschueller:cblas
Open

Misc fixes#1284
jschueller wants to merge 10 commits into
Reference-LAPACK:masterfrom
jschueller:cblas

Conversation

@jschueller

@jschueller jschueller commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

random bugfixes:

@martin-frbg

Copy link
Copy Markdown
Collaborator

Isn't #1047 already handled by PR #1264 , whose author pinged it just days ago ? Similarly, I have #1251 already open to fix #1183
And I think a mixed bag of unrelated fixes is a bad idea for other reasons as well - makes it harder to revert a single change, should that ever become necessary, and obscures the link between individual issue and fix in the git history

When JOBU='N' or JOBVT='N', the U and VT matrices are not referenced,
so the leading dimension checks should be skipped.  Previously the
code rejected ldvt=0 (and ldu=0) even when those matrices were not
used, causing a spurious INFO=12 error on row-major calls with
JOBVT='N' (or INFO=10 for JOBU='N').

Fixes Reference-LAPACK#1090
@jschueller

jschueller commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

my bad, lets drop those
fixes are in separate commits (referencing the respective issues) so it can still be reverted individually

@jschueller jschueller force-pushed the cblas branch 3 times, most recently from 8a0342c to 1a695c2 Compare June 10, 2026 14:07
Per LAPACK docs, in [cz]tgexc, ilst is [in,out]. The LAPACKE C
interface was passing both ifst and ilst by value as input-only
scalars, so callers could never observe the updated ilst value.

Change both ifst and ilst to lapack_int* pointers in the complex
tgexc variants to match the real-precision stgexc/dtgexc interface
and the underlying Fortran semantics.

Fixes Reference-LAPACK#771
Two comments in the DGEHRD/DHSEQR test incorrectly say "Compute
Schur form":
- The DGEHRD call reduces to upper Hessenberg form, not Schur.
- The DHSEQR call computes eigenvalues and the Schur form, so
  use a more descriptive label.

Fixes Reference-LAPACK#587
When DFLAG=0 and both DD1 and DD2 need rescaling, the first
scaling loop transitions DFLAG from 0 to -1 and correctly
scales DH11 and DH12. But the second scaling loop then hits
the ELSE branch (matching DFLAG=-1) which unconditionally
resets DH21=-1 and DH12=1, overwriting the scaled DH12.

Change ELSE to ELSE IF (DFLAG.EQ.ONE) so the implied-element
initialization (DH21=-1, DH12=1) only fires when DFLAG=1,
not when DFLAG=-1 (where all elements are already explicit).

Fixes Reference-LAPACK#244
When ?HSEQR encounters non-finite input, it can return a negative
INFO. The undo-scaling block at label 50 then computes N-INFO (which
exceeds N) and indexes WR( INFO+1 ) (out of bounds), causing memory
corruption through ?LASCL.

Add INFO.GE.0 to the outer IF( SCALEA ) guard so the undo-scaling
block is skipped entirely when INFO is negative. The inner
IF( INFO.GT.0 ) guard only covered the second pair of ?LASCL calls.

Fixes Reference-LAPACK#1128
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants