Skip to content

Hard reshape #33

@AntonOresten

Description

@AntonOresten

There should be a hard, copying, reshape that copies to avoid double wrappers. See #4.

Basically:

julia> reshape(transpose(rand(2,3)), :) |> typeof
Base.ReshapedArray{Float64, 1, LinearAlgebra.Transpose{Float64, Matrix{Float64}}, Tuple{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64}}}

julia> reshape(copy(transpose(rand(2,3))), :) |> typeof
Vector{Float64} (alias for Array{Float64, 1})

It should be used on arrays going in as well, in case they're already wrapped, such that we don't end up with a quadruple wrapper.

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