New design for handling unstored values #65
Merged
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 introduces a new design for how unstored values are represented. Instead of a function that generates the unstored values, it is now based around a function
unstored(a::AbstractArray)that returns an array that is the same shape asathat when indexed returns the unstored value at that index. By default, that array will be aFillArrays.Zeros, but it can be customized, for example in the case of an array of arrays representing a block array.Note this is an idea brought up in QuantumKitHub/SparseArrayKit.jl#13.
The motivation is BlockSparseArrays.jl, this design makes it easier to preserve how the zero/unstored values get generated when new sparse arrays are constructed with
similarandcopy. This PR makes it easier to update BlockSparseArrays.jl to #63.