Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the left-looking variant of geqrf following #638 #690

Merged
merged 1 commit into from
Jul 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions SRC/VARIANTS/qr/LL/cgeqrf.f
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@
C> LWORK is INTEGER
C> \endverbatim
C> \verbatim
C> The dimension of the array WORK. The dimension can be divided into three parts.
C> The dimension of the array WORK. LWORK >= 1 if MIN(M,N) = 0,
C> otherwise the dimension can be divided into three parts.
weslleyspereira marked this conversation as resolved.
Show resolved Hide resolved
C> \endverbatim
C> \verbatim
C> 1) The part for the triangular factor T. If the very last T is not bigger
Expand Down Expand Up @@ -212,7 +213,13 @@ SUBROUTINE CGEQRF ( M, N, A, LDA, TAU, WORK, LWORK, INFO )
LLWORK = MAX (MAX((N-M)*K, (N-M)*NB), MAX(K*NB, NB*NB))
LLWORK = SCEIL(REAL(LLWORK)/REAL(NB))

IF ( NT.GT.NB ) THEN
IF( K.EQ.0 ) THEN

LBWORK = 0
LWKOPT = 1
WORK( 1 ) = LWKOPT

ELSE IF ( NT.GT.NB ) THEN

LBWORK = K-NT
*
Expand All @@ -239,8 +246,9 @@ SUBROUTINE CGEQRF ( M, N, A, LDA, TAU, WORK, LWORK, INFO )
INFO = -2
ELSE IF( LDA.LT.MAX( 1, M ) ) THEN
INFO = -4
ELSE IF( LWORK.LT.MAX( 1, N ) .AND. .NOT.LQUERY ) THEN
INFO = -7
ELSE IF ( .NOT.LQUERY ) THEN
IF( LWORK.LE.0 .OR. ( M.GT.0 .AND. LWORK.LT.MAX( 1, N ) ) )
$ INFO = -7
END IF
IF( INFO.NE.0 ) THEN
CALL XERBLA( 'CGEQRF', -INFO )
Expand All @@ -252,7 +260,6 @@ SUBROUTINE CGEQRF ( M, N, A, LDA, TAU, WORK, LWORK, INFO )
* Quick return if possible
*
IF( K.EQ.0 ) THEN
WORK( 1 ) = 1
RETURN
END IF
*
Expand Down
17 changes: 12 additions & 5 deletions SRC/VARIANTS/qr/LL/dgeqrf.f
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@
C> LWORK is INTEGER
C> \endverbatim
C> \verbatim
C> The dimension of the array WORK. The dimension can be divided into three parts.
C> The dimension of the array WORK. LWORK >= 1 if MIN(M,N) = 0,
C> otherwise the dimension can be divided into three parts.
C> \endverbatim
C> \verbatim
C> 1) The part for the triangular factor T. If the very last T is not bigger
Expand Down Expand Up @@ -212,7 +213,13 @@ SUBROUTINE DGEQRF ( M, N, A, LDA, TAU, WORK, LWORK, INFO )
LLWORK = MAX (MAX((N-M)*K, (N-M)*NB), MAX(K*NB, NB*NB))
LLWORK = SCEIL(REAL(LLWORK)/REAL(NB))

IF ( NT.GT.NB ) THEN
IF( K.EQ.0 ) THEN

LBWORK = 0
LWKOPT = 1
WORK( 1 ) = LWKOPT

ELSE IF ( NT.GT.NB ) THEN

LBWORK = K-NT
*
Expand All @@ -239,8 +246,9 @@ SUBROUTINE DGEQRF ( M, N, A, LDA, TAU, WORK, LWORK, INFO )
INFO = -2
ELSE IF( LDA.LT.MAX( 1, M ) ) THEN
INFO = -4
ELSE IF( LWORK.LT.MAX( 1, N ) .AND. .NOT.LQUERY ) THEN
INFO = -7
ELSE IF ( .NOT.LQUERY ) THEN
IF( LWORK.LE.0 .OR. ( M.GT.0 .AND. LWORK.LT.MAX( 1, N ) ) )
$ INFO = -7
END IF
IF( INFO.NE.0 ) THEN
CALL XERBLA( 'DGEQRF', -INFO )
Expand All @@ -252,7 +260,6 @@ SUBROUTINE DGEQRF ( M, N, A, LDA, TAU, WORK, LWORK, INFO )
* Quick return if possible
*
IF( K.EQ.0 ) THEN
WORK( 1 ) = 1
RETURN
END IF
*
Expand Down
17 changes: 12 additions & 5 deletions SRC/VARIANTS/qr/LL/sgeqrf.f
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@
C> LWORK is INTEGER
C> \endverbatim
C> \verbatim
C> The dimension of the array WORK. The dimension can be divided into three parts.
C> The dimension of the array WORK. LWORK >= 1 if MIN(M,N) = 0,
C> otherwise the dimension can be divided into three parts.
C> \endverbatim
C> \verbatim
C> 1) The part for the triangular factor T. If the very last T is not bigger
Expand Down Expand Up @@ -212,7 +213,13 @@ SUBROUTINE SGEQRF ( M, N, A, LDA, TAU, WORK, LWORK, INFO )
LLWORK = MAX (MAX((N-M)*K, (N-M)*NB), MAX(K*NB, NB*NB))
LLWORK = SCEIL(REAL(LLWORK)/REAL(NB))

