You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The result is a 3-element Vector{Int64} of values 11, 22 and 33. Is it possible to get the result in SVector since the length is known at compile time (assuming that the codes above is inside a function, and that v has fixed but unknown length)?
Other methods I tried but not did not work:
I tried to use comprehension and macro @SVector, but it seems that in this case I need length(v) but its value is unknown during macro expansion.
I also tried eachindex(v) but it seems that the result is converted to MVector instead of SVector. This part seems to have been covered in map SOneTo to SVector #1032
The text was updated successfully, but these errors were encountered:
drelatgithub
changed the title
Is it possible to map enumeration to SVector
Is it possible to map enumeration to SVector?
Nov 5, 2022
When I do the following:
The result is a 3-element
Vector{Int64}
of values 11, 22 and 33. Is it possible to get the result inSVector
since the length is known at compile time (assuming that the codes above is inside a function, and thatv
has fixed but unknown length)?Other methods I tried but not did not work:
@SVector
, but it seems that in this case I needlength(v)
but its value is unknown during macro expansion.eachindex(v)
but it seems that the result is converted toMVector
instead ofSVector
. This part seems to have been covered in map SOneTo to SVector #1032The text was updated successfully, but these errors were encountered: