Skip to content

Conversation

@ChrisRackauckas
Copy link
Member

Fixes #410

This specializes so that if u.u is not a vector, it will convert the broadcast to fix that. I couldn't find a nice generic way to use map so the fallback is to build the vector and convert, which seems to not be a big performance issue. For StructArrays, convert(typeof(x), Vector(x)) fails, and so this case is specialized.

Fixes #410

This specializes so that if `u.u` is not a vector, it will convert the broadcast to fix that. I couldn't find a nice generic way to use `map` so the fallback is to build the vector and convert, which seems to not be a big performance issue. For StructArrays, `convert(typeof(x), Vector(x))` fails, and so this case is specialized.
@ChrisRackauckas ChrisRackauckas merged commit 0beb98e into master Nov 20, 2024
18 of 29 checks passed
@ChrisRackauckas ChrisRackauckas deleted the structarray_broadcast branch November 20, 2024 17:19
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.

Broadcasting over VectorOfArray does not preserve type of parent array

2 participants