diff --git a/SRC/cgeqp3.f b/SRC/cgeqp3.f index 17fdd2286..4d10c2537 100644 --- a/SRC/cgeqp3.f +++ b/SRC/cgeqp3.f @@ -249,6 +249,11 @@ SUBROUTINE CGEQP3( M, N, A, LDA, JPVT, TAU, WORK, LWORK, RWORK, JPVT( J ) = J END IF 10 CONTINUE +* +* Quick return if possible. +* + IF( M.EQ.0 ) RETURN +* NFXD = NFXD - 1 * * Factorize fixed columns diff --git a/SRC/dgeqp3.f b/SRC/dgeqp3.f index a49b0838a..98c48feb6 100644 --- a/SRC/dgeqp3.f +++ b/SRC/dgeqp3.f @@ -240,6 +240,11 @@ SUBROUTINE DGEQP3( M, N, A, LDA, JPVT, TAU, WORK, LWORK, INFO ) JPVT( J ) = J END IF 10 CONTINUE +* +* Quick return if possible +* + IF( M.EQ.0 ) RETURN +* NFXD = NFXD - 1 * * Factorize fixed columns @@ -290,14 +295,14 @@ SUBROUTINE DGEQP3( M, N, A, LDA, JPVT, TAU, WORK, LWORK, INFO ) * * Determine if workspace is large enough for blocked code. * - MINWS = 2*SN + ( SN+1 )*NB + MINWS = 2*N + ( SN+1 )*NB IWS = MAX( IWS, MINWS ) IF( LWORK.LT.MINWS ) THEN * * Not enough workspace to use optimal NB: Reduce NB and * determine the minimum value of NB. * - NB = ( LWORK-2*SN ) / ( SN+1 ) + NB = ( LWORK-2*N ) / ( SN+1 ) NBMIN = MAX( 2, ILAENV( INBMIN, 'DGEQRF', ' ', SM, $ SN, $ -1, -1 ) ) diff --git a/SRC/sgeqp3.f b/SRC/sgeqp3.f index 10b8bf94e..6c31761c3 100644 --- a/SRC/sgeqp3.f +++ b/SRC/sgeqp3.f @@ -237,6 +237,11 @@ SUBROUTINE SGEQP3( M, N, A, LDA, JPVT, TAU, WORK, LWORK, INFO ) JPVT( J ) = J END IF 10 CONTINUE +* +* Quick return if possible. +* + IF( M.EQ.0 ) RETURN +* NFXD = NFXD - 1 * * Factorize fixed columns @@ -287,14 +292,14 @@ SUBROUTINE SGEQP3( M, N, A, LDA, JPVT, TAU, WORK, LWORK, INFO ) * * Determine if workspace is large enough for blocked code. * - MINWS = 2*SN + ( SN+1 )*NB + MINWS = 2*N + ( SN+1 )*NB IWS = MAX( IWS, MINWS ) IF( LWORK.LT.MINWS ) THEN * * Not enough workspace to use optimal NB: Reduce NB and * determine the minimum value of NB. * - NB = ( LWORK-2*SN ) / ( SN+1 ) + NB = ( LWORK-2*N ) / ( SN+1 ) NBMIN = MAX( 2, ILAENV( INBMIN, 'SGEQRF', ' ', SM, $ SN, $ -1, -1 ) ) diff --git a/SRC/zgeqp3.f b/SRC/zgeqp3.f index ba07cbc42..7f40a9138 100644 --- a/SRC/zgeqp3.f +++ b/SRC/zgeqp3.f @@ -249,6 +249,11 @@ SUBROUTINE ZGEQP3( M, N, A, LDA, JPVT, TAU, WORK, LWORK, RWORK, JPVT( J ) = J END IF 10 CONTINUE +* +* Quick return if possible. +* + IF( M.EQ.0 ) RETURN +* NFXD = NFXD - 1 * * Factorize fixed columns