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

xGEQP3 changes July 2024 #1035

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions SRC/cgeqp3.f
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use MINMN.EQ.0?

Copy link
Author

@frjohnst frjohnst Jul 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used M.EQ.0 because I was trying to change the code as little as possible.
MINMN.EQ.0 would be equivalent to M.EQ.0 .OR. N.EQ.0.
The N=0 case appears to work with the existing code (NFXD is 0 when N=0 and most code is skipped).

But I have no objection to replacing M.EQ.0 with MINMN.EQ.0.
If this additional change is required, what would be the best way to accomplish this?
(Please forgive my ignorance, I am not very familiar with git.)

Could the PR be accepted in it's current form in order to pick up the work space fix and since it does function correctly as it is now? I would be happy to submit a second PR which changes M.EQ.0 to MINMN.EQ.0 in all 4 xGEQP3 files. Is that acceptable? (I am afraid I don't know how to update the contents of an open PR, but I can try to find out, if needed.)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, perhaps I would only need to change M.EQ.0 to MINMN.EQ.0 and do a second
git commit ...
from the same branch? Do you want me to try that?

*
NFXD = NFXD - 1
*
* Factorize fixed columns
Expand Down
9 changes: 7 additions & 2 deletions SRC/dgeqp3.f
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ) )
Expand Down
9 changes: 7 additions & 2 deletions SRC/sgeqp3.f
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ) )
Expand Down
5 changes: 5 additions & 0 deletions SRC/zgeqp3.f
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down