Skip to content

Commit fe843f9

Browse files
authored
Merge pull request #989 from angsch/bdsqr
Two small fixes of bdsqr
2 parents c6bc401 + 230b8c4 commit fe843f9

File tree

4 files changed

+28
-3
lines changed

4 files changed

+28
-3
lines changed

SRC/cbdsqr.f

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
*>
167167
*> \param[out] RWORK
168168
*> \verbatim
169-
*> RWORK is REAL array, dimension (4*N)
169+
*> RWORK is REAL array, dimension (4*(N-1))
170170
*> \endverbatim
171171
*>
172172
*> \param[out] INFO
@@ -809,6 +809,12 @@ SUBROUTINE CBDSQR( UPLO, N, NCVT, NRU, NCC, D, E, VT, LDVT, U,
809809
*
810810
160 CONTINUE
811811
DO 170 I = 1, N
812+
IF( D( I ).EQ.ZERO ) THEN
813+
*
814+
* Avoid -ZERO
815+
*
816+
D( I ) = ZERO
817+
END IF
812818
IF( D( I ).LT.ZERO ) THEN
813819
D( I ) = -D( I )
814820
*

SRC/dbdsqr.f

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,12 @@ SUBROUTINE DBDSQR( UPLO, N, NCVT, NRU, NCC, D, E, VT, LDVT, U,
817817
*
818818
160 CONTINUE
819819
DO 170 I = 1, N
820+
IF( D( I ).EQ.ZERO ) THEN
821+
*
822+
* Avoid -ZERO
823+
*
824+
D( I ) = ZERO
825+
END IF
820826
IF( D( I ).LT.ZERO ) THEN
821827
D( I ) = -D( I )
822828
*

SRC/sbdsqr.f

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
*>
167167
*> \param[out] WORK
168168
*> \verbatim
169-
*> WORK is REAL array, dimension (4*N)
169+
*> WORK is REAL array, dimension (4*(N-1))
170170
*> \endverbatim
171171
*>
172172
*> \param[out] INFO
@@ -817,7 +817,14 @@ SUBROUTINE SBDSQR( UPLO, N, NCVT, NRU, NCC, D, E, VT, LDVT, U,
817817
*
818818
160 CONTINUE
819819
DO 170 I = 1, N
820+
IF( D( I ).EQ.ZERO ) THEN
821+
*
822+
* Avoid -ZERO
823+
*
824+
D( I ) = ZERO
825+
END IF
820826
IF( D( I ).LT.ZERO ) THEN
827+
821828
D( I ) = -D( I )
822829
*
823830
* Change sign of singular vectors, if desired

SRC/zbdsqr.f

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
*>
167167
*> \param[out] RWORK
168168
*> \verbatim
169-
*> RWORK is DOUBLE PRECISION array, dimension (4*N)
169+
*> RWORK is DOUBLE PRECISION array, dimension (4*(N-1))
170170
*> \endverbatim
171171
*>
172172
*> \param[out] INFO
@@ -807,6 +807,12 @@ SUBROUTINE ZBDSQR( UPLO, N, NCVT, NRU, NCC, D, E, VT, LDVT, U,
807807
*
808808
160 CONTINUE
809809
DO 170 I = 1, N
810+
IF( D( I ).EQ.ZERO ) THEN
811+
*
812+
* Avoid -ZERO
813+
*
814+
D( I ) = ZERO
815+
END IF
810816
IF( D( I ).LT.ZERO ) THEN
811817
D( I ) = -D( I )
812818
*

0 commit comments

Comments
 (0)