IF ( NT.GT.NB ) THEN
IF( K.EQ.0 ) THEN

LBWORK = 0
LWKOPT = 1
WORK( 1 ) = LWKOPT

ELSE IF ( NT.GT.NB ) THEN

LBWORK = K-NT
*
Expand All @@ -239,8 +246,9 @@ SUBROUTINE SGEQRF ( M, N, A, LDA, TAU, WORK, LWORK, INFO )
INFO = -2
ELSE IF( LDA.LT.MAX( 1, M ) ) THEN
INFO = -4
ELSE IF( LWORK.LT.MAX( 1, N ) .AND. .NOT.LQUERY ) THEN
INFO = -7
ELSE IF ( .NOT.LQUERY ) THEN
IF( LWORK.LE.0 .OR. ( M.GT.0 .AND. LWORK.LT.MAX( 1, N ) ) )
$ INFO = -7
END IF
IF( INFO.NE.0 ) THEN
CALL XERBLA( 'SGEQRF', -INFO )
Expand All @@ -252,7 +260,6 @@ SUBROUTINE SGEQRF ( M, N, A, LDA, TAU, WORK, LWORK, INFO )
* Quick return if possible
*
IF( K.EQ.0 ) THEN
WORK( 1 ) = 1
RETURN
END IF
*
Expand Down
17 changes: 12 additions & 5 deletions SRC/VARIANTS/qr/LL/zgeqrf.f
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@
C> LWORK is INTEGER
C> \endverbatim
C> \verbatim
C> The dimension of the array WORK. The dimension can be divided into three parts.
C> The dimension of the array WORK. LWORK >= 1 if MIN(M,N) = 0,
C> otherwise the dimension can be divided into three parts.
C> \endverbatim
C> \verbatim
C> 1) The part for the triangular factor T. If the very last T is not bigger
Expand Down Expand Up @@ -212,7 +213,13 @@ SUBROUTINE ZGEQRF ( M, N, A, LDA, TAU, WORK, LWORK, INFO )
LLWORK = MAX (MAX((N-M)*K, (N-M)*NB), MAX(K*NB, NB*NB))
LLWORK = SCEIL(REAL(LLWORK)/REAL(NB))

IF ( NT.GT.NB ) THEN
IF( K.EQ.0 ) THEN

LBWORK = 0
LWKOPT = 1
WORK( 1 ) = LWKOPT

ELSE IF ( NT.GT.NB ) THEN

LBWORK = K-NT
*
Expand All @@ -239,8 +246,9 @@ SUBROUTINE ZGEQRF ( M, N, A, LDA, TAU, WORK, LWORK, INFO )
INFO = -2
ELSE IF( LDA.LT.MAX( 1, M ) ) THEN
INFO = -4
ELSE IF( LWORK.LT.MAX( 1, N ) .AND. .NOT.LQUERY ) THEN
INFO = -7
ELSE IF ( .NOT.LQUERY ) THEN
IF( LWORK.LE.0 .OR. ( M.GT.0 .AND. LWORK.LT.MAX( 1, N ) ) )
$ INFO = -7
END IF
IF( INFO.NE.0 ) THEN
CALL XERBLA( 'ZGEQRF', -INFO )
Expand All @@ -252,7 +260,6 @@ SUBROUTINE ZGEQRF ( M, N, A, LDA, TAU, WORK, LWORK, INFO )
* Quick return if possible
*
IF( K.EQ.0 ) THEN
WORK( 1 ) = 1
RETURN
END IF
*
Expand Down