Skip to content
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

getindex(A::AbstractArray, ::Val{:..}) #13

Merged
merged 1 commit into from
Oct 20, 2017

Conversation

ranocha
Copy link
Member

@ranocha ranocha commented Oct 20, 2017

@ranocha
Copy link
Member Author

ranocha commented Oct 20, 2017

I'm just curious: Why do you use only Travis and not AppVeyor for this repository?

@ChrisRackauckas
Copy link
Member

No reason, just never got it setup.

@ChrisRackauckas ChrisRackauckas merged commit 787a2ed into SciML:master Oct 20, 2017
@ranocha
Copy link
Member Author

ranocha commented Oct 20, 2017

Okay, I thought I might have missed something.

@mbauman
Copy link
Contributor

mbauman commented Oct 20, 2017

This seems a little strange to me — why extend getindex here instead of view?

@ChrisRackauckas
Copy link
Member

ChrisRackauckas commented Oct 20, 2017

SciML/OrdinaryDiffEq.jl#214

I wanted it to be the identity operation A[..] === A. Since it's over the full thing, I'm not sure a view is necessary.

Mostly it's to make that broadcasting free.

@mbauman
Copy link
Contributor

mbauman commented Oct 20, 2017

My point is purely semantics. I'd expect A[..] to copy and view(A, ..) to alias. Making the former an identity is far more surprising than the latter.

I'm beginning to think the @. should imply @views. You're probably the heaviest user of @. — what would you think about that?

@ChrisRackauckas
Copy link
Member

Anytime I do @. with [idxs] I put @views. For a single broadcast I am not sure there's a case where this is not beneficial (of course if you use the save views/slices over and over, that can be a different story though, or in matrix computations).

I would think it would help a lot of people if @. used views since the whole idea of it is "it's fusing everything so I expect it to not allocate", which isn't true when you are only doing a subset of indices without @views.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants