Skip to content

2-by-1 CS decomposition fixes #405

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

Merged

Conversation

christoph-conrads
Copy link
Contributor

@christoph-conrads christoph-conrads commented Apr 22, 2020

This pull request improves xUNCSD2BY1 and xORCSD2BY1.

  • The LRWORK argument to xUNCSD2BY() is checked.
  • The actual LRWORK value is passed to xBBCSD() inside xUNCSD2BY() instead of passing the minimum allowed LRWORK value.
  • U2 may be obviously not orthogonal or unitary, respectively, for certain input matrix dimension because xORGQR() and xUNGQR() may overwrite the scalar factors of the elementary reflectors when assembling U1. On the author's computer, this happens, e.g., with m=260, q=131, and p=130 (these values may be dependent on the blocking size).
  • xUNCSD2BY1 assume workspace queries when LRWORK = -1. This is also the behavior exhibited by, e.g., xHEEVD.

The U2 orthogonality issue is caused by xORGQR() / xUNGQR() using more than the minimum workspace available. The issue can be either fixed by

  • restricting the available workspace to the required minimum (here: P) or
  • copying the scalar factors.

The patch choses the latter approach.

@codecov
Copy link

codecov bot commented Apr 22, 2020

Codecov Report

Merging #405 (0c32d4b) into master (6281084) will decrease coverage by 0.00%.
The diff coverage is 87.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #405      +/-   ##
==========================================
- Coverage   83.33%   83.33%   -0.01%     
==========================================
  Files        1820     1820              
  Lines      170849   170857       +8     
==========================================
+ Hits       142378   142384       +6     
- Misses      28471    28473       +2     
Impacted Files Coverage Δ
SRC/cuncsd2by1.f 89.91% <83.33%> (-0.31%) ⬇️
SRC/zuncsd2by1.f 89.91% <83.33%> (-0.31%) ⬇️
SRC/dorcsd2by1.f 90.13% <100.00%> (+0.04%) ⬆️
SRC/sorcsd2by1.f 90.13% <100.00%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6281084...0c32d4b. Read the comment docs.

@christoph-conrads
Copy link
Contributor Author

Hi, do you want me to rebase?

@langou
Copy link
Contributor

langou commented Jan 25, 2021

Hi Christoph, yes, if you can rebase, this would be great. Cheers, Julien.

@christoph-conrads
Copy link
Contributor Author

Hi Christoph, yes, if you can rebase, this would be great. Cheers, Julien.

done

@christoph-conrads
Copy link
Contributor Author

Hi @langou, I just rebased onto commit 0e41cf0.

* check LRWORK
* pass actual LRWORK value to xBBCSD
The xORCSD2BY1/xUNCSD2BY1 output matrix U2 was clearly not
orthogonal/unitary for certain input matrix dimensions m, p, and q
(e.g., m = 260, p=130, q=131). The reason was an accidental overwrite of
data by xORGQR()/xUNGQR() when the WORK array was apparently large
enough to use blocking.
Previously, xUNCSD2BY1 only allowed workspace queries by passing
LWORK=-1 (note the missing "R"). The new commit makes xUNCSD2BY1 behave,
e.g., like xHEEVD.
@langou langou merged commit 3ea9f5a into Reference-LAPACK:master Feb 17, 2021
@langou
Copy link
Contributor

langou commented Feb 17, 2021

Thanks @christoph-conrads, that's great. Julien

@christoph-conrads christoph-conrads deleted the csd2by1-fixes-20200422 branch February 21, 2021 18:16
christoph-conrads pushed a commit to christoph-conrads/lapack that referenced this pull request May 23, 2021
…1-fixes-20200422

2-by-1 CS decomposition fixes
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.

3 participants