Skip to content

Commit 4f5e185

Browse files
authored
Merge pull request #697 from weslleyspereira/fix-sorcsd
Fix sorcsd
2 parents 801ac2f + 2ba5e8e commit 4f5e185

File tree

9 files changed

+20
-17
lines changed

9 files changed

+20
-17
lines changed

SRC/cunbdb2.f

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,14 @@
122122
*>
123123
*> \param[out] TAUP1
124124
*> \verbatim
125-
*> TAUP1 is COMPLEX array, dimension (P)
125+
*> TAUP1 is COMPLEX array, dimension (P-1)
126126
*> The scalar factors of the elementary reflectors that define
127127
*> P1.
128128
*> \endverbatim
129129
*>
130130
*> \param[out] TAUP2
131131
*> \verbatim
132-
*> TAUP2 is COMPLEX array, dimension (M-P)
132+
*> TAUP2 is COMPLEX array, dimension (Q)
133133
*> The scalar factors of the elementary reflectors that define
134134
*> P2.
135135
*> \endverbatim

SRC/cunbdb4.f

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@
124124
*>
125125
*> \param[out] TAUP1
126126
*> \verbatim
127-
*> TAUP1 is COMPLEX array, dimension (P)
127+
*> TAUP1 is COMPLEX array, dimension (M-Q)
128128
*> The scalar factors of the elementary reflectors that define
129129
*> P1.
130130
*> \endverbatim
131131
*>
132132
*> \param[out] TAUP2
133133
*> \verbatim
134-
*> TAUP2 is COMPLEX array, dimension (M-P)
134+
*> TAUP2 is COMPLEX array, dimension (M-Q)
135135
*> The scalar factors of the elementary reflectors that define
136136
*> P2.
137137
*> \endverbatim

SRC/dorbdb2.f

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,14 @@
122122
*>
123123
*> \param[out] TAUP1
124124
*> \verbatim
125-
*> TAUP1 is DOUBLE PRECISION array, dimension (P)
125+
*> TAUP1 is DOUBLE PRECISION array, dimension (P-1)
126126
*> The scalar factors of the elementary reflectors that define
127127
*> P1.
128128
*> \endverbatim
129129
*>
130130
*> \param[out] TAUP2
131131
*> \verbatim
132-
*> TAUP2 is DOUBLE PRECISION array, dimension (M-P)
132+
*> TAUP2 is DOUBLE PRECISION array, dimension (Q)
133133
*> The scalar factors of the elementary reflectors that define
134134
*> P2.
135135
*> \endverbatim

SRC/dorbdb4.f

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@
124124
*>
125125
*> \param[out] TAUP1
126126
*> \verbatim
127-
*> TAUP1 is DOUBLE PRECISION array, dimension (P)
127+
*> TAUP1 is DOUBLE PRECISION array, dimension (M-Q)
128128
*> The scalar factors of the elementary reflectors that define
129129
*> P1.
130130
*> \endverbatim
131131
*>
132132
*> \param[out] TAUP2
133133
*> \verbatim
134-
*> TAUP2 is DOUBLE PRECISION array, dimension (M-P)
134+
*> TAUP2 is DOUBLE PRECISION array, dimension (M-Q)
135135
*> The scalar factors of the elementary reflectors that define
136136
*> P2.
137137
*> \endverbatim

