The subroutine DSYCONV stores the supdiagonal of the symmetric 1-by-1 or 2-by-2
authorlangou <langou@users.noreply.github.com>
Thu, 29 Oct 2015 04:58:50 +0000 (04:58 +0000)
committerlangou <langou@users.noreply.github.com>
Thu, 29 Oct 2015 04:58:50 +0000 (04:58 +0000)
block matrix in the array WORK. (Or the subdiagonal, same array.) Before
commit, only the nonzero elements of WORK were initialized to their correct
nonzero values. The zero entries were not initialized and not referenced and
assumed to be zero in subsequent subroutines. This is fine, but I think a
better behavior for the subroutine is to initialize these zero entries to zero.
So the commit is initializing these entries to zero.

Also a (double precision) ZERO in the D routine should have been an (integer)
0.

Also fix some formatting to have C, D, and S consistent.

Note: the indentations, comments of the Z routine is not consistent with C, D and
S. I did not have time to fix this.

SRC/csyconv.f
SRC/dsyconv.f
SRC/ssyconv.f
SRC/zsyconv.f

index 22f172c..e762d8b 100644 (file)
             DO WHILE ( I .GT. 1 )
                IF( IPIV(I) .LT. 0 ) THEN
                   WORK(I)=A(I-1,I)
+                  WORK(I-1)=ZERO
                   A(I-1,I)=ZERO
                   I=I-1
                ELSE
             DO WHILE ( I .LE. N )
                IF( I.LT.N .AND. IPIV(I) .LT. 0 ) THEN
                   WORK(I)=A(I+1,I)
+                  WORK(I+1)=ZERO
                   A(I+1,I)=ZERO
                   I=I+1
                ELSE
                ENDIF
             ELSE
               IP=-IPIV(I)
-              IF ( I .GT. 1 ) THEN
+              IF (I .GT. 1) THEN
               DO 23 J= 1,I-1
                  TEMP=A(IP,J)
                  A(IP,J)=A(I+1,J)
index 9df1ad3..ee2de15 100644 (file)
             DO WHILE ( I .GT. 1 )
                IF( IPIV(I) .LT. 0 ) THEN
                   WORK(I)=A(I-1,I)
+                  WORK(I-1)=ZERO
                   A(I-1,I)=ZERO
                   I=I-1
                ELSE
             DO WHILE ( I .LE. N )
                IF( I.LT.N .AND. IPIV(I) .LT. 0 ) THEN
                   WORK(I)=A(I+1,I)
+                  WORK(I+1)=ZERO
                   A(I+1,I)=ZERO
                   I=I+1
                ELSE
 *
             I=1
             DO WHILE ( I .LE. N-1 )
-               IF( IPIV(I) .LT. ZERO ) THEN
+               IF( IPIV(I) .LT. 0 ) THEN
                   A(I+1,I)=WORK(I)
                   I=I+1
                ENDIF
index ecb2d66..a77cfa8 100644 (file)
             DO WHILE ( I .GT. 1 )
                IF( IPIV(I) .LT. 0 ) THEN
                   WORK(I)=A(I-1,I)
+                  WORK(I-1)=ZERO
                   A(I-1,I)=ZERO
                   I=I-1
                ELSE
             DO WHILE ( I .LE. N )
                IF( I.LT.N .AND. IPIV(I) .LT. 0 ) THEN
                   WORK(I)=A(I+1,I)
+                  WORK(I+1)=ZERO
                   A(I+1,I)=ZERO
                   I=I+1
                ELSE
index 44ff53e..57e94ac 100644 (file)
             DO WHILE ( I .GT. 1 )
                IF( IPIV(I) .LT. 0 ) THEN
                   WORK(I)=A(I-1,I)
+                  WORK(I-1)=ZERO
                   A(I-1,I)=ZERO
                   I=I-1
                ELSE
             DO WHILE ( I .LE. N )
                IF( I.LT.N .AND. IPIV(I) .LT. 0 ) THEN
                   WORK(I)=A(I+1,I)
+                  WORK(I+1)=ZERO
                   A(I+1,I)=ZERO
                   I=I+1
                ELSE