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

Implement getindex and view for AbstractZero #269

Open
sethaxen opened this issue Dec 24, 2020 · 2 comments
Open

Implement getindex and view for AbstractZero #269

sethaxen opened this issue Dec 24, 2020 · 2 comments
Labels
good first issue Good for newcomers LinearOperators For issues relating to defining linear operators on AbstractDifferentials

Comments

@sethaxen
Copy link
Member

It would be handy to add something like the following overloads:

getindex(x::AbstractZero, i..) = x
view(x::AbstractZero, i...) = x

since a Zero if interpreted as an array can only have Zero subarrays or elements. This would make it so rules that depend only on certain elements of a differential don't necessarily have to special-case to work around possible Zero arrays but can instead just index them as normal.

@oxinabox oxinabox added the LinearOperators For issues relating to defining linear operators on AbstractDifferentials label Dec 24, 2020
@oxinabox
Copy link
Member

Agreed.
Also getproperty so it can pretend to be a struct.

@sethaxen
Copy link
Member Author

Maybe also get so it can pretend to be something with keys?

@mzgubic mzgubic added the good first issue Good for newcomers label Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers LinearOperators For issues relating to defining linear operators on AbstractDifferentials
Projects
None yet
Development

No branches or pull requests

3 participants