Algebraic-Programming / ALP

Home of ALP/GraphBLAS and ALP/Pregel, featuring shared- and distributed-memory auto-parallelisation of linear algebraic and vertex-centric programs. Soon with more to come!
Apache License 2.0
25 stars 4 forks source link

Are all grb::Vector iterators random access iterators? #220

Open anyzelman opened 1 year ago

anyzelman commented 1 year ago

Ideal behaviour is that iterators are random access. This issue is to check whether that is currently the case, and if not, fix that, as for all currently implemented backends random access iteration should be possible.

(However, not for all backends that could be envisioned would random access iterators be appropriate -- consider, e.g., file-backed backends. Therefore at least my current thinking is that it should be a backend choice to have random access output iterators, though I would be happy to discuss more if this seems like a bad idea. Go-betweens the two extremes are also possible -- e.g., demand that all backends implement PARALLEL I/O mode iterators are random access, rather than both PARALLEL and SEQUENTIAL mode iterators. But in all cases, when iterators could be random access, they should be.)

anyzelman commented 1 year ago

Confirmed that at current, the vector iterator in reference/vector.hpp is a forward iterator, not random.