Skip to content

Commit

Permalink
Merge pull request #961 from ACSimon33/unintialized_variables
Browse files Browse the repository at this point in the history
Fixed usage of uninitialized variables in TESTING
  • Loading branch information
langou authored Jun 21, 2024
2 parents 2d49fb6 + 7113caa commit e60ea22
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 252 deletions.
91 changes: 28 additions & 63 deletions TESTING/LIN/cchkqp3rk.f
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,9 @@ SUBROUTINE CCHKQP3RK( DOTYPE, NM, MVAL, NN, NVAL, NNS, NSVAL,
CALL CLACPY( 'All', M, NRHS, COPYB, LDA,
$ B, LDA )
CALL ICOPY( N, IWORK( 1 ), 1, IWORK( N+1 ), 1 )
DO I = 1, NTESTS
RESULT( I ) = ZERO
END DO
*
ABSTOL = -1.0
RELTOl = -1.0
Expand Down Expand Up @@ -652,16 +655,6 @@ SUBROUTINE CCHKQP3RK( DOTYPE, NM, MVAL, NN, NVAL, NNS, NSVAL,
RESULT( 1 ) = CQRT12( M, N, A, LDA, S, WORK,
$ LWORK , RWORK )
*
DO T = 1, 1
IF( RESULT( T ).GE.THRESH ) THEN
IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
$ CALL ALAHD( NOUT, PATH )
WRITE( NOUT, FMT = 9999 ) 'CGEQP3RK', M, N,
$ NRHS, KMAX, ABSTOL, RELTOL, NB, NX,
$ IMAT, T, RESULT( T )
NFAIL = NFAIL + 1
END IF
END DO
NRUN = NRUN + 1
*
* End test 1
Expand All @@ -675,7 +668,7 @@ SUBROUTINE CCHKQP3RK( DOTYPE, NM, MVAL, NN, NVAL, NNS, NSVAL,
* 1-norm( A*P - Q*R ) / ( max(M,N) * 1-norm(A) * EPS )
*
RESULT( 2 ) = CQPT01( M, N, KFACT, COPYA, A, LDA, TAU,
$ IWORK( N+1 ), WORK, LWORK )
$ IWORK( N+1 ), WORK, LWORK )
*
* Compute test 3:
*
Expand All @@ -684,21 +677,8 @@ SUBROUTINE CCHKQP3RK( DOTYPE, NM, MVAL, NN, NVAL, NNS, NSVAL,
* 1-norm( Q**T * Q - I ) / ( M * EPS )
*
RESULT( 3 ) = CQRT11( M, KFACT, A, LDA, TAU, WORK,
$ LWORK )
$ LWORK )
*
* Print information about the tests that did not pass
* the threshold.
*
DO T = 2, 3
IF( RESULT( T ).GE.THRESH ) THEN
IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
$ CALL ALAHD( NOUT, PATH )
WRITE( NOUT, FMT = 9999 ) 'CGEQP3RK', M, N,
$ NRHS, KMAX, ABSTOL, RELTOL,
$ NB, NX, IMAT, T, RESULT( T )
NFAIL = NFAIL + 1
END IF
END DO
NRUN = NRUN + 2
*
* Compute test 4:
Expand All @@ -717,8 +697,8 @@ SUBROUTINE CCHKQP3RK( DOTYPE, NM, MVAL, NN, NVAL, NNS, NSVAL,
*
DO J = 1, KFACT-1, 1
*
DTEMP = (( ABS( A( (J-1)*M+J ) ) -
$ ABS( A( (J)*M+J+1 ) ) ) /
DTEMP = (( ABS( A( (J-1)*LDA+J ) ) -
$ ABS( A( (J)*LDA+J+1 ) ) ) /
$ ABS( A(1) ) )
*
IF( DTEMP.LT.ZERO ) THEN
Expand All @@ -727,20 +707,6 @@ SUBROUTINE CCHKQP3RK( DOTYPE, NM, MVAL, NN, NVAL, NNS, NSVAL,
*
END DO
*
* Print information about the tests that did not
* pass the threshold.
*
DO T = 4, 4
IF( RESULT( T ).GE.THRESH ) THEN
IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
$ CALL ALAHD( NOUT, PATH )
WRITE( NOUT, FMT = 9999 ) 'CGEQP3RK',
$ M, N, NRHS, KMAX, ABSTOL, RELTOL,
$ NB, NX, IMAT, T,
$ RESULT( T )
NFAIL = NFAIL + 1
END IF
END DO
NRUN = NRUN + 1
*
* End test 4.
Expand All @@ -762,42 +728,41 @@ SUBROUTINE CCHKQP3RK( DOTYPE, NM, MVAL, NN, NVAL, NNS, NSVAL,
*
LWORK_MQR = MAX(1, NRHS)
CALL CUNMQR( 'Left', 'Conjugate transpose',
$ M, NRHS, KFACT, A, LDA, TAU, B, LDA,
$ WORK, LWORK_MQR, INFO )
$ M, NRHS, KFACT, A, LDA, TAU, B, LDA,
$ WORK, LWORK_MQR, INFO )
*
DO I = 1, NRHS
*
* Compare N+J-th column of A and J-column of B.
*
CALL CAXPY( M, -CONE, A( ( N+I-1 )*LDA+1 ), 1,
$ B( ( I-1 )*LDA+1 ), 1 )
$ B( ( I-1 )*LDA+1 ), 1 )
END DO
*
RESULT( 5 ) =
$ ABS(
$ CLANGE( 'One-norm', M, NRHS, B, LDA, RDUMMY ) /
$ ( REAL( M )*SLAMCH( 'Epsilon' ) )
$ )
*
* Print information about the tests that did not pass
* the threshold.
*
DO T = 5, 5
IF( RESULT( T ).GE.THRESH ) THEN
IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
$ CALL ALAHD( NOUT, PATH )
WRITE( NOUT, FMT = 9999 ) 'CGEQP3RK', M, N,
$ NRHS, KMAX, ABSTOL, RELTOL,
$ NB, NX, IMAT, T, RESULT( T )
NFAIL = NFAIL + 1
END IF
END DO
RESULT( 5 ) = ABS(
$ CLANGE( 'One-norm', M, NRHS, B, LDA, RDUMMY ) /
$ ( REAL( M )*SLAMCH( 'Epsilon' ) ) )
*
NRUN = NRUN + 1
*
* End compute test 5.
*
END IF
*
* Print information about the tests that did not pass
* the threshold.
*
DO T = 1, NTESTS
IF( RESULT( T ).GE.THRESH ) THEN
IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
$ CALL ALAHD( NOUT, PATH )
WRITE( NOUT, FMT = 9999 ) 'CGEQP3RK', M, N,
$ NRHS, KMAX, ABSTOL, RELTOL,
$ NB, NX, IMAT, T, RESULT( T )
NFAIL = NFAIL + 1
END IF
END DO
*
* END DO KMAX = 1, MIN(M,N)+1
*
END DO
Expand Down
91 changes: 28 additions & 63 deletions TESTING/LIN/dchkqp3rk.f
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,9 @@ SUBROUTINE DCHKQP3RK( DOTYPE, NM, MVAL, NN, NVAL, NNS, NSVAL,
CALL DLACPY( 'All', M, NRHS, COPYB, LDA,
$ B, LDA )
CALL ICOPY( N, IWORK( 1 ), 1, IWORK( N+1 ), 1 )
DO I = 1, NTESTS
RESULT( I ) = ZERO
END DO
*
ABSTOL = -1.0
RELTOL = -1.0
Expand Down Expand Up @@ -648,16 +651,6 @@ SUBROUTINE DCHKQP3RK( DOTYPE, NM, MVAL, NN, NVAL, NNS, NSVAL,
RESULT( 1 ) = DQRT12( M, N, A, LDA, S, WORK,
$ LWORK )
*
DO T = 1, 1
IF( RESULT( T ).GE.THRESH ) THEN
IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
$ CALL ALAHD( NOUT, PATH )
WRITE( NOUT, FMT = 9999 ) 'DGEQP3RK', M, N,
$ NRHS, KMAX, ABSTOL, RELTOL, NB, NX,
$ IMAT, T, RESULT( T )
NFAIL = NFAIL + 1
END IF
END DO
NRUN = NRUN + 1
*
* End test 1
Expand All @@ -671,7 +664,7 @@ SUBROUTINE DCHKQP3RK( DOTYPE, NM, MVAL, NN, NVAL, NNS, NSVAL,
* 1-norm( A*P - Q*R ) / ( max(M,N) * 1-norm(A) * EPS )
*
RESULT( 2 ) = DQPT01( M, N, KFACT, COPYA, A, LDA, TAU,
$ IWORK( N+1 ), WORK, LWORK )
$ IWORK( N+1 ), WORK, LWORK )
*
* Compute test 3:
*
Expand All @@ -680,21 +673,8 @@ SUBROUTINE DCHKQP3RK( DOTYPE, NM, MVAL, NN, NVAL, NNS, NSVAL,
* 1-norm( Q**T * Q - I ) / ( M * EPS )
*
RESULT( 3 ) = DQRT11( M, KFACT, A, LDA, TAU, WORK,
$ LWORK )
*
* Print information about the tests that did not pass
* the threshold.
$ LWORK )
*
DO T = 2, 3
IF( RESULT( T ).GE.THRESH ) THEN
IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
$ CALL ALAHD( NOUT, PATH )
WRITE( NOUT, FMT = 9999 ) 'DGEQP3RK', M, N,
$ NRHS, KMAX, ABSTOL, RELTOL,
$ NB, NX, IMAT, T, RESULT( T )
NFAIL = NFAIL + 1
END IF
END DO
NRUN = NRUN + 2
*
* Compute test 4:
Expand All @@ -713,8 +693,8 @@ SUBROUTINE DCHKQP3RK( DOTYPE, NM, MVAL, NN, NVAL, NNS, NSVAL,
*
DO J = 1, KFACT-1, 1

DTEMP = (( ABS( A( (J-1)*M+J ) ) -
$ ABS( A( (J)*M+J+1 ) ) ) /
DTEMP = (( ABS( A( (J-1)*LDA+J ) ) -
$ ABS( A( (J)*LDA+J+1 ) ) ) /
$ ABS( A(1) ) )
*
IF( DTEMP.LT.ZERO ) THEN
Expand All @@ -723,20 +703,6 @@ SUBROUTINE DCHKQP3RK( DOTYPE, NM, MVAL, NN, NVAL, NNS, NSVAL,
*
END DO
*
* Print information about the tests that did not
* pass the threshold.
*
DO T = 4, 4
IF( RESULT( T ).GE.THRESH ) THEN
IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
$ CALL ALAHD( NOUT, PATH )
WRITE( NOUT, FMT = 9999 ) 'DGEQP3RK',
$ M, N, NRHS, KMAX, ABSTOL, RELTOL,
$ NB, NX, IMAT, T,
$ RESULT( T )
NFAIL = NFAIL + 1
END IF
END DO
NRUN = NRUN + 1
*
* End test 4.
Expand All @@ -758,42 +724,41 @@ SUBROUTINE DCHKQP3RK( DOTYPE, NM, MVAL, NN, NVAL, NNS, NSVAL,
*
LWORK_MQR = MAX(1, NRHS)
CALL DORMQR( 'Left', 'Transpose',
$ M, NRHS, KFACT, A, LDA, TAU, B, LDA,
$ WORK, LWORK_MQR, INFO )
$ M, NRHS, KFACT, A, LDA, TAU, B, LDA,
$ WORK, LWORK_MQR, INFO )
*
DO I = 1, NRHS
*
* Compare N+J-th column of A and J-column of B.
*
CALL DAXPY( M, -ONE, A( ( N+I-1 )*LDA+1 ), 1,
$ B( ( I-1 )*LDA+1 ), 1 )
$ B( ( I-1 )*LDA+1 ), 1 )
END DO
*
RESULT( 5 ) =
$ ABS(
$ DLANGE( 'One-norm', M, NRHS, B, LDA, RDUMMY ) /
$ ( DBLE( M )*DLAMCH( 'Epsilon' ) )
$ )
*
* Print information about the tests that did not pass
* the threshold.
*
DO T = 5, 5
IF( RESULT( T ).GE.THRESH ) THEN
IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
$ CALL ALAHD( NOUT, PATH )
WRITE( NOUT, FMT = 9999 ) 'DGEQP3RK', M, N,
$ NRHS, KMAX, ABSTOL, RELTOL,
$ NB, NX, IMAT, T, RESULT( T )
NFAIL = NFAIL + 1
END IF
END DO
RESULT( 5 ) = ABS(
$ DLANGE( 'One-norm', M, NRHS, B, LDA, RDUMMY ) /
$ ( DBLE( M )*DLAMCH( 'Epsilon' ) ) )
*
NRUN = NRUN + 1
*
* End compute test 5.
*
END IF
*
* Print information about the tests that did not
* pass the threshold.
*
DO T = 1, NTESTS
IF( RESULT( T ).GE.THRESH ) THEN
IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
$ CALL ALAHD( NOUT, PATH )
WRITE( NOUT, FMT = 9999 ) 'DGEQP3RK', M, N,
$ NRHS, KMAX, ABSTOL, RELTOL, NB, NX,
$ IMAT, T, RESULT( T )
NFAIL = NFAIL + 1
END IF
END DO
*
* END DO KMAX = 1, MIN(M,N)+1
*
END DO
Expand Down
Loading

0 comments on commit e60ea22

Please sign in to comment.