SRC/dorcsd2by1.f

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ SUBROUTINE DORCSD2BY1( JOBU1, JOBU2, JOBV1T, M, P, Q, X11, LDX11,
580580
* Simultaneously diagonalize X11 and X21.
581581
*
582582
CALL DBBCSD( JOBV1T, 'N', JOBU1, JOBU2, 'T', M, Q, P, THETA,
583-
$ WORK(IPHI), V1T, LDV1T, DUM2, 1, U1, LDU1, U2,
583+
$ WORK(IPHI), V1T, LDV1T, DUM1, 1, U1, LDU1, U2,
584584
$ LDU2, WORK(IB11D), WORK(IB11E), WORK(IB12D),
585585
$ WORK(IB12E), WORK(IB21D), WORK(IB21E),
586586
$ WORK(IB22D), WORK(IB22E), WORK(IBBCSD), LBBCSD,
@@ -635,7 +635,7 @@ SUBROUTINE DORCSD2BY1( JOBU1, JOBU2, JOBV1T, M, P, Q, X11, LDX11,
635635
* Simultaneously diagonalize X11 and X21.
636636
*
637637
CALL DBBCSD( 'N', JOBV1T, JOBU2, JOBU1, 'T', M, M-Q, M-P,
638-
$ THETA, WORK(IPHI), DUM2, 1, V1T, LDV1T, U2,
638+
$ THETA, WORK(IPHI), DUM1, 1, V1T, LDV1T, U2,
639639
$ LDU2, U1, LDU1, WORK(IB11D), WORK(IB11E),
640640
$ WORK(IB12D), WORK(IB12E), WORK(IB21D),
641641
$ WORK(IB21E), WORK(IB22D), WORK(IB22E),
@@ -706,7 +706,7 @@ SUBROUTINE DORCSD2BY1( JOBU1, JOBU2, JOBV1T, M, P, Q, X11, LDX11,
706706
* Simultaneously diagonalize X11 and X21.
707707
*
708708
CALL DBBCSD( JOBU2, JOBU1, 'N', JOBV1T, 'N', M, M-P, M-Q,
709-
$ THETA, WORK(IPHI), U2, LDU2, U1, LDU1, DUM2,
709+
$ THETA, WORK(IPHI), U2, LDU2, U1, LDU1, DUM1,
710710
$ 1, V1T, LDV1T, WORK(IB11D), WORK(IB11E),
711711
$ WORK(IB12D), WORK(IB12E), WORK(IB21D),
712712
$ WORK(IB21E), WORK(IB22D), WORK(IB22E),

SRC/sorbdb4.f

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
*>
125125
*> \param[out] TAUP1
126126
*> \verbatim
127-
*> TAUP1 is REAL array, dimension (P)
127+
*> TAUP1 is REAL array, dimension (M-Q)
128128
*> The scalar factors of the elementary reflectors that define
129129
*> P1.
130130
*> \endverbatim

SRC/sorcsd2by1.f

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,10 +672,13 @@ SUBROUTINE SORCSD2BY1( JOBU1, JOBU2, JOBV1T, M, P, Q, X11, LDX11,
672672
* Accumulate Householder reflectors
673673
*
674674
IF( WANTU2 .AND. M-P .GT. 0 ) THEN
675-
CALL SCOPY( M-Q, WORK(IORBDB+P), 1, U2, 1 )
675+
CALL SCOPY( M-P, WORK(IORBDB+P), 1, U2, 1 )
676676
END IF
677677
IF( WANTU1 .AND. P .GT. 0 ) THEN
678678
CALL SCOPY( P, WORK(IORBDB), 1, U1, 1 )
679+
DO J = 2, P
680+
U1(1,J) = ZERO
681+
END DO
679682
CALL SLACPY( 'L', P-1, M-Q-1, X11(2,1), LDX11, U1(2,2),
680683
$ LDU1 )
681684
CALL SORGQR( P, P, M-Q, U1, LDU1, WORK(ITAUP1),

SRC/zunbdb2.f

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,14 @@
122122
*>
123123
*> \param[out] TAUP1
124124
*> \verbatim
125-
*> TAUP1 is COMPLEX*16 array, dimension (P)
125+
*> TAUP1 is COMPLEX*16 array, dimension (P-1)
126126
*> The scalar factors of the elementary reflectors that define
127127
*> P1.
128128
*> \endverbatim
129129
*>
130130
*> \param[out] TAUP2
131131
*> \verbatim
132-
*> TAUP2 is COMPLEX*16 array, dimension (M-P)
132+
*> TAUP2 is COMPLEX*16 array, dimension (Q)
133133
*> The scalar factors of the elementary reflectors that define
134134
*> P2.
135135
*> \endverbatim

SRC/zunbdb4.f

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@
124124
*>
125125
*> \param[out] TAUP1
126126
*> \verbatim
127-
*> TAUP1 is COMPLEX*16 array, dimension (P)
127+
*> TAUP1 is COMPLEX*16 array, dimension (M-Q)
128128
*> The scalar factors of the elementary reflectors that define
129129
*> P1.
130130
*> \endverbatim
131131
*>
132132
*> \param[out] TAUP2
133133
*> \verbatim
134-
*> TAUP2 is COMPLEX*16 array, dimension (M-P)
134+
*> TAUP2 is COMPLEX*16 array, dimension (M-Q)
135135
*> The scalar factors of the elementary reflectors that define
136136
*> P2.
137137
*> \endverbatim

0 commit comments

Comments
 (0)