@@ -116,12 +116,12 @@ end
116
116
@pure similar_type {SA<:StaticArray,N} (:: Union{SA,Type{SA}} , sizes:: Tuple{Vararg{Int,N}} ) = SArray{sizes, eltype (SA), N, prod (sizes)}
117
117
118
118
# Some specializations for the mutable case
119
- @pure similar_type {MA<:Union{MVector,MMatrix,MArray}} (:: Union{MA,Type{MA}} , size:: Int ) = MVector{size, eltype (MA)}
120
- @pure similar_type {MA<:Union{MVector,MMatrix,MArray}} (:: Union{MA,Type{MA}} , sizes:: Tuple{Int} ) = MVector{sizes[1 ], eltype (MA)}
119
+ @pure similar_type {MA<:Union{MVector,MMatrix,MArray,SizedArray }} (:: Union{MA,Type{MA}} , size:: Int ) = MVector{size, eltype (MA)}
120
+ @pure similar_type {MA<:Union{MVector,MMatrix,MArray,SizedArray }} (:: Union{MA,Type{MA}} , sizes:: Tuple{Int} ) = MVector{sizes[1 ], eltype (MA)}
121
121
122
- @pure similar_type {MA<:Union{MVector,MMatrix,MArray}} (:: Union{MA,Type{MA}} , sizes:: Tuple{Int,Int} ) = MMatrix{sizes[1 ], sizes[2 ], eltype (MA), sizes[1 ]* sizes[2 ]}
122
+ @pure similar_type {MA<:Union{MVector,MMatrix,MArray,SizedArray }} (:: Union{MA,Type{MA}} , sizes:: Tuple{Int,Int} ) = MMatrix{sizes[1 ], sizes[2 ], eltype (MA), sizes[1 ]* sizes[2 ]}
123
123
124
- @pure similar_type {MA<:Union{MVector,MMatrix,MArray},N} (:: Union{MA,Type{MA}} , sizes:: Tuple{Vararg{Int,N}} ) = MArray{sizes, eltype (MA), N, prod (sizes)}
124
+ @pure similar_type {MA<:Union{MVector,MMatrix,MArray,SizedArray },N} (:: Union{MA,Type{MA}} , sizes:: Tuple{Vararg{Int,N}} ) = MArray{sizes, eltype (MA), N, prod (sizes)}
125
125
126
126
# And also similar() returning mutable StaticArrays
127
127
@inline similar {SV <: StaticVector} (:: SV ) = MVector {length(SV),eltype(SV)} ()
0 commit comments