Question
Is there a shorter or better way to pre-allocate indsTup
and inds
as shown below? :
indsTup = [(1:2,1:2)]
for i in 1:10
push!(indsTup,(1:2,1:2))
end
indsTup = SharedArray(indsTup)
inds = [1:2]
for i in 1:10
push!(inds,1:2)
end
inds = SharedArray(inds)
julia> typeof(inds) # how do I pre-allocate this?
SharedVector{UnitRange{Int64}} (alias for SharedArray{UnitRange{Int64}, 1})
julia> typeof(indsTup) # how do I pre-allocate this?
SharedVector{Tuple{UnitRange{Int64}, UnitRange{Int64}}} (alias for SharedArray{Tuple{UnitRange{Int64}, UnitRange{Int64}}, 1})