Skip to content

Follow up on pr1146#1214

Closed
langou wants to merge 4 commits intoReference-LAPACK:masterfrom
langou:follow_up_on_PR1146
Closed

Follow up on pr1146#1214
langou wants to merge 4 commits intoReference-LAPACK:masterfrom
langou:follow_up_on_PR1146

Conversation

@langou
Copy link
Copy Markdown
Contributor

@langou langou commented Mar 26, 2026

Follow up on PR #1146. ( Thanks to @yizeyi18 for the PR.)

While reviewing, @angsch suggested

Shouldn't jobu = 'f' and jobu = 'r' be included here too?

I implemented the suggestion. This ended being easier for me to do a substantial rewrite.

I followed the explanation at

lapack/SRC/cgesvdq.f

Lines 159 to 198 in 034ada1

*> \param[out] U
*> \verbatim
*> U is COMPLEX array, dimension
*> LDU x M if JOBU = 'A'; see the description of LDU. In this case,
*> on exit, U contains the M left singular vectors.
*> LDU x N if JOBU = 'S', 'U', 'R' ; see the description of LDU. In this
*> case, U contains the leading N or the leading NUMRANK left singular vectors.
*> LDU x N if JOBU = 'F' ; see the description of LDU. In this case U
*> contains N x N unitary matrix that can be used to form the left
*> singular vectors.
*> If JOBU = 'N', U is not referenced.
*> \endverbatim
*>
*> \param[in] LDU
*> \verbatim
*> LDU is INTEGER.
*> The leading dimension of the array U.
*> If JOBU = 'A', 'S', 'U', 'R', LDU >= max(1,M).
*> If JOBU = 'F', LDU >= max(1,N).
*> Otherwise, LDU >= 1.
*> \endverbatim
*>
*> \param[out] V
*> \verbatim
*> V is COMPLEX array, dimension
*> LDV x N if JOBV = 'A', 'V', 'R' or if JOBA = 'E' .
*> If JOBV = 'A', or 'V', V contains the N-by-N unitary matrix V**H;
*> If JOBV = 'R', V contains the first NUMRANK rows of V**H (the right
*> singular vectors, stored rowwise, of the NUMRANK largest singular values).
*> If JOBV = 'N' and JOBA = 'E', V is used as a workspace.
*> If JOBV = 'N', and JOBA.NE.'E', V is not referenced.
*> \endverbatim
*>
*> \param[in] LDV
*> \verbatim
*> LDV is INTEGER
*> The leading dimension of the array V.
*> If JOBV = 'A', 'V', 'R', or JOBA = 'E', LDV >= max(1,N).
*> Otherwise, LDV >= 1.
*> \endverbatim

Copy link
Copy Markdown
Collaborator

@mgates3 mgates3 left a comment

Choose a reason for hiding this comment

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

Haven't completed review, but this needs fix, I think.

nrows_u = m;
ncols_u = m;
}
if( API_SUFFIX(LAPACKE_lsame)( jobu, 's' ) ||
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

else if, otherwise for jobu = 'a', the else clause below will set nrows_u = 1, ncols_u = 1.

Same in other precisions.

@langou langou closed this Mar 28, 2026
@langou
Copy link
Copy Markdown
Contributor Author

langou commented Mar 28, 2026

Note: I created a new PR (PR #1221) to address the comment of @mgates3.

@mgates3
Copy link
Copy Markdown
Collaborator

mgates3 commented Mar 30, 2026

@langou You can just keep pushing changes to the same PR -- even rebase and force push changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants