-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix a[..] .= something
#27
Conversation
…ntained already in test/Project.toml)
# avoid copying if indexing with .. alone, see | ||
# https://github.com/JuliaDiffEq/OrdinaryDiffEq.jl/issues/214 | ||
@inline Base.getindex(A::AbstractArray, ::Ellipsis) = A | ||
@inline ArrayInterface.getindex(A, ::Ellipsis) = A |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the timing okay without this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue mentioned there is still open. We discussed streamlining the interpolation codes using ..
, but didn't implement it (as far as I remember). The only difference will be when calling A[..]
. If it's on the left-hand side, it can subtly break (as fixed in this PR). If it's on the right-hand side, it's an indexing operation anyways and should be consistent in creating a copy of the data. So I think this should be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have some specific tests in mind?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does it do without these dispatches? Does it make a copy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, without these definitions A[..]
behaves as A[:]
.
I noticed that ab assignment of the form
a[..] .= something
did not work. Hence, I deleted the offendinggetindex
overload in EllipsisNotation. The comment there referred to a still open issue that does not seem to be active right now.If these changes are okay, it would be nice to have a new release.