Change loop ordering to improve performance (Reference-LAPACK PR 1023)

This commit is contained in:
Martin Kroeker 2026-03-30 20:24:31 +02:00 committed by GitHub
parent d26960a21e
commit ff5dc3ebc1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 20 additions and 28 deletions

View File

@ -5,7 +5,6 @@
* Online html documentation available at
* http://www.netlib.org/lapack/explore-html/
*
*> \htmlonly
*> Download CGETC2 + dependencies
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/cgetc2.f">
*> [TGZ]</a>
@ -13,7 +12,6 @@
*> [ZIP]</a>
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cgetc2.f">
*> [TXT]</a>
*> \endhtmlonly
*
* Definition:
* ===========
@ -98,7 +96,7 @@
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \ingroup complexGEauxiliary
*> \ingroup getc2
*
*> \par Contributors:
* ==================
@ -108,6 +106,7 @@
*
* =====================================================================
SUBROUTINE CGETC2( N, A, LDA, IPIV, JPIV, INFO )
IMPLICIT NONE
*
* -- LAPACK auxiliary routine --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
@ -132,7 +131,7 @@
REAL BIGNUM, EPS, SMIN, SMLNUM, XMAX
* ..
* .. External Subroutines ..
EXTERNAL CGERU, CSWAP, SLABAD
EXTERNAL CGERU, CSWAP
* ..
* .. External Functions ..
REAL SLAMCH
@ -155,7 +154,6 @@
EPS = SLAMCH( 'P' )
SMLNUM = SLAMCH( 'S' ) / EPS
BIGNUM = ONE / SMLNUM
CALL SLABAD( SMLNUM, BIGNUM )
*
* Handle the case N=1 by itself
*
@ -177,8 +175,8 @@
* Find max element in matrix A
*
XMAX = ZERO
DO 20 IP = I, N
DO 10 JP = I, N
DO 20 JP = I, N
DO 10 IP = I, N
IF( ABS( A( IP, JP ) ).GE.XMAX ) THEN
XMAX = ABS( A( IP, JP ) )
IPV = IP

View File

@ -5,7 +5,6 @@
* Online html documentation available at
* http://www.netlib.org/lapack/explore-html/
*
*> \htmlonly
*> Download DGETC2 + dependencies
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dgetc2.f">
*> [TGZ]</a>
@ -13,7 +12,6 @@
*> [ZIP]</a>
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgetc2.f">
*> [TXT]</a>
*> \endhtmlonly
*
* Definition:
* ===========
@ -98,7 +96,7 @@
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \ingroup doubleGEauxiliary
*> \ingroup getc2
*
*> \par Contributors:
* ==================
@ -108,6 +106,7 @@
*
* =====================================================================
SUBROUTINE DGETC2( N, A, LDA, IPIV, JPIV, INFO )
IMPLICIT NONE
*
* -- LAPACK auxiliary routine --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
@ -132,7 +131,7 @@
DOUBLE PRECISION BIGNUM, EPS, SMIN, SMLNUM, XMAX
* ..
* .. External Subroutines ..
EXTERNAL DGER, DSWAP, DLABAD
EXTERNAL DGER, DSWAP
* ..
* .. External Functions ..
DOUBLE PRECISION DLAMCH
@ -155,7 +154,6 @@
EPS = DLAMCH( 'P' )
SMLNUM = DLAMCH( 'S' ) / EPS
BIGNUM = ONE / SMLNUM
CALL DLABAD( SMLNUM, BIGNUM )
*
* Handle the case N=1 by itself
*
@ -177,8 +175,8 @@
* Find max element in matrix A
*
XMAX = ZERO
DO 20 IP = I, N
DO 10 JP = I, N
DO 20 JP = I, N
DO 10 IP = I, N
IF( ABS( A( IP, JP ) ).GE.XMAX ) THEN
XMAX = ABS( A( IP, JP ) )
IPV = IP

View File

@ -5,7 +5,6 @@
* Online html documentation available at
* http://www.netlib.org/lapack/explore-html/
*
*> \htmlonly
*> Download SGETC2 + dependencies
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/sgetc2.f">
*> [TGZ]</a>
@ -13,7 +12,6 @@
*> [ZIP]</a>
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sgetc2.f">
*> [TXT]</a>
*> \endhtmlonly
*
* Definition:
* ===========
@ -98,7 +96,7 @@
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \ingroup realGEauxiliary
*> \ingroup getc2
*
*> \par Contributors:
* ==================
@ -108,6 +106,7 @@
*
* =====================================================================
SUBROUTINE SGETC2( N, A, LDA, IPIV, JPIV, INFO )
IMPLICIT NONE
*
* -- LAPACK auxiliary routine --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
@ -132,7 +131,7 @@
REAL BIGNUM, EPS, SMIN, SMLNUM, XMAX
* ..
* .. External Subroutines ..
EXTERNAL SGER, SLABAD, SSWAP
EXTERNAL SGER, SSWAP
* ..
* .. External Functions ..
REAL SLAMCH
@ -155,7 +154,6 @@
EPS = SLAMCH( 'P' )
SMLNUM = SLAMCH( 'S' ) / EPS
BIGNUM = ONE / SMLNUM
CALL SLABAD( SMLNUM, BIGNUM )
*
* Handle the case N=1 by itself
*
@ -177,8 +175,8 @@
* Find max element in matrix A
*
XMAX = ZERO
DO 20 IP = I, N
DO 10 JP = I, N
DO 20 JP = I, N
DO 10 IP = I, N
IF( ABS( A( IP, JP ) ).GE.XMAX ) THEN
XMAX = ABS( A( IP, JP ) )
IPV = IP

View File

@ -5,7 +5,6 @@
* Online html documentation available at
* http://www.netlib.org/lapack/explore-html/
*
*> \htmlonly
*> Download ZGETC2 + dependencies
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zgetc2.f">
*> [TGZ]</a>
@ -13,7 +12,6 @@
*> [ZIP]</a>
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgetc2.f">
*> [TXT]</a>
*> \endhtmlonly
*
* Definition:
* ===========
@ -98,7 +96,7 @@
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \ingroup complex16GEauxiliary
*> \ingroup getc2
*
*> \par Contributors:
* ==================
@ -108,6 +106,7 @@
*
* =====================================================================
SUBROUTINE ZGETC2( N, A, LDA, IPIV, JPIV, INFO )
IMPLICIT NONE
*
* -- LAPACK auxiliary routine --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
@ -132,7 +131,7 @@
DOUBLE PRECISION BIGNUM, EPS, SMIN, SMLNUM, XMAX
* ..
* .. External Subroutines ..
EXTERNAL ZGERU, ZSWAP, DLABAD
EXTERNAL ZGERU, ZSWAP
* ..
* .. External Functions ..
DOUBLE PRECISION DLAMCH
@ -155,7 +154,6 @@
EPS = DLAMCH( 'P' )
SMLNUM = DLAMCH( 'S' ) / EPS
BIGNUM = ONE / SMLNUM
CALL DLABAD( SMLNUM, BIGNUM )
*
* Handle the case N=1 by itself
*
@ -177,8 +175,8 @@
* Find max element in matrix A
*
XMAX = ZERO
DO 20 IP = I, N
DO 10 JP = I, N
DO 20 JP = I, N
DO 10 IP = I, N
IF( ABS( A( IP, JP ) ).GE.XMAX ) THEN
XMAX = ABS( A( IP, JP ) )
IPV = IP