Merge pull request #3835 from martin-frbg/lapack217

Simplify ?SYSWAPR and fix its documentation (Reference-LAPACK 217)
This commit is contained in:
Martin Kroeker 2022-11-21 19:56:28 +01:00 committed by GitHub
commit 880a3fb20f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 58 additions and 126 deletions

View File

@ -58,15 +58,13 @@
*> \param[in,out] A *> \param[in,out] A
*> \verbatim *> \verbatim
*> A is COMPLEX array, dimension (LDA,N) *> A is COMPLEX array, dimension (LDA,N)
*> On entry, the NB diagonal matrix D and the multipliers *> On entry, the N-by-N matrix A. On exit, the permuted matrix
*> used to obtain the factor U or L as computed by CSYTRF. *> where the rows I1 and I2 and columns I1 and I2 are interchanged.
*> *> If UPLO = 'U', the interchanges are applied to the upper
*> On exit, if INFO = 0, the (symmetric) inverse of the original *> triangular part and the strictly lower triangular part of A is
*> matrix. If UPLO = 'U', the upper triangular part of the *> not referenced; if UPLO = 'L', the interchanges are applied to
*> inverse is formed and the part of A below the diagonal is not *> the lower triangular part and the part of A above the diagonal
*> referenced; if UPLO = 'L' the lower triangular part of the *> is not referenced.
*> inverse is formed and the part of A above the diagonal is
*> not referenced.
*> \endverbatim *> \endverbatim
*> *>
*> \param[in] LDA *> \param[in] LDA
@ -116,7 +114,6 @@
* .. * ..
* .. Local Scalars .. * .. Local Scalars ..
LOGICAL UPPER LOGICAL UPPER
INTEGER I
COMPLEX TMP COMPLEX TMP
* *
* .. External Functions .. * .. External Functions ..
@ -143,19 +140,12 @@
A(I1,I1)=A(I2,I2) A(I1,I1)=A(I2,I2)
A(I2,I2)=TMP A(I2,I2)=TMP
* *
DO I=1,I2-I1-1 CALL CSWAP( I2-I1-1, A(I1,I1+1), LDA, A(I1+1,I2), 1 )
TMP=A(I1,I1+I)
A(I1,I1+I)=A(I1+I,I2)
A(I1+I,I2)=TMP
END DO
* *
* third swap * third swap
* - swap row I1 and I2 from I2+1 to N * - swap row I1 and I2 from I2+1 to N
DO I=I2+1,N IF ( I2.LT.N )
TMP=A(I1,I) $ CALL CSWAP( N-I2, A(I1,I2+1), LDA, A(I2,I2+1), LDA )
A(I1,I)=A(I2,I)
A(I2,I)=TMP
END DO
* *
ELSE ELSE
* *
@ -171,19 +161,12 @@
A(I1,I1)=A(I2,I2) A(I1,I1)=A(I2,I2)
A(I2,I2)=TMP A(I2,I2)=TMP
* *
DO I=1,I2-I1-1 CALL CSWAP( I2-I1-1, A(I1+1,I1), 1, A(I2,I1+1), LDA )
TMP=A(I1+I,I1)
A(I1+I,I1)=A(I2,I1+I)
A(I2,I1+I)=TMP
END DO
* *
* third swap * third swap
* - swap col I1 and I2 from I2+1 to N * - swap col I1 and I2 from I2+1 to N
DO I=I2+1,N IF ( I2.LT.N )
TMP=A(I,I1) $ CALL CSWAP( N-I2, A(I2+1,I1), 1, A(I2+1,I2), 1 )
A(I,I1)=A(I,I2)
A(I,I2)=TMP
END DO
* *
ENDIF ENDIF
END SUBROUTINE CSYSWAPR END SUBROUTINE CSYSWAPR

View File

@ -57,16 +57,14 @@
*> *>
*> \param[in,out] A *> \param[in,out] A
*> \verbatim *> \verbatim
*> A is DOUBLE PRECISION array, dimension (LDA,N) *> A is DOUBLE PRECISION array, dimension (LDA,*)
*> On entry, the NB diagonal matrix D and the multipliers *> On entry, the N-by-N matrix A. On exit, the permuted matrix
*> used to obtain the factor U or L as computed by DSYTRF. *> where the rows I1 and I2 and columns I1 and I2 are interchanged.
*> *> If UPLO = 'U', the interchanges are applied to the upper
*> On exit, if INFO = 0, the (symmetric) inverse of the original *> triangular part and the strictly lower triangular part of A is
*> matrix. If UPLO = 'U', the upper triangular part of the *> not referenced; if UPLO = 'L', the interchanges are applied to
*> inverse is formed and the part of A below the diagonal is not *> the lower triangular part and the part of A above the diagonal
*> referenced; if UPLO = 'L' the lower triangular part of the *> is not referenced.
*> inverse is formed and the part of A above the diagonal is
*> not referenced.
*> \endverbatim *> \endverbatim
*> *>
*> \param[in] LDA *> \param[in] LDA
@ -109,14 +107,13 @@
INTEGER I1, I2, LDA, N INTEGER I1, I2, LDA, N
* .. * ..
* .. Array Arguments .. * .. Array Arguments ..
DOUBLE PRECISION A( LDA, N ) DOUBLE PRECISION A( LDA, * )
* *
* ===================================================================== * =====================================================================
* *
* .. * ..
* .. Local Scalars .. * .. Local Scalars ..
LOGICAL UPPER LOGICAL UPPER
INTEGER I
DOUBLE PRECISION TMP DOUBLE PRECISION TMP
* *
* .. External Functions .. * .. External Functions ..
@ -143,19 +140,12 @@
A(I1,I1)=A(I2,I2) A(I1,I1)=A(I2,I2)
A(I2,I2)=TMP A(I2,I2)=TMP
* *
DO I=1,I2-I1-1 CALL DSWAP( I2-I1-1, A(I1,I1+1), LDA, A(I1+1,I2), 1 )
TMP=A(I1,I1+I)
A(I1,I1+I)=A(I1+I,I2)
A(I1+I,I2)=TMP
END DO
* *
* third swap * third swap
* - swap row I1 and I2 from I2+1 to N * - swap row I1 and I2 from I2+1 to N
DO I=I2+1,N IF ( I2.LT.N )
TMP=A(I1,I) $ CALL DSWAP( N-I2, A(I1,I2+1), LDA, A(I2,I2+1), LDA )
A(I1,I)=A(I2,I)
A(I2,I)=TMP
END DO
* *
ELSE ELSE
* *
@ -171,19 +161,12 @@
A(I1,I1)=A(I2,I2) A(I1,I1)=A(I2,I2)
A(I2,I2)=TMP A(I2,I2)=TMP
* *
DO I=1,I2-I1-1 CALL DSWAP( I2-I1-1, A(I1+1,I1), 1, A(I2,I1+1), LDA )
TMP=A(I1+I,I1)
A(I1+I,I1)=A(I2,I1+I)
A(I2,I1+I)=TMP
END DO
* *
* third swap * third swap
* - swap col I1 and I2 from I2+1 to N * - swap col I1 and I2 from I2+1 to N
DO I=I2+1,N IF ( I2.LT.N )
TMP=A(I,I1) $ CALL DSWAP( N-I2, A(I2+1,I1), 1, A(I2+1,I2), 1 )
A(I,I1)=A(I,I2)
A(I,I2)=TMP
END DO
* *
ENDIF ENDIF
END SUBROUTINE DSYSWAPR END SUBROUTINE DSYSWAPR

View File

@ -57,16 +57,14 @@
*> *>
*> \param[in,out] A *> \param[in,out] A
*> \verbatim *> \verbatim
*> A is REAL array, dimension (LDA,N) *> A is REAL array, dimension (LDA,*)
*> On entry, the NB diagonal matrix D and the multipliers *> On entry, the N-by-N matrix A. On exit, the permuted matrix
*> used to obtain the factor U or L as computed by SSYTRF. *> where the rows I1 and I2 and columns I1 and I2 are interchanged.
*> *> If UPLO = 'U', the interchanges are applied to the upper
*> On exit, if INFO = 0, the (symmetric) inverse of the original *> triangular part and the strictly lower triangular part of A is
*> matrix. If UPLO = 'U', the upper triangular part of the *> not referenced; if UPLO = 'L', the interchanges are applied to
*> inverse is formed and the part of A below the diagonal is not *> the lower triangular part and the part of A above the diagonal
*> referenced; if UPLO = 'L' the lower triangular part of the *> is not referenced.
*> inverse is formed and the part of A above the diagonal is
*> not referenced.
*> \endverbatim *> \endverbatim
*> *>
*> \param[in] LDA *> \param[in] LDA
@ -109,14 +107,13 @@
INTEGER I1, I2, LDA, N INTEGER I1, I2, LDA, N
* .. * ..
* .. Array Arguments .. * .. Array Arguments ..
REAL A( LDA, N ) REAL A( LDA, * )
* *
* ===================================================================== * =====================================================================
* *
* .. * ..
* .. Local Scalars .. * .. Local Scalars ..
LOGICAL UPPER LOGICAL UPPER
INTEGER I
REAL TMP REAL TMP
* *
* .. External Functions .. * .. External Functions ..
@ -143,19 +140,12 @@
A(I1,I1)=A(I2,I2) A(I1,I1)=A(I2,I2)
A(I2,I2)=TMP A(I2,I2)=TMP
* *
DO I=1,I2-I1-1 CALL SSWAP( I2-I1-1, A(I1,I1+1), LDA, A(I1+1,I2), 1 )
TMP=A(I1,I1+I)
A(I1,I1+I)=A(I1+I,I2)
A(I1+I,I2)=TMP
END DO
* *
* third swap * third swap
* - swap row I1 and I2 from I2+1 to N * - swap row I1 and I2 from I2+1 to N
DO I=I2+1,N IF ( I2.LT.N )
TMP=A(I1,I) $ CALL SSWAP( N-I2, A(I1,I2+1), LDA, A(I2,I2+1), LDA )
A(I1,I)=A(I2,I)
A(I2,I)=TMP
END DO
* *
ELSE ELSE
* *
@ -171,19 +161,12 @@
A(I1,I1)=A(I2,I2) A(I1,I1)=A(I2,I2)
A(I2,I2)=TMP A(I2,I2)=TMP
* *
DO I=1,I2-I1-1 CALL SSWAP( I2-I1-1, A(I1+1,I1), 1, A(I2,I1+1), LDA )
TMP=A(I1+I,I1)
A(I1+I,I1)=A(I2,I1+I)
A(I2,I1+I)=TMP
END DO
* *
* third swap * third swap
* - swap col I1 and I2 from I2+1 to N * - swap col I1 and I2 from I2+1 to N
DO I=I2+1,N IF ( I2.LT.N )
TMP=A(I,I1) $ CALL SSWAP( N-I2, A(I2+1,I1), 1, A(I2+1,I2), 1 )
A(I,I1)=A(I,I2)
A(I,I2)=TMP
END DO
* *
ENDIF ENDIF
END SUBROUTINE SSYSWAPR END SUBROUTINE SSYSWAPR

