Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement pointer and resize! for VectorOfArray #300

Closed
ranocha opened this issue Dec 18, 2023 · 0 comments · Fixed by #302
Closed

Implement pointer and resize! for VectorOfArray #300

ranocha opened this issue Dec 18, 2023 · 0 comments · Fixed by #302

Comments

@ranocha
Copy link
Member

ranocha commented Dec 18, 2023

This came up in https://github.com/SciML/OrdinaryDiffEq.jl/pull/2087/files and the related PR SciML/SciMLBase.jl#561. It would be great if the following operations were allowed:

julia> using Pkg; Pkg.activate(temp = true); Pkg.add(["StaticArrays", "RecursiveArrayTools"])
[...]
  [731186ca] + RecursiveArrayTools v3.0.0
  [90137ffa] + StaticArrays v1.7.0
[...]

julia> using StaticArrays, RecursiveArrayTools

julia> u = VectorOfArray(ones(SVector{2, Float64}))
VectorOfArray{Float64,1}:
2-element SVector{2, Float64} with indices SOneTo(2):
 1.0
 1.0

julia> resize!(u, 5)
ERROR: MethodError: no method matching resize!(::VectorOfArray{Float64, 1, SVector{2, Float64}}, ::Int64)
[...]

julia> pointer(u)
ERROR: MethodError: no method matching pointer(::VectorOfArray{Float64, 1, SVector{2, Float64}})
[...]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant