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
similar when called with a FieldVector should output an array type equal to the input type (with possibly different eltype if specified). However the current behavior does not do this. For immutableeltypes, it converts to an MVector:
julia>using StaticArrays
julia>mutable struct Quaternion{T <:Number} <:FieldVector{4, T}
q0::T
q1::T
q2::T
q3::Tend
julia> q =Quaternion(1,2,3,4)
4-element Quaternion{Int64} with indices SOneTo(4):1234
julia>similar(q) # This should be a `Quaternion{Int64}`4-element MVector{4, Int64} with indices SOneTo(4):447245982415632051
And for mutableeltypes, a SizedVector:
julia>mutable struct MyNum{T} <:Number
num::Tend
julia> q =Quaternion{MyNum{Int64}}(MyNum(1),MyNum(2),MyNum(3),MyNum(4))
4-element Quaternion{MyNum{Int64}} with indices SOneTo(4):MyNum{Int64}(1)
MyNum{Int64}(2)
MyNum{Int64}(3)
MyNum{Int64}(4)
julia>similar(q)
4-element SizedVector{4, MyNum{Int64}, Vector{MyNum{Int64}}} with indices SOneTo(4):#undef#undef#undef#undef
The text was updated successfully, but these errors were encountered:
similar
when called with aFieldVector
should output an array type equal to the input type (with possibly differenteltype
if specified). However the current behavior does not do this. Forimmutable
eltype
s, it converts to anMVector
:And for
mutable
eltype
s, aSizedVector
:The text was updated successfully, but these errors were encountered: