Skip to content

LAPACK: Fix documentation error and ordering bug in DLASD7 #5344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions lapack-netlib/SRC/dlasd7.f
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
*> On entry D contains the singular values of the two submatrices
*> to be combined. On exit D contains the trailing (N-K) updated
*> singular values (those which were deflated) sorted into
*> increasing order.
*> decreasing order.
*> \endverbatim
*>
*> \param[out] Z
Expand Down Expand Up @@ -454,7 +454,7 @@ SUBROUTINE DLASD7( ICOMPQ, NL, NR, SQRE, K, D, Z, ZW, VF, VFW, VL,
*
* Check if singular values are close enough to allow deflation.
*
IF( ABS( D( J )-D( JPREV ) ).LE.TOL ) THEN
IF( ( D( J )-D( JPREV ) ).LE.TOL ) THEN
*
* Deflation is possible.
*
Expand Down Expand Up @@ -490,7 +490,14 @@ SUBROUTINE DLASD7( ICOMPQ, NL, NR, SQRE, K, D, Z, ZW, VF, VFW, VL,
CALL DROT( 1, VF( JPREV ), 1, VF( J ), 1, C, S )
CALL DROT( 1, VL( JPREV ), 1, VL( J ), 1, C, S )
K2 = K2 - 1
IDXP( K2 ) = JPREV
*
* Insert the deflated index in the correct position in IDXP.
* If J - JPREV is greater than 1, the indices in between
* must be shifted to preserve the correct output order.
*
DO 130 JP = JPREV, J - 1
IDXP( K2 + J - 1 - JP ) = JP
130 CONTINUE
JPREV = J
ELSE
K = K + 1
Expand Down
Loading