This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## SUMMARY ## | |
# Let `a` be the nested array and `aref` the multidim array we want to recreate: | |
julia> flatten(x::Array{<:Array,1})= Iterators.flatten(x)|> collect|> flatten | |
flatten (generic function with 1 method) | |
julia> flatten(x::Array{<:Number,1})= x | |
flatten (generic function with 2 methods) | |
julia> reshape(flatten(a), (4,4,3)) == aref |