Skip to content

Commit fd0ebf6

Browse files
author
Maarten Baert
committed
Fix documentation error and ordering bug in SLASD7
1 parent 319d40e commit fd0ebf6

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

SRC/slasd7.f

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
*> On entry D contains the singular values of the two submatrices
100100
*> to be combined. On exit D contains the trailing (N-K) updated
101101
*> singular values (those which were deflated) sorted into
102-
*> increasing order.
102+
*> decreasing order.
103103
*> \endverbatim
104104
*>
105105
*> \param[out] Z
@@ -489,7 +489,14 @@ SUBROUTINE SLASD7( ICOMPQ, NL, NR, SQRE, K, D, Z, ZW, VF, VFW,
489489
CALL SROT( 1, VF( JPREV ), 1, VF( J ), 1, C, S )
490490
CALL SROT( 1, VL( JPREV ), 1, VL( J ), 1, C, S )
491491
K2 = K2 - 1
492-
IDXP( K2 ) = JPREV
492+
*
493+
* Insert the deflated index in the correct position in IDXP.
494+
* If J - JPREV is greater than 1, the indices in between
495+
* must be shifted to preserve the correct output order.
496+
*
497+
DO 85 JP = JPREV, J - 1
498+
IDXP( K2 + J - 1 - JP ) = JP
499+
85 CONTINUE
493500
JPREV = J
494501
ELSE
495502
K = K + 1

0 commit comments

Comments
 (0)