Update readme#277
Merged
Merged
Conversation
johnnychen94
approved these changes
May 10, 2022
Comment on lines
+112
to
+129
| julia> D = Diagonal(OffsetArrays.no_offset_view(AO)) | ||
| 4×4 Diagonal{Float64, Vector{Float64}}: | ||
| 1.0 ⋅ ⋅ ⋅ | ||
| ⋅ 6.0 ⋅ ⋅ | ||
| ⋅ ⋅ 11.0 ⋅ | ||
| ⋅ ⋅ ⋅ 16.0 | ||
| ``` | ||
|
|
||
| If we want to restore the original indices of `AO`, we may wrap an `OffsetArray` around the `Diagonal` as: | ||
|
|
||
| ```julia | ||
| julia> Origin(AO)(D) | ||
| 4×4 OffsetArray(::Diagonal{Float64, Vector{Float64}}, 0:3, 0:3) with eltype Float64 with indices 0:3×0:3: | ||
| 1.0 ⋅ ⋅ ⋅ | ||
| ⋅ 6.0 ⋅ ⋅ | ||
| ⋅ ⋅ 11.0 ⋅ | ||
| ⋅ ⋅ ⋅ 16.0 | ||
| ``` |
Member
There was a problem hiding this comment.
For the specific 1-based case, I somehow feel the approach in #248 is more useful.
D = no_offset_view_apply(AO) do A
# do all the normal linear algebra thing in 1-based case
Diagonal(A)
end
Member
Author
There was a problem hiding this comment.
It certainly seems useful, might be worth pushing it along.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Include references to
Originandno_offset_viewin the readme, and add a table for badges to make the docs easier to discover.