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

Specialize setindex! for VectorOfArray{StructArray} #425

Merged
merged 2 commits into from
Mar 14, 2025

Conversation

jlchan
Copy link
Contributor

@jlchan jlchan commented Mar 14, 2025

Addresses SciML/OrdinaryDiffEq.jl#2625 (comment)

The issue is that VectorOfArray indexing will not mutate a VectorOfArray{StructArray} due to the way StructArrays treats assignment: https://juliaarrays.github.io/StructArrays.jl/stable/counterintuitive/#Modifying-a-field-of-a-struct-element. For example:

u = VectorOfArray(StructArray{MVector{1, Float64}}(ntuple(_ -> [1.0, 2.0], 1)))
u[1,1] = 100
@show u[1,1] # this is still 1.0

@jlchan
Copy link
Contributor Author

jlchan commented Mar 14, 2025

I don't think Downgrade and Format CI failures are related to this PR.

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 this pull request may close these issues.

2 participants