@@ -2841,13 +2841,13 @@ end
28412841catdim_ (dims) = (a,b) -> cat (a,b,dims= dims)
28422842
28432843"""
2844- lolstack(list_of_lists; ndim=n)
2844+ lolstack(list_of_lists, [ ndim=n] )
28452845
28462846Assembles a tensor of order `ndim` from a nested array-of-arrays. Vector sizes must match.
28472847
28482848# Examples
28492849```jldoctest
2850- julia> lolstack([[[1,2],[3,4]], [[5,6],[7,8]]], ndim=3 )
2850+ julia> lolstack([[[1,2],[3,4]], [[5,6],[7,8]]])
285128512×2×2 Array{Int64, 3}:
28522852[:, :, 1] =
28532853 1 3
@@ -2857,19 +2857,24 @@ julia> lolstack([[[1,2],[3,4]], [[5,6],[7,8]]], ndim=3)
28572857 5 7
28582858 6 8
28592859
2860- julia> a = eachcol(reshape(1:6,2,:)) |> collect
2861- 3-element Vector{ SubArray{Int64, 1, Base.ReshapedArray{Int64, 2, UnitRange{Int64}, Tuple{}}, Tuple{Base.Slice{Base.OneTo{Int64}}, Int64}, true}}:
2860+ julia> a = eachcol(reshape(1:6,2,:))
2861+ 3-element ColumnSlices{Base.ReshapedArray{Int64, 2, UnitRange{Int64}, Tuple{}}, Tuple{Base.OneTo{Int64}}, SubArray{Int64, 1, Base.ReshapedArray{Int64, 2, UnitRange{Int64}, Tuple{}}, Tuple{Base.Slice{Base.OneTo{Int64}}, Int64}, true}}:
28622862 [1, 2]
28632863 [3, 4]
28642864 [5, 6]
28652865
2866- julia> lolstack(a, ndim=2)
2866+ julia> Base. lolstack(a, ndim=2)
286728672×3 Matrix{Int64}:
28682868 1 3 5
28692869 2 4 6
28702870"""
28712871lolstack (array_of_arrays; ndim) = lolstack_ (ndim, array_of_arrays)
2872- lolstack (f, c... ) = lolstack_ (2 , map (f, c... ))
2872+ lolstack (array_of_arrays:: Vector{N} ) = lolstack (array_of_arrays, ndim= 1 )
2873+ lolstack (array_of_arrays:: Vector{Vector{N}} ) = lolstack (array_of_arrays, ndim= 2 )
2874+ lolstack (array_of_arrays:: Vector{Vector{Vector{N}}} ) = lolstack (array_of_arrays, ndim= 3 )
2875+ lolstack (array_of_arrays:: Vector {Vector{Vector{Vector{N}}}}) = lolstack (array_of_arrays, ndim= 4 )
2876+ lolstack (array_of_arrays:: Vector {Vector{Vector{Vector{Vector{N}}}}}) = lolstack (array_of_arrays, ndim= 5 )
2877+ lolstack (f, c... ) = lolstack (map (f, c... ))
28732878function lolstack_ (ndim, aoa)
28742879 if ndim == 1
28752880 aoa
0 commit comments