|
1 | 1 | module Code |
2 | 2 |
|
3 | | -using StaticArrays, LabelledArrays, SparseArrays |
| 3 | +using StaticArrays, LabelledArrays, SparseArrays, LinearAlgebra |
4 | 4 |
|
5 | 5 | export toexpr, Assignment, (←), Let, Func, DestructuredArgs, LiteralExpr, |
6 | 6 | SetArray, MakeArray, MakeSparseArray, MakeTuple, AtIndex, |
|
394 | 394 | _create_array(A, T, d, elems...) |
395 | 395 | end |
396 | 396 |
|
| 397 | +@inline function create_array(A::Type{<:SubArray{T,N,P,I,L}}, S, d::Val, elems...) where {T,N,P,I,L} |
| 398 | + create_array(P, S, d, elems...) |
| 399 | +end |
| 400 | + |
| 401 | +@inline function create_array(A::Type{<:PermutedDimsArray{T,N,perm,iperm,P}}, S, d::Val, elems...) where {T,N,perm,iperm,P} |
| 402 | + create_array(P, S, d, elems...) |
| 403 | +end |
| 404 | + |
397 | 405 | ## Matrix |
398 | 406 |
|
399 | 407 | @inline function create_array(::Type{<:Matrix}, ::Nothing, ::Val{dims}, elems...) where dims |
|
404 | 412 | Base.typed_hvcat(T, dims, elems...) |
405 | 413 | end |
406 | 414 |
|
| 415 | +@inline function create_array(A::Type{<:Transpose{T,P}}, S, d::Val, elems...) where {T,P} |
| 416 | + create_array(P, S, d, elems...) |
| 417 | +end |
| 418 | + |
| 419 | +@inline function create_array(A::Type{<:UpperTriangular{T,P}}, S, d::Val, elems...) where {T,P} |
| 420 | + create_array(P, S, d, elems...) |
| 421 | +end |
| 422 | + |
407 | 423 | ## SArray |
408 | 424 | @inline function create_array(::Type{<:SArray}, ::Nothing, ::Val{dims}, elems...) where dims |
409 | 425 | SArray{Tuple{dims...}}(elems...) |
|
0 commit comments