Skip to content

Conversation

@kshyatt
Copy link
Member

@kshyatt kshyatt commented Jan 23, 2026

Definitely open to feedback on this one but thought we should start testing this. Also simplified the implementation a bit to reduce repeated code.

@kshyatt kshyatt requested a review from lkdvos January 23, 2026 11:23
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]
Copy link
Member

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
Copy link

codecov bot commented Jan 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/implementations/svd.jl 91.66% <100.00%> (+11.42%) ⬆️

... and 2 files with indirect coverage changes

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

@kshyatt kshyatt force-pushed the ksh/randomized_svd branch from adb7cda to 3afd7bc Compare January 23, 2026 18:56
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