Hmm, I wonder about this:
zeros(size(qwer))is used when it is an array
zeros(asdf)is used when it is a tuple
when what is an array or tuple? If you’re trying to generate an array of zeros the same length of an existing array or tuple, then zeros(length(x)) is how you do it in both cases:
julia> a = [1,2,3]
3-element Array{Int64,1}:
1
2
3
julia> t = (1,2,3)
(1, 2, 3)
julia> zeros(length(a))
3-element Array{Float64,1}:
0.0
0.0
0.0
julia> zeros(length(t)) == zeros(length(a))
true
Just calling zeros() on a tuple though gives something different:
julia> zeros(t)
1×2×3 Array{Float64,3}:
[:, :, 1] =
0.0 0.0
[:, :, 2] =
0.0 0.0
[:, :, 3] =
0.0 0.0
Similarly, I’m not sure about
for i in length(qwer)is faster when it is an array
for i in 1:asdfis faster when it is a tuple
which seem to be different things - the first one is not a range, but only a single integer:
julia> for i in length(a)
println(i)
end
3
while the second one doesn’t work if asdf is a tuple (although it isn’t clear from your post what asdf actually is)