Refactor and improve iterators#502
Merged
jturner314 merged 14 commits intorust-ndarray:masterrust-ndarray/ndarray:masterfrom Oct 24, 2018
jturner314:refactor-iteratorsjturner314/ndarray:refactor-iteratorsCopy head branch name to clipboard
Merged
Refactor and improve iterators#502jturner314 merged 14 commits intorust-ndarray:masterrust-ndarray/ndarray:masterfrom jturner314:refactor-iteratorsjturner314/ndarray:refactor-iteratorsCopy head branch name to clipboard
jturner314 merged 14 commits intorust-ndarray:masterrust-ndarray/ndarray:masterfrom
jturner314:refactor-iteratorsjturner314/ndarray:refactor-iteratorsCopy head branch name to clipboard
Conversation
The old name was misleading because this struct is designed to iterate over any axis, not just the outermost axis.
This replaces these free functions with `new` methods on `AxisIter` and `AxisIterMut`.
Removing the macro makes the code easier to understand without being much more verbose.
It's simpler to treat `Baseiter` as just an iterator over pointers, with no lifetime information. Lifetimes should be handled as necessary by the wrappers around `Baseiter`.
f50b919 to
0948409
Compare
Member
|
From an API point of view this looks great! |
Member
Author
|
@LukeMathWalker Thanks for taking a look! |
Member
|
Nice! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR does the following:
Removes lots of iterator constructor functions and replaces them with
newmethods on the iterators. This is more conventional, easier to understand, and requires fewer imports.Renames
OuterIterCoretoAxisIterCoreto better reflect its purpose.Refactors
.split_at()forAxisIterandAxisIterMutto eliminate theaxis_iter_split_at_impl!macro.Removes the lifetime from
Baseiterand implements iterator traits forBaseiter. This is mostly a conceptual simplification. It will also make it more straightforward to extend the iterators toArrayPtr/ArrayPtrMutin Add raw array pointer types #496.Improve docs and implement
CloneforLanesIter.