-
Notifications
You must be signed in to change notification settings - Fork 5
Add some tests for randomized SVD #159
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
base: main
Are you sure you want to change the base?
Conversation
test/testsuite/svd.jl
Outdated
| minmn = min(m, n) | ||
| S₀ = collect(svd_vals(A)) | ||
| U1, S1, V1ᴴ, ϵ1 = @testinferred svd_trunc(A; alg) | ||
| @test collect(diagview(S1))[1:alg.k] ≈ S₀[1:alg.k] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, but this alg.k kind of sticks out a bit, do we always expect this property to be available?
On a separate note, should we think about whether or not the svd_trunc should really just output an S of length k to begin with?
That way, we can simply do:
@test collect(diagview(S1)) ≈ S₀[axes(S1, 1)]
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 2 files with indirect coverage changes 🚀 New features to boost your workflow:
|
adb7cda to
3afd7bc
Compare
Definitely open to feedback on this one but thought we should start testing this. Also simplified the implementation a bit to reduce repeated code.