Skip to content

similar(v) broken for v::VectorOfArray #23

Description

@Gregstrq

similar(v) for v::VectorOfArray{T, N, A} gives you an instance of AbstractArray{T,N} instead of another VectorOfArray.
MWE:

a = VectorOfArray([[1,2,3,4,5],[6,7,8,9,10]])
similar(a)

gives you a 5×2 Array{Int64,2}.

I guess you can write something like

@inline Base.similar(VA::AbstractVectorOfArray) = VectorOfArray([similar(VA[i]) for i in eachindex(VA)])

to deal with this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions