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

Use OffsetArrays #6

Open
jmert opened this issue May 15, 2020 · 2 comments
Open

Use OffsetArrays #6

jmert opened this issue May 15, 2020 · 2 comments

Comments

@jmert
Copy link
Owner

jmert commented May 15, 2020

Since the Associated Legendre Polynomials are naturally 0-indexed, we should take advantage of the OffsetArrays package and work with 0-indexed arrays.

@jmert
Copy link
Owner Author

jmert commented May 18, 2020

It looks like CustomUnitRanges.jl provides a ZeroRange type which will probably be needed to get 0-indexed OffsetArrays without the overhead of an unknown start index (as I expect will happen if you use regular UnitRanges).

@jmert
Copy link
Owner Author

jmert commented Jun 4, 2020

OffsetArrays store an offset as a struct field, so the fact that CustomUnitRanges.jl provides a type-based zero-indexed range type doesn't actually lift the indexing calculations to the type domain/compile time.

I haven't yet checked whether LLVM can lift the index offset out of the inner loops to avoid the overhead or not, but as a practical matter it might be easier to instead add an interface which accepts OffsetArray inputs, validates the range of the degree/order dimensions has a zero starting index, and then passes the underlying parent Arrays to the inner calculation function. That way OffsetArrays also becomes an optional interface rather than a necessary one.

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

No branches or pull requests

1 participant