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.
Description
Changes the kaczmarz solver to work for sparse matrices and vectors when
Samplingcompressor is used.Fixes #135
Motivation and Context
Currently, using Kaczmarz with a sparse matrix and
Samplingcompressor it returns an error about being unable to convert a SparseArray to an Array. This is because in the initial allocations, only dense arrays were allocated. To fix this a few changes needed to be made.complete_solverfunction that performed preallocations of sparse arrays if aSamplingcompressor is used with a sparse matrix.*implementation for theSamplingcompressor to preallocateSparseArrayswhen being applied to sparse objects.SamplingandKaczmarzstructures that check the code on sparse matrices.How has this been tested
The following code should now work.
Additionally, the new tests now incorporate sparse matrices in the completion of the solver and in the block update steps, which should be sufficient for ensuring that everything works as expected for sparse matrices in the future.
Types of changes
Checklists:
Code and Comments
If this PR includes modification to the code base, please select all that apply.
API Documentation
Manual Documentation
Testing
@code_lowered and
@code_typed)