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

Iterators #10

Open
bassoy opened this issue May 28, 2018 · 4 comments
Open

Iterators #10

bassoy opened this issue May 28, 2018 · 4 comments
Assignees
Labels
discussion Discussion for future refactoring gsoc Google Summer of Code

Comments

@bassoy
Copy link
Collaborator

bassoy commented May 28, 2018

I am not sure if iterators need to be visible for the user of the library. Does a physicist or mathematician want to deal with iterators instead of indices?

@bassoy bassoy added the discussion Discussion for future refactoring label May 28, 2018
@bassoy bassoy self-assigned this May 28, 2018
@stefanseefeld
Copy link

I have yet to understand the exact differences between iterators and indices, but my experience tought me that while indices are convenient, they don't perform very well. Thus whenever a user needs to add a new algorithm involving iteration over an entire tensor, being able to use iterators may yield vastly better performance.
(It might be useful to write a benchmark that does some whole-tensor computation, based on iterators vs indices, to compare performance.)

@bassoy
Copy link
Collaborator Author

bassoy commented May 29, 2018

I was thinking of users who only need built-in functions. Also there is a discussion comparing iterator-based approaches versus ranges discussion1 and discussion2. So maybe we could design multidimensional ranges instead of multidimensional iterators?

In case of new algorithm, pointers and iterators are definitely advantageous. Actually this is part of my dissertation and I have published and discussed runtime results of different implementations of entry-wise tensor operations in LNCS 10860. I'll link the paper as soon as it is online. So I think we can use my findigs here.

@stefanseefeld
Copy link

Very good ! So to come back to your original question: Are you wondering whether / how to expose iterators to users ? Perhaps we can frame the question as "how to extend ublas with custom algorithms ?".

@bassoy
Copy link
Collaborator Author

bassoy commented May 29, 2018

Yes. In other words, what API layer / data structure should provide iterators?

  1. We could place begin() and end() functions within the Data data structure using the nomenclature of VSIPL++.
  2. We could also offer overloaded free begin() and end() or even range() functions with which users could interact with std::transform like algorithms.

@bassoy bassoy added the gsoc Google Summer of Code label Jul 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Discussion for future refactoring gsoc Google Summer of Code
Projects
None yet
Development

No branches or pull requests

3 participants