-
Notifications
You must be signed in to change notification settings - Fork 2
Blockdiagonal factorizations refactor #166
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
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #166 +/- ##
==========================================
- Coverage 75.37% 73.41% -1.96%
==========================================
Files 37 37
Lines 2091 2046 -45
==========================================
- Hits 1576 1502 -74
- Misses 515 544 +29
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
aa3d144
to
6a1152e
Compare
36e3865
to
d63cc94
Compare
d63cc94
to
d926f52
Compare
@mtfishman , I think I've more or less covered most functions now. I've had to step back from the I also tackled the truncated decompositions, which I think have simplified as well, since these now also only need to handle blockdiagonal arrays. I'm now a bit confused about what it means for I hope to start tackling the gradedarrays version next week, but in principle I think this is good to go if all tests pass. (or at least ready for another round of review) |
That all sounds great, thanks. I'll take a look.
I thought we would require that the input to |
Ok, I'll adapt this too |
This PR is the start of the refactor required to implement the factorizations by first mapping from blockpermuteddiagonal to blockdiagonal, and then implementing the factorization.
In order to make this work I changed some things around:
I created a second algorithm type:
BlockDiagonalAlgorithm
andBlockPermutedDiagonalAlgorithm
now both exist.The latter simply permutes, then calls the implementation of the former, and then permutes back.
This approach seems quite elegant and works quite nice, but as a consequence I didn't really figure out how to deal with pre-allocating any output. Therefore now the
BlockPermutedDiagonal
simply ignores the initialized output, and it is theBlockDiagonalAlgorithm
that really does something ininitialize_output
.I also went a bit back and forth between wanting to pre-allocate the blocks for U and V for the missing rows/cols or not. It seems that this doesn't really make a big difference, and not doing so definitely simplifies the code a bit so this might be reasonable.
Given this, it might even be reasonable to simply avoid filling up the blocks at all: we could just call
svd_*!(@view(A[]), alg)
and let the allocation be handled by lower level functions. Given that we currently are not really in a spot to really reuse the memory, and the change with the two algorithms more or less prevents us from really providing output arrays, this could be a reasonable change as well.I'd appreciate some feedback before I push this through to the other factorizations as well!
Fixes #162 and is a replacement of #164