Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR replaces the previous
svd
functionality withMatrixAlgebraKit.svd_compact
andMatrixAlgebraKit.svd_full
.The main idea is to have a
BlockDiagonalAlgorithm
wrappertype to dispatch on, which flags that we will assume the inputAbstractBlockSparseMatrix
is either blockdiagonal or can be permuted to that form.The main reason I chose this approach is that there really is no dedicated
BlockDiagonal
functionality, and I wanted to implement the factorizations without having to first fix a bunch of utility functions for that specific type.There definitely is a bunch of bookkeeping involved with this, especially for the
full
decomposition combined with the ability of empty rows and columns and rectangular inputs.I'd say the fishiest part of this PR is the added function for
GetUnstoredBlock
whenDiagonal
matrices are involved, but I feel like this is warranted since that is also howLinearAlgebra.jl
handles this.I'm curious to hear what you think about this, I'd suggest trying to figure this out first and getting this merged, and adding the truncation and the other factorizations in follow-up PRs.
The truncation should be somewhat orthogonal to this anyways, and the other factorizations should almost be copies of this one so getting this figured out first seems reasonable.
Also, I deleted the old
SVD
implementation since I don't think that is a durable approach in the long run.This does make it a breaking change, which in principle isn't entirely necessary.