refactor div-conq SVD, impl svd_rand #165
Open
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.
credit to @pmarks for original svd_rand impl
This should probably be 2 PRs, but I wanted to post it here for discussion first.
First, I moved
svddc
tosvd_dc
(so we can havesvd_rand
), and movedsvd_dc
under theSVD_
trait, de-duplicating a lot of logic.I also implement
svd_rand
, though this version does not have the changes required for complex numbers, which we definitely want. This is dependent on a set of complex trait requirements that just works forArray2
, but is needed for sparse representations of matrices (be they sprs or a low-rank representation likeM = u.dot(&v)
.I also add an optional feature on sprs, though right now only @pmarks branch of sprs implements the Dot traits required to make
svd_rand
function.