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

fast byElement #82

Closed
wants to merge 1 commit into from
Closed

fast byElement #82

wants to merge 1 commit into from

Conversation

wilzbach
Copy link
Member

Hey I think I read your warning once that byElement shouldn't be used if RandomAccess is not needed.

Well I was wondering whether there is a better way to iterate element-wise through a slice and I didn't find anything, so I quickly wrote it myself.

It is so simple, that I expect this functionality to exist somewhere - so I didn't clean the code well.
In case this is really new, let me know and I am happy to invest more time.

@codecov-io
Copy link

Current coverage is 98.14%

Merging #82 into master will increase coverage by +0.03% as of 5a21d68

@@            master     #82   diff @@
======================================
  Files            7       7       
  Stmts         2498    2528    +30
  Branches         0       0       
  Methods          0       0       
======================================
+ Hit           2451    2481    +30
  Partial          0       0       
  Missed          47      47       

Review entire Coverage Diff as of 5a21d68

Powered by Codecov. Updated on successful CI builds.

In contrast to byElement, it only returns a bidirectional forward range access.
However it is faster for such operations.
*/
auto byElementIterator(size_t N, Range)(auto ref Slice!(N, Range) slice)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works only for completely dense slices in normal form. This will not work after iteration operators. If slice has completely dense normal form byElement can return an array.

@9il
Copy link
Member

9il commented Apr 13, 2016

Dont spend time for that right now ) We have more important things todo

@9il 9il closed this Apr 13, 2016
@wilzbach wilzbach mentioned this pull request Apr 13, 2016
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.

None yet

3 participants