Skip to content

Make ArrayView(Mut)'s parallel iterators implement IndexedParallelIterator #964

@cassiersg

Description

@cassiersg

Axis iterators can be used as IndexedParallelIterator, but it is not the case for ArrayBase, as shown below:

use rayon::prelude::*;
fn main() {
    let a = ndarray::Array1::<u32>::zeros(5);
    test_into_par_iter(&a);
    test_into_par_iter_indexed(&a); // <- Does not compile.
}
fn test_into_par_iter<T: IntoParallelIterator>(_x: T) {}
fn test_into_par_iter_indexed<T: IntoParallelIterator>(_x: T)
where
    T::Iter: IndexedParallelIterator,
{
}

From an outsider perspective, such an implementation appears to be possible. Is it intentionally omitted, or could it be added ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions