@@ -55,33 +55,33 @@ specified field arrays.
5555
5656```julia-repl 
5757julia> StructArray{ComplexF64}(([1.0, 2.0], [3.0, 4.0])) 
58- 2-element StructArray(::Array {Float64,1 }, ::Array {Float64,1 }) with eltype Complex{Float64}: 
58+ 2-element StructArray(::Vector {Float64}, ::Vector {Float64}) with eltype Complex{Float64}: 
5959 1.0 + 3.0im 
6060 2.0 + 4.0im 
6161
6262julia> StructArray{ComplexF64}(re=[1.0, 2.0], im=[3.0, 4.0]) 
63- 2-element StructArray(::Array {Float64,1 }, ::Array {Float64,1 }) with eltype Complex{Float64}: 
63+ 2-element StructArray(::Vector {Float64}, ::Vector {Float64}) with eltype Complex{Float64}: 
6464 1.0 + 3.0im 
6565 2.0 + 4.0im 
6666``` 
6767
6868Any `AbstractArray` can be used as a field array 
6969```julia-repl 
7070julia> StructArray{Complex{Int64}}(([1, 2], 3:4)) 
71- 2-element StructArray(::Array {Int64,1 }, ::UnitRange{Int64}) with eltype Complex{Int64}: 
71+ 2-element StructArray(::Vector {Int64}, ::UnitRange{Int64}) with eltype Complex{Int64}: 
7272 1 + 3im 
7373 2 + 4im 
7474``` 
7575
7676If no element type `T` is provided, a `Tuple` or `NamedTuple` is used: 
7777```julia-repl 
7878julia> StructArray((zeros(2,2), ones(2,2))) 
79- 2×2 StructArray(::Array {Float64,2 }, ::Array {Float64,2 }) with eltype Tuple{Float64,Float64}: 
79+ 2×2 StructArray(::Matrix {Float64}, ::Matrix {Float64}) with eltype Tuple{Float64,Float64}: 
8080 (0.0, 1.0)  (0.0, 1.0) 
8181 (0.0, 1.0)  (0.0, 1.0) 
8282
8383julia> StructArray(a=zeros(2,2), b=ones(2,2)) 
84- 2×2 StructArray(::Array {Float64,2 }, ::Array {Float64,2 }) with eltype NamedTuple{(:a, :b),Tuple{Float64,Float64}}: 
84+ 2×2 StructArray(::Matrix {Float64}, ::Matrix {Float64}) with eltype NamedTuple{(:a, :b),Tuple{Float64,Float64}}: 
8585 (a = 0.0, b = 1.0)  (a = 0.0, b = 1.0) 
8686 (a = 0.0, b = 1.0)  (a = 0.0, b = 1.0) 
8787``` 
@@ -120,25 +120,25 @@ recursively convert fields of type `FT` to `StructArray`s.
120120
121121```julia-repl 
122122julia> X = [1.0 2.0; 3.0 4.0] 
123- 2×2 Array {Float64,2 }: 
123+ 2×2 Matrix {Float64}: 
124124 1.0  2.0 
125125 3.0  4.0 
126126
127127julia> StructArray{Complex{Float64}}(X; dims=1) 
128- 2-element StructArray(view(::Array {Float64,2 }, 1, :), view(::Array {Float64,2 }, 2, :)) with eltype Complex{Float64}: 
128+ 2-element StructArray(view(::Matrix {Float64}, 1, :), view(::Matrix {Float64}, 2, :)) with eltype Complex{Float64}: 
129129 1.0 + 3.0im 
130130 2.0 + 4.0im 
131131
132132julia> StructArray{Complex{Float64}}(X; dims=2) 
133- 2-element StructArray(view(::Array {Float64,2 }, :, 1), view(::Array {Float64,2 }, :, 2)) with eltype Complex{Float64}: 
133+ 2-element StructArray(view(::Matrix {Float64}, :, 1), view(::Matrix {Float64}, :, 2)) with eltype Complex{Float64}: 
134134 1.0 + 2.0im 
135135 3.0 + 4.0im 
136136``` 
137137
138138By default, fields will be unwrapped until they match the element type of the array: 
139139```julia-repl 
140140julia> StructArray{Tuple{Float64,Complex{Float64}}}(rand(3,2); dims=1) 
141- 2-element StructArray(view(::Array {Float64,2 }, 1, :), StructArray(view(::Array {Float64,2 }, 2, :), view(::Array {Float64,2 }, 3, :))) with eltype Tuple{Float64,Complex{Float64}}: 
141+ 2-element StructArray(view(::Matrix {Float64}, 1, :), StructArray(view(::Matrix {Float64}, 2, :), view(::Matrix {Float64}, 3, :))) with eltype Tuple{Float64,Complex{Float64}}: 
142142 (0.004767505234193781, 0.27949621887414566 + 0.9039320635041561im) 
143143 (0.41853472213051335, 0.5760165160827859 + 0.9782723869433818im) 
144144``` 
@@ -195,7 +195,7 @@ recursively convert arrays of element type `T` to `StructArray`s.
195195
196196```julia-repl 
197197julia> StructArray{ComplexF64}(undef, (2,3)) 
198- 2×3 StructArray(::Array {Float64,2 }, ::Array {Float64,2 }) with eltype Complex{Float64}: 
198+ 2×3 StructArray(::Matrix {Float64}, ::Matrix {Float64}) with eltype Complex{Float64}: 
199199  2.3166e-314+2.38405e-314im  2.39849e-314+2.38405e-314im  2.41529e-314+2.38405e-314im 
200200 2.31596e-314+2.41529e-314im  2.31596e-314+2.41529e-314im  2.31596e-314+NaN*im 
201201``` 
@@ -222,12 +222,12 @@ recursively convert arrays of element type `T` to `StructArray`s.
222222
223223```julia-repl 
224224julia> A = rand(ComplexF32, 2,2) 
225- 2×2 Array {Complex{Float32},2 }: 
225+ 2×2 Matrix {Complex{Float32}}: 
226226 0.694399+0.94999im  0.422804+0.891131im 
227227 0.101001+0.33644im  0.632468+0.811319im 
228228
229229julia> StructArray(A) 
230- 2×2 StructArray(::Array {Float32,2 }, ::Array {Float32,2 }) with eltype Complex{Float32}: 
230+ 2×2 StructArray(::Matrix {Float32}, ::Matrix {Float32}) with eltype Complex{Float32}: 
231231 0.694399+0.94999im  0.422804+0.891131im 
232232 0.101001+0.33644im  0.632468+0.811319im 
233233``` 
@@ -236,7 +236,7 @@ julia> StructArray(A)
236236
237237```julia-repl 
238238julia> StructArray((1, Complex(i, j)) for i = 1:3, j = 2:4) 
239- 3×3 StructArray(::Array {Int64,2 }, ::Array {Complex{Int64},2 }) with eltype Tuple{Int64,Complex{Int64}}: 
239+ 3×3 StructArray(::Matrix {Int64}, ::Matrix {Complex{Int64}}) with eltype Tuple{Int64,Complex{Int64}}: 
240240 (1, 1+2im)  (1, 1+3im)  (1, 1+4im) 
241241 (1, 2+2im)  (1, 2+3im)  (1, 2+4im) 
242242 (1, 3+2im)  (1, 3+3im)  (1, 3+4im) 
@@ -246,7 +246,7 @@ julia> StructArray((1, Complex(i, j)) for i = 1:3, j = 2:4)
246246
247247```julia-repl 
248248julia> StructArray((1, Complex(i, j)) for i = 1:3, j = 2:4; unwrap = T -> !(T<:Real)) 
249- 3×3 StructArray(::Array {Int64,2 }, StructArray(::Array {Int64,2 }, ::Array {Int64,2 })) with eltype Tuple{Int64,Complex{Int64}}: 
249+ 3×3 StructArray(::Matrix {Int64}, StructArray(::Matrix {Int64}, ::Matrix {Int64})) with eltype Tuple{Int64,Complex{Int64}}: 
250250 (1, 1+2im)  (1, 1+3im)  (1, 1+4im) 
251251 (1, 2+2im)  (1, 2+3im)  (1, 2+4im) 
252252 (1, 3+2im)  (1, 3+3im)  (1, 3+4im) 
0 commit comments