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

provide type-inferred length #138

Open
bgctw opened this issue Jun 3, 2022 · 0 comments · May be fixed by #139
Open

provide type-inferred length #138

bgctw opened this issue Jun 3, 2022 · 0 comments · May be fixed by #139

Comments

@bgctw
Copy link

bgctw commented Jun 3, 2022

A maybe-nice feature request.

Using StaticArrays.jl often helps avoiding allocation in bottle-neck code. When creating the StaticArray, the length or size must be known to the compiler.
ComponentArrays have this information in its type in its axes. However, currently length and size are based on the underlying array, for which the size might not be known at compile time.

I suggest implementing Base.length for an Axis and use this to implement Base.length and Base.size on getaxes(cv).

bgctw added a commit to bgctw/ComponentArrays.jl that referenced this issue Jun 3, 2022
resolves jonniedie#138
Need to check correct general computation of length of Axis.
@bgctw bgctw linked a pull request Jun 3, 2022 that will close this issue
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 a pull request may close this issue.

1 participant