dstedc, sstedc: remove dead ICOMPZ.EQ.0 branch#1302
Conversation
64cb436 to
5f5b997
Compare
The IF( ICOMPZ.EQ.0 ) block calling DLASRT/SLASRT quick sort after the endwhile loop is unreachable -- ICOMPZ.EQ.0 already exits via CALL DSTERF/CALL SSTERF + GO TO 50 earlier. Remove the dead branch and its external declaration, keeping only the selection sort path. Closes Reference-LAPACK#1143
|
Argh. I do not like it. Yes, this fixes a dead branch for the current code. But the current code reads Lines 297 to 312 in 693f114 And so the idea is that someone could comment out IF( ICOMPZ.EQ.0 ) THEN
CALL DSTERF( N, D, E, INFO )
GO TO 50
END IFso as to use the divide and conquer symmetric tridiagonal eigensolver to compute the eigenvalue only of the matrix instead of QR/QL symmetric tridiagonal eigensolver (STERF). Why would someone want to do this? (1) maybe D&C is faster than STERF for eigenvalue only, (2) maybe the user wants to get the bit-by-bit same eigenvalue when calling STEDC with Related, note the recent work of Ruiyi Zhan and Shaoshuai Zhan on accelerating D&C when only eigenvalues are desired: https://arxiv.org/abs/2605.26599 I'd almost advocate to comment out IF( ICOMPZ.EQ.0 ) THEN
CALL DSTERF( N, D, E, INFO )
GO TO 50
END IFand have D&C stay true to D&C. Even if it is slower for eigenvalue computation, that's what it is. I want to say to STEDC "Be yourself! Be proud of you are! Do not try to be a QR algorithm". Note: It'd be interesting to see if this passes the test suite since D&C for eigenvalue only is not really tested currently. All in all, I do not support this PR. |
The IF( ICOMPZ.EQ.0 ) block calling DLASRT/SLASRT quick sort after the endwhile loop is unreachable -- ICOMPZ.EQ.0 already exits via CALL DSTERF/CALL SSTERF + GO TO 50 earlier. Remove the dead branch and its external declaration, keeping only the selection sort path.
Closes #1143