Skip to content

What is the standard way to bring arrays into standard order? #441

@ExpHP

Description

@ExpHP

Suppose I have an arbitrary array; any model of ownership, any number of dimensions, possibly non-contiguous, with strides in whatever order. How do I get an owned array in standard layout? And could it be better documented?

Based on the documentation of ArrayBase alone, it seems to me that the following is the only safe bet:

Array::from_shape_vec(arr.raw_dim(), arr.iter().cloned().collect())

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