Skip to content

Is there a iterative version of select? #1108

@astrojhgu

Description

@astrojhgu

I'd like to iterate an Array along one axis over a set of selected indices. However I am not able to find such a method.

I notice that the fn select(&self, axis, &[Idx]) returns a copy, which is inefficient for read only iterative operation.

Is there such a method fulfill this purpose?

e.g., if there is hypothetical method, I'd like to use it in the way

for s in someArray.selected_indices(Axis(0), &[1,2,4,8,16]){
    //some read only operation to s
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions