Skip to content

svd!: allow lower bidiagonal #156

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dpo
Copy link

@dpo dpo commented Jul 16, 2025

Close JuliaLinearAlgebra/TSVD.jl#33

TSVD requires the SVD of a lower bidiagonal matrix. If the element type is not one supported by LAPACK and if GenericLinearAlgebra is imported, the call dispatches to it. However, GenericLinearAlgebra only implements the SVD of an upper bidiagonal.
This PR introduces a helper function to pass the transposed of the bidiagonal if the latter is a lower bidiagonal.
As a result, the truncated SVD of a matrix of, say, BigFloat, is now possible.

Close JuliaLinearAlgebra/TSVD.jl#33

TSVD requires the SVD of a lower bidiagonal matrix.
If the element type is not one supported by LAPACK and if
GenericLinearAlgebra is imported, the call dispatches to it.
However, GenericLinearAlgebra only implements the SVD of an *upper*
bidiagonal.
This PR introduces a helper function to pass the transposed of the
bidiagonal if the latter is a lower bidiagonal.
As a result, the truncated SVD of a matrix of, say, BigFloat, is now
possible.
@dpo
Copy link
Author

dpo commented Jul 16, 2025

I'm happy to remove the if statement in __svd_helper!() but wanted to keep the diff small for clarity.

Copy link

codecov bot commented Jul 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.32%. Comparing base (ec4784b) to head (07dd4c7).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #156   +/-   ##
=======================================
  Coverage   96.32%   96.32%           
=======================================
  Files          10       10           
  Lines        1441     1443    +2     
=======================================
+ Hits         1388     1390    +2     
  Misses         53       53           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Error on tsvd(::Matrix{Double64})
1 participant