Skip to content

Parallel indexed iterator #279

Closed
Closed
@msiglreith

Description

@msiglreith

IndexedIter and IndexedIterMut should have parallel iterator support.

Often it's desirable to have the element coordinates additionally to the element itself for accessing fields in other arrays. Example use case (part of fluid simulation code):

div.indexed_iter_mut().map(|((y, x), div)| {
    *div = -(vel.x[(y, x+1)] - vel.x[(y, x)] + vel.y[(y+1, x)] - vel.y[(y, x)]);
});

I quickly tried to implement it myself, similar to the AxisIter implementation, but unsure how to properly split the iterator.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions