I would like to continue on this, as I use hcat(x...)
, where x is and array of arrays (or some other objects) quite extensively. I prefer this over reduce(hcat,x)
, because the former is way faster.
Besides the problem judober has identified, we have just identified another one, which is if hcat(x...)
is called many times with x
containing different number of element, it slowly consumes all the memory of Julia (because it keeps all versions of arguments) and eventually, it fails.
My question is, what would be the ideal way implement function that takes arbitrary number of arrays and concatenate them at once. Using reduce for this is just inefficient. Should we write our function, something like
hhcat(Vector{T}) where {T}
?
Thanks for answers.