View File

@ -57,16 +57,14 @@
*> *>
*> \param[in,out] A *> \param[in,out] A
*> \verbatim *> \verbatim
*> A is COMPLEX*16 array, dimension (LDA,N) *> A is COMPLEX*16 array, dimension (LDA,*)
*> On entry, the NB diagonal matrix D and the multipliers *> On entry, the N-by-N matrix A. On exit, the permuted matrix
*> used to obtain the factor U or L as computed by ZSYTRF. *> where the rows I1 and I2 and columns I1 and I2 are interchanged.
*> *> If UPLO = 'U', the interchanges are applied to the upper
*> On exit, if INFO = 0, the (symmetric) inverse of the original *> triangular part and the strictly lower triangular part of A is
*> matrix. If UPLO = 'U', the upper triangular part of the *> not referenced; if UPLO = 'L', the interchanges are applied to
*> inverse is formed and the part of A below the diagonal is not *> the lower triangular part and the part of A above the diagonal
*> referenced; if UPLO = 'L' the lower triangular part of the *> is not referenced.
*> inverse is formed and the part of A above the diagonal is
*> not referenced.
*> \endverbatim *> \endverbatim
*> *>
*> \param[in] LDA *> \param[in] LDA
@ -109,14 +107,13 @@
INTEGER I1, I2, LDA, N INTEGER I1, I2, LDA, N
* .. * ..
* .. Array Arguments .. * .. Array Arguments ..
COMPLEX*16 A( LDA, N ) COMPLEX*16 A( LDA, * )
* *
* ===================================================================== * =====================================================================
* *
* .. * ..
* .. Local Scalars .. * .. Local Scalars ..
LOGICAL UPPER LOGICAL UPPER
INTEGER I
COMPLEX*16 TMP COMPLEX*16 TMP
* *
* .. External Functions .. * .. External Functions ..
@ -143,19 +140,12 @@
A(I1,I1)=A(I2,I2) A(I1,I1)=A(I2,I2)
A(I2,I2)=TMP A(I2,I2)=TMP
* *
DO I=1,I2-I1-1 CALL ZSWAP( I2-I1-1, A(I1,I1+1), LDA, A(I1+1,I2), 1 )
TMP=A(I1,I1+I)
A(I1,I1+I)=A(I1+I,I2)
A(I1+I,I2)=TMP
END DO
* *
* third swap * third swap
* - swap row I1 and I2 from I2+1 to N * - swap row I1 and I2 from I2+1 to N
DO I=I2+1,N IF ( I2.LT.N )
TMP=A(I1,I) $ CALL ZSWAP( N-I2, A(I1,I2+1), LDA, A(I2,I2+1), LDA )
A(I1,I)=A(I2,I)
A(I2,I)=TMP
END DO
* *
ELSE ELSE
* *
@ -171,19 +161,12 @@
A(I1,I1)=A(I2,I2) A(I1,I1)=A(I2,I2)
A(I2,I2)=TMP A(I2,I2)=TMP
* *
DO I=1,I2-I1-1 CALL ZSWAP( I2-I1-1, A(I1+1,I1), 1, A(I2,I1+1), LDA )
TMP=A(I1+I,I1)
A(I1+I,I1)=A(I2,I1+I)
A(I2,I1+I)=TMP
END DO
* *
* third swap * third swap
* - swap col I1 and I2 from I2+1 to N * - swap col I1 and I2 from I2+1 to N
DO I=I2+1,N IF ( I2.LT.N )
TMP=A(I,I1) $ CALL ZSWAP( N-I2, A(I2+1,I1), 1, A(I2+1,I2), 1 )
A(I,I1)=A(I,I2)
A(I,I2)=TMP
END DO
* *
ENDIF ENDIF
END SUBROUTINE ZSYSWAPR END SUBROUTINE ZSYSWAPR