Skip to content

Commit

Permalink
Merge pull request #3961 from martin-frbg/lapack807
Browse files Browse the repository at this point in the history
Replace the conditionally defined index INDIBL with a constant (Reference-LAPACK PR807)
  • Loading branch information
martin-frbg authored Mar 26, 2023
2 parents 09ace3c + c48bbe9 commit 5736dba
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 80 deletions.
15 changes: 7 additions & 8 deletions lapack-netlib/SRC/chbgvx.f
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ SUBROUTINE CHBGVX( JOBZ, RANGE, UPLO, N, KA, KB, AB, LDAB, BB,
* .. Local Scalars ..
LOGICAL ALLEIG, INDEIG, TEST, UPPER, VALEIG, WANTZ
CHARACTER ORDER, VECT
INTEGER I, IINFO, INDD, INDE, INDEE, INDIBL, INDISP,
INTEGER I, IINFO, INDD, INDE, INDEE, INDISP,
$ INDIWK, INDRWK, INDWRK, ITMP1, J, JJ, NSPLIT
REAL TMP1
* ..
Expand Down Expand Up @@ -470,17 +470,16 @@ SUBROUTINE CHBGVX( JOBZ, RANGE, UPLO, N, KA, KB, AB, LDAB, BB,
ELSE
ORDER = 'E'
END IF
INDIBL = 1
INDISP = INDIBL + N
INDISP = 1 + N
INDIWK = INDISP + N
CALL SSTEBZ( RANGE, ORDER, N, VL, VU, IL, IU, ABSTOL,
$ RWORK( INDD ), RWORK( INDE ), M, NSPLIT, W,
$ IWORK( INDIBL ), IWORK( INDISP ), RWORK( INDRWK ),
$ IWORK( 1 ), IWORK( INDISP ), RWORK( INDRWK ),
$ IWORK( INDIWK ), INFO )
*
IF( WANTZ ) THEN
CALL CSTEIN( N, RWORK( INDD ), RWORK( INDE ), M, W,
$ IWORK( INDIBL ), IWORK( INDISP ), Z, LDZ,
$ IWORK( 1 ), IWORK( INDISP ), Z, LDZ,
$ RWORK( INDRWK ), IWORK( INDIWK ), IFAIL, INFO )
*
* Apply unitary matrix used in reduction to tridiagonal
Expand Down Expand Up @@ -510,11 +509,11 @@ SUBROUTINE CHBGVX( JOBZ, RANGE, UPLO, N, KA, KB, AB, LDAB, BB,
40 CONTINUE
*
IF( I.NE.0 ) THEN
ITMP1 = IWORK( INDIBL+I-1 )
ITMP1 = IWORK( 1 + I-1 )
W( I ) = W( J )
IWORK( INDIBL+I-1 ) = IWORK( INDIBL+J-1 )
IWORK( 1 + I-1 ) = IWORK( 1 + J-1 )
W( J ) = TMP1
IWORK( INDIBL+J-1 ) = ITMP1
IWORK( 1 + J-1 ) = ITMP1
CALL CSWAP( N, Z( 1, I ), 1, Z( 1, J ), 1 )
IF( INFO.NE.0 ) THEN
ITMP1 = IFAIL( I )
Expand Down
15 changes: 7 additions & 8 deletions lapack-netlib/SRC/chpevx.f
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ SUBROUTINE CHPEVX( JOBZ, RANGE, UPLO, N, AP, VL, VU, IL, IU,
* .. Local Scalars ..
LOGICAL ALLEIG, INDEIG, TEST, VALEIG, WANTZ
CHARACTER ORDER
INTEGER I, IINFO, IMAX, INDD, INDE, INDEE, INDIBL,
INTEGER I, IINFO, IMAX, INDD, INDE, INDEE,
$ INDISP, INDIWK, INDRWK, INDTAU, INDWRK, ISCALE,
$ ITMP1, J, JJ, NSPLIT
REAL ABSTLL, ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN,
Expand Down Expand Up @@ -434,17 +434,16 @@ SUBROUTINE CHPEVX( JOBZ, RANGE, UPLO, N, AP, VL, VU, IL, IU,
ELSE
ORDER = 'E'
END IF
INDIBL = 1
INDISP = INDIBL + N
INDISP = 1 + N
INDIWK = INDISP + N
CALL SSTEBZ( RANGE, ORDER, N, VLL, VUU, IL, IU, ABSTLL,
$ RWORK( INDD ), RWORK( INDE ), M, NSPLIT, W,
$ IWORK( INDIBL ), IWORK( INDISP ), RWORK( INDRWK ),
$ IWORK( 1 ), IWORK( INDISP ), RWORK( INDRWK ),
$ IWORK( INDIWK ), INFO )
*
IF( WANTZ ) THEN
CALL CSTEIN( N, RWORK( INDD ), RWORK( INDE ), M, W,
$ IWORK( INDIBL ), IWORK( INDISP ), Z, LDZ,
$ IWORK( 1 ), IWORK( INDISP ), Z, LDZ,
$ RWORK( INDRWK ), IWORK( INDIWK ), IFAIL, INFO )
*
* Apply unitary matrix used in reduction to tridiagonal
Expand Down Expand Up @@ -482,11 +481,11 @@ SUBROUTINE CHPEVX( JOBZ, RANGE, UPLO, N, AP, VL, VU, IL, IU,
30 CONTINUE
*
IF( I.NE.0 ) THEN
ITMP1 = IWORK( INDIBL+I-1 )
ITMP1 = IWORK( 1 + I-1 )
W( I ) = W( J )
IWORK( INDIBL+I-1 ) = IWORK( INDIBL+J-1 )
IWORK( 1 + I-1 ) = IWORK( 1 + J-1 )
W( J ) = TMP1
IWORK( INDIBL+J-1 ) = ITMP1
IWORK( 1 + J-1 ) = ITMP1
CALL CSWAP( N, Z( 1, I ), 1, Z( 1, J ), 1 )
IF( INFO.NE.0 ) THEN
ITMP1 = IFAIL( I )
Expand Down
15 changes: 7 additions & 8 deletions lapack-netlib/SRC/dsbgvx.f
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ SUBROUTINE DSBGVX( JOBZ, RANGE, UPLO, N, KA, KB, AB, LDAB, BB,
* .. Local Scalars ..
LOGICAL ALLEIG, INDEIG, TEST, UPPER, VALEIG, WANTZ
CHARACTER ORDER, VECT
INTEGER I, IINFO, INDD, INDE, INDEE, INDIBL, INDISP,
INTEGER I, IINFO, INDD, INDE, INDEE, INDISP,
$ INDIWO, INDWRK, ITMP1, J, JJ, NSPLIT
DOUBLE PRECISION TMP1
* ..
Expand Down Expand Up @@ -457,17 +457,16 @@ SUBROUTINE DSBGVX( JOBZ, RANGE, UPLO, N, KA, KB, AB, LDAB, BB,
ELSE
ORDER = 'E'
END IF
INDIBL = 1
INDISP = INDIBL + N
INDISP = 1 + N
INDIWO = INDISP + N
CALL DSTEBZ( RANGE, ORDER, N, VL, VU, IL, IU, ABSTOL,
$ WORK( INDD ), WORK( INDE ), M, NSPLIT, W,
$ IWORK( INDIBL ), IWORK( INDISP ), WORK( INDWRK ),
$ IWORK( 1 ), IWORK( INDISP ), WORK( INDWRK ),
$ IWORK( INDIWO ), INFO )
*
IF( WANTZ ) THEN
CALL DSTEIN( N, WORK( INDD ), WORK( INDE ), M, W,
$ IWORK( INDIBL ), IWORK( INDISP ), Z, LDZ,
$ IWORK( 1 ), IWORK( INDISP ), Z, LDZ,
$ WORK( INDWRK ), IWORK( INDIWO ), IFAIL, INFO )
*
* Apply transformation matrix used in reduction to tridiagonal
Expand Down Expand Up @@ -497,11 +496,11 @@ SUBROUTINE DSBGVX( JOBZ, RANGE, UPLO, N, KA, KB, AB, LDAB, BB,
40 CONTINUE
*
IF( I.NE.0 ) THEN
ITMP1 = IWORK( INDIBL+I-1 )
ITMP1 = IWORK( 1 + I-1 )
W( I ) = W( J )
IWORK( INDIBL+I-1 ) = IWORK( INDIBL+J-1 )
IWORK( 1 + I-1 ) = IWORK( 1 + J-1 )
W( J ) = TMP1
IWORK( INDIBL+J-1 ) = ITMP1
IWORK( 1 + J-1 ) = ITMP1
CALL DSWAP( N, Z( 1, I ), 1, Z( 1, J ), 1 )
IF( INFO.NE.0 ) THEN
ITMP1 = IFAIL( I )
Expand Down
15 changes: 7 additions & 8 deletions lapack-netlib/SRC/dspevx.f
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ SUBROUTINE DSPEVX( JOBZ, RANGE, UPLO, N, AP, VL, VU, IL, IU,
* .. Local Scalars ..
LOGICAL ALLEIG, INDEIG, TEST, VALEIG, WANTZ
CHARACTER ORDER
INTEGER I, IINFO, IMAX, INDD, INDE, INDEE, INDIBL,
INTEGER I, IINFO, IMAX, INDD, INDE, INDEE,
$ INDISP, INDIWO, INDTAU, INDWRK, ISCALE, ITMP1,
$ J, JJ, NSPLIT
DOUBLE PRECISION ABSTLL, ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN,
Expand Down Expand Up @@ -424,17 +424,16 @@ SUBROUTINE DSPEVX( JOBZ, RANGE, UPLO, N, AP, VL, VU, IL, IU,
ELSE
ORDER = 'E'
END IF
INDIBL = 1
INDISP = INDIBL + N
INDISP = 1 + N
INDIWO = INDISP + N
CALL DSTEBZ( RANGE, ORDER, N, VLL, VUU, IL, IU, ABSTLL,
$ WORK( INDD ), WORK( INDE ), M, NSPLIT, W,
$ IWORK( INDIBL ), IWORK( INDISP ), WORK( INDWRK ),
$ IWORK( 1 ), IWORK( INDISP ), WORK( INDWRK ),
$ IWORK( INDIWO ), INFO )
*
IF( WANTZ ) THEN
CALL DSTEIN( N, WORK( INDD ), WORK( INDE ), M, W,
$ IWORK( INDIBL ), IWORK( INDISP ), Z, LDZ,
$ IWORK( 1 ), IWORK( INDISP ), Z, LDZ,
$ WORK( INDWRK ), IWORK( INDIWO ), IFAIL, INFO )
*
* Apply orthogonal matrix used in reduction to tridiagonal
Expand Down Expand Up @@ -471,11 +470,11 @@ SUBROUTINE DSPEVX( JOBZ, RANGE, UPLO, N, AP, VL, VU, IL, IU,
30 CONTINUE
*
IF( I.NE.0 ) THEN
ITMP1 = IWORK( INDIBL+I-1 )
ITMP1 = IWORK( 1 + I-1 )
W( I ) = W( J )
IWORK( INDIBL+I-1 ) = IWORK( INDIBL+J-1 )
IWORK( 1 + I-1 ) = IWORK( 1 + J-1 )
W( J ) = TMP1
IWORK( INDIBL+J-1 ) = ITMP1
IWORK( 1 + J-1 ) = ITMP1
CALL DSWAP( N, Z( 1, I ), 1, Z( 1, J ), 1 )
IF( INFO.NE.0 ) THEN
ITMP1 = IFAIL( I )
Expand Down
15 changes: 7 additions & 8 deletions lapack-netlib/SRC/dstevx.f
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ SUBROUTINE DSTEVX( JOBZ, RANGE, N, D, E, VL, VU, IL, IU, ABSTOL,
* .. Local Scalars ..
LOGICAL ALLEIG, INDEIG, TEST, VALEIG, WANTZ
CHARACTER ORDER
INTEGER I, IMAX, INDIBL, INDISP, INDIWO, INDWRK,
INTEGER I, IMAX, INDISP, INDIWO, INDWRK,
$ ISCALE, ITMP1, J, JJ, NSPLIT
DOUBLE PRECISION BIGNUM, EPS, RMAX, RMIN, SAFMIN, SIGMA, SMLNUM,
$ TMP1, TNRM, VLL, VUU
Expand Down Expand Up @@ -399,15 +399,14 @@ SUBROUTINE DSTEVX( JOBZ, RANGE, N, D, E, VL, VU, IL, IU, ABSTOL,
ORDER = 'E'
END IF
INDWRK = 1
INDIBL = 1
INDISP = INDIBL + N
INDISP = 1 + N
INDIWO = INDISP + N
CALL DSTEBZ( RANGE, ORDER, N, VLL, VUU, IL, IU, ABSTOL, D, E, M,
$ NSPLIT, W, IWORK( INDIBL ), IWORK( INDISP ),
$ NSPLIT, W, IWORK( 1 ), IWORK( INDISP ),
$ WORK( INDWRK ), IWORK( INDIWO ), INFO )
*
IF( WANTZ ) THEN
CALL DSTEIN( N, D, E, M, W, IWORK( INDIBL ), IWORK( INDISP ),
CALL DSTEIN( N, D, E, M, W, IWORK( 1 ), IWORK( INDISP ),
$ Z, LDZ, WORK( INDWRK ), IWORK( INDIWO ), IFAIL,
$ INFO )
END IF
Expand Down Expand Up @@ -439,11 +438,11 @@ SUBROUTINE DSTEVX( JOBZ, RANGE, N, D, E, VL, VU, IL, IU, ABSTOL,
30 CONTINUE
*
IF( I.NE.0 ) THEN
ITMP1 = IWORK( INDIBL+I-1 )
ITMP1 = IWORK( 1 + I-1 )
W( I ) = W( J )
IWORK( INDIBL+I-1 ) = IWORK( INDIBL+J-1 )
IWORK( 1 + I-1 ) = IWORK( 1 + J-1 )
W( J ) = TMP1
IWORK( INDIBL+J-1 ) = ITMP1
IWORK( 1 + J-1 ) = ITMP1
CALL DSWAP( N, Z( 1, I ), 1, Z( 1, J ), 1 )
IF( INFO.NE.0 ) THEN
ITMP1 = IFAIL( I )
Expand Down
15 changes: 7 additions & 8 deletions lapack-netlib/SRC/ssbgvx.f
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ SUBROUTINE SSBGVX( JOBZ, RANGE, UPLO, N, KA, KB, AB, LDAB, BB,
* .. Local Scalars ..
LOGICAL ALLEIG, INDEIG, TEST, UPPER, VALEIG, WANTZ
CHARACTER ORDER, VECT
INTEGER I, IINFO, INDD, INDE, INDEE, INDIBL, INDISP,
INTEGER I, IINFO, INDD, INDE, INDEE, INDISP,
$ INDIWO, INDWRK, ITMP1, J, JJ, NSPLIT
REAL TMP1
* ..
Expand Down Expand Up @@ -457,17 +457,16 @@ SUBROUTINE SSBGVX( JOBZ, RANGE, UPLO, N, KA, KB, AB, LDAB, BB,
ELSE
ORDER = 'E'
END IF
INDIBL = 1
INDISP = INDIBL + N
INDISP = 1 + N
INDIWO = INDISP + N
CALL SSTEBZ( RANGE, ORDER, N, VL, VU, IL, IU, ABSTOL,
$ WORK( INDD ), WORK( INDE ), M, NSPLIT, W,
$ IWORK( INDIBL ), IWORK( INDISP ), WORK( INDWRK ),
$ IWORK( 1 ), IWORK( INDISP ), WORK( INDWRK ),
$ IWORK( INDIWO ), INFO )
*
IF( WANTZ ) THEN
CALL SSTEIN( N, WORK( INDD ), WORK( INDE ), M, W,
$ IWORK( INDIBL ), IWORK( INDISP ), Z, LDZ,
$ IWORK( 1 ), IWORK( INDISP ), Z, LDZ,
$ WORK( INDWRK ), IWORK( INDIWO ), IFAIL, INFO )
*
* Apply transformation matrix used in reduction to tridiagonal
Expand Down Expand Up @@ -497,11 +496,11 @@ SUBROUTINE SSBGVX( JOBZ, RANGE, UPLO, N, KA, KB, AB, LDAB, BB,
40 CONTINUE
*
IF( I.NE.0 ) THEN
ITMP1 = IWORK( INDIBL+I-1 )
ITMP1 = IWORK( 1 + I-1 )
W( I ) = W( J )
IWORK( INDIBL+I-1 ) = IWORK( INDIBL+J-1 )
IWORK( 1 + I-1 ) = IWORK( 1 + J-1 )
W( J ) = TMP1
IWORK( INDIBL+J-1 ) = ITMP1
IWORK( 1 + J-1 ) = ITMP1
CALL SSWAP( N, Z( 1, I ), 1, Z( 1, J ), 1 )
IF( INFO.NE.0 ) THEN
ITMP1 = IFAIL( I )
Expand Down
15 changes: 7 additions & 8 deletions lapack-netlib/SRC/sspevx.f
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ SUBROUTINE SSPEVX( JOBZ, RANGE, UPLO, N, AP, VL, VU, IL, IU,
* .. Local Scalars ..
LOGICAL ALLEIG, INDEIG, TEST, VALEIG, WANTZ
CHARACTER ORDER
INTEGER I, IINFO, IMAX, INDD, INDE, INDEE, INDIBL,
INTEGER I, IINFO, IMAX, INDD, INDE, INDEE,
$ INDISP, INDIWO, INDTAU, INDWRK, ISCALE, ITMP1,
$ J, JJ, NSPLIT
REAL ABSTLL, ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN,
Expand Down Expand Up @@ -424,17 +424,16 @@ SUBROUTINE SSPEVX( JOBZ, RANGE, UPLO, N, AP, VL, VU, IL, IU,
ELSE
ORDER = 'E'
END IF
INDIBL = 1
INDISP = INDIBL + N
INDISP = 1 + N
INDIWO = INDISP + N
CALL SSTEBZ( RANGE, ORDER, N, VLL, VUU, IL, IU, ABSTLL,
$ WORK( INDD ), WORK( INDE ), M, NSPLIT, W,
$ IWORK( INDIBL ), IWORK( INDISP ), WORK( INDWRK ),
$ IWORK( 1 ), IWORK( INDISP ), WORK( INDWRK ),
$ IWORK( INDIWO ), INFO )
*
IF( WANTZ ) THEN
CALL SSTEIN( N, WORK( INDD ), WORK( INDE ), M, W,
$ IWORK( INDIBL ), IWORK( INDISP ), Z, LDZ,
$ IWORK( 1 ), IWORK( INDISP ), Z, LDZ,
$ WORK( INDWRK ), IWORK( INDIWO ), IFAIL, INFO )
*
* Apply orthogonal matrix used in reduction to tridiagonal
Expand Down Expand Up @@ -471,11 +470,11 @@ SUBROUTINE SSPEVX( JOBZ, RANGE, UPLO, N, AP, VL, VU, IL, IU,
30 CONTINUE
*
IF( I.NE.0 ) THEN
ITMP1 = IWORK( INDIBL+I-1 )
ITMP1 = IWORK( 1 + I-1 )
W( I ) = W( J )
IWORK( INDIBL+I-1 ) = IWORK( INDIBL+J-1 )
IWORK( 1 + I-1 ) = IWORK( 1 + J-1 )
W( J ) = TMP1
IWORK( INDIBL+J-1 ) = ITMP1
IWORK( 1 + J-1 ) = ITMP1
CALL SSWAP( N, Z( 1, I ), 1, Z( 1, J ), 1 )
IF( INFO.NE.0 ) THEN
ITMP1 = IFAIL( I )
Expand Down
15 changes: 7 additions & 8 deletions lapack-netlib/SRC/sstevx.f
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ SUBROUTINE SSTEVX( JOBZ, RANGE, N, D, E, VL, VU, IL, IU, ABSTOL,
* .. Local Scalars ..
LOGICAL ALLEIG, INDEIG, TEST, VALEIG, WANTZ
CHARACTER ORDER
INTEGER I, IMAX, INDIBL, INDISP, INDIWO, INDWRK,
INTEGER I, IMAX, INDISP, INDIWO, INDWRK,
$ ISCALE, ITMP1, J, JJ, NSPLIT
REAL BIGNUM, EPS, RMAX, RMIN, SAFMIN, SIGMA, SMLNUM,
$ TMP1, TNRM, VLL, VUU
Expand Down Expand Up @@ -399,15 +399,14 @@ SUBROUTINE SSTEVX( JOBZ, RANGE, N, D, E, VL, VU, IL, IU, ABSTOL,
ORDER = 'E'
END IF
INDWRK = 1
INDIBL = 1
INDISP = INDIBL + N
INDISP = 1 + N
INDIWO = INDISP + N
CALL SSTEBZ( RANGE, ORDER, N, VLL, VUU, IL, IU, ABSTOL, D, E, M,
$ NSPLIT, W, IWORK( INDIBL ), IWORK( INDISP ),
$ NSPLIT, W, IWORK( 1 ), IWORK( INDISP ),
$ WORK( INDWRK ), IWORK( INDIWO ), INFO )
*
IF( WANTZ ) THEN
CALL SSTEIN( N, D, E, M, W, IWORK( INDIBL ), IWORK( INDISP ),
CALL SSTEIN( N, D, E, M, W, IWORK( 1 ), IWORK( INDISP ),
$ Z, LDZ, WORK( INDWRK ), IWORK( INDIWO ), IFAIL,
$ INFO )
END IF
Expand Down Expand Up @@ -439,11 +438,11 @@ SUBROUTINE SSTEVX( JOBZ, RANGE, N, D, E, VL, VU, IL, IU, ABSTOL,
30 CONTINUE
*
IF( I.NE.0 ) THEN
ITMP1 = IWORK( INDIBL+I-1 )
ITMP1 = IWORK( 1 + I-1 )
W( I ) = W( J )
IWORK( INDIBL+I-1 ) = IWORK( INDIBL+J-1 )
IWORK( 1 + I-1 ) = IWORK( 1 + J-1 )
W( J ) = TMP1
IWORK( INDIBL+J-1 ) = ITMP1
IWORK( 1 + J-1 ) = ITMP1
CALL SSWAP( N, Z( 1, I ), 1, Z( 1, J ), 1 )
IF( INFO.NE.0 ) THEN
ITMP1 = IFAIL( I )
Expand Down
Loading

0 comments on commit 5736dba

Please sign in to comment.