Skip to content

*evr, *stevr: use fast CSTEMR path for partial eigenvalue ranges on I…#1295

Merged
langou merged 1 commit into
Reference-LAPACK:masterfrom
jschueller:issue1277
Jul 13, 2026
Merged

*evr, *stevr: use fast CSTEMR path for partial eigenvalue ranges on I…#1295
langou merged 1 commit into
Reference-LAPACK:masterfrom
jschueller:issue1277

Conversation

@jschueller

Copy link
Copy Markdown
Collaborator

…EEE machines

The *evr and *stevr routines now call CSTEMR/DSTEMR/SSTEMR with the user-specified RANGE argument on IEEE-754 compliant machines, instead of only using the fast path when the full spectrum is requested (ALLEIG or IL=1, IU=N). Partial eigenvalue ranges with eigenvectors now also benefit from the faster algorithm.

Fix a bug where WANTZ=.FALSE. with a partial range on IEEE machines would incorrectly set M=N and skip the DSTEBZ fallback, because INFO remained 0 from initialization when SSTERF was skipped (it can only compute all eigenvalues). The IF(INFO.EQ.0) success check is now moved inside each computational branch so it only triggers when SSTERF or CSTEMR was actually called and succeeded.

Closes #1277

@jschueller jschueller force-pushed the issue1277 branch 2 times, most recently from c1d527c to cb488f6 Compare June 13, 2026 10:27
…EEE machines

The *evr and *stevr routines now call CSTEMR/DSTEMR/SSTEMR with the
user-specified RANGE argument on IEEE-754 compliant machines, instead of
only using the fast path when the full spectrum is requested
(ALLEIG or IL=1, IU=N). Partial eigenvalue ranges with eigenvectors
now also benefit from the faster algorithm.

Fix a bug where WANTZ=.FALSE. with a partial range on IEEE machines
would incorrectly set M=N and skip the DSTEBZ fallback, because INFO
remained 0 from initialization when SSTERF was skipped (it can only
compute all eigenvalues). The IF(INFO.EQ.0) success check is now
moved inside each computational branch so it only triggers when
SSTERF or CSTEMR was actually called and succeeded.

Closes Reference-LAPACK#1277
@langou

langou commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Thanks @jschueller. Long overdue.

This is not a criticism of this PR since this PR is going in the right direction, but, personally, I do not like the fact that HEEVR calls STERF when

IF( ALLEIG .OR. ( INDEIG .AND. IL.EQ.1 .AND. IU.EQ.N ) )

I think HEEVR should always call STEMR, no matter what.

If users want to use STERF in the case

IF( .NOT.WANTZ ) THEN
   IF( ALLEIG .OR. ( INDEIG .AND. IL.EQ.1 .AND. IU.EQ.N ) ) THEN

then they can call HEEV directly.

The way we do it now makes it hard for user to use STERF with

IF( ALLEIG .OR. ( INDEIG .AND. IL.EQ.1 .AND. IU.EQ.N ) )

This can useful for example if a user wants bit-by-bit eigenvalue reproducibility whether WANTZ or not.

@langou langou merged commit 05a6d9f into Reference-LAPACK:master Jul 13, 2026
12 checks passed
@jschueller jschueller deleted the issue1277 branch July 13, 2026 09:45
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.

DSYEVR should call DSTEMR for RANGE="V" or "I"

2 participants