You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/CellArray.jl
+8-6Lines changed: 8 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -419,15 +419,16 @@ Return an array view of the field of CellArray `A` designated with `indices` or
419
419
420
420
## Helper functions
421
421
422
+
# NOTE: the following function could be provided in public API:
422
423
# """
423
424
# plain(A)
424
425
#
425
426
# Return a plain `N`-dimensional array view of CellArray `A` (modifying the view will modify `A`), where `N` is the sum of the dimensionalities of `A` and the cell type of `A`. The view's dimensions are `(size(A)..., cellsize(A)...)` if parameter `B` of `A` is `0`, and `(cellsize(A)..., size(A)...)` if parameter `B` of `A` is `1`. The operation is not supported if parameter `B` of `A` is neither `0` nor `1`.
426
427
#
427
428
# """
428
-
@inlineplain(A::CellArray{T,N,0,T_array}) where {T,N, T_array} =reshape(A.data, (size(A)..., cellsize(A)...))
429
-
@inlineplain(A::CellArray{T,N,1,T_array}) where {T,N, T_array} =reshape(A.data, (cellsize(A)..., size(A)...))
430
-
@inlineplain(A::CellArray{T,N,B,T_array}) where {T,N,B,T_array} =@ArgumentError("The operation is not supported if parameter `B` of `A` is neither `0` nor `1`.")
429
+
#@inline plain(A::CellArray{T,N,0,T_array}) where {T,N, T_array} = reshape(A.data, (size(A)..., cellsize(A)...))
430
+
#@inline plain(A::CellArray{T,N,1,T_array}) where {T,N, T_array} = reshape(A.data, (cellsize(A)..., size(A)...))
431
+
#@inline plain(A::CellArray{T,N,B,T_array}) where {T,N,B,T_array} = @ArgumentError("The operation is not supported if parameter `B` of `A` is neither `0` nor `1`.")
431
432
432
433
# """
433
434
# plain_arrayflat(A)
@@ -439,15 +440,16 @@ Return an array view of the field of CellArray `A` designated with `indices` or
439
440
@inlineplain_arrayflat(A::CellArray{T,N,1,T_array}) where {T,N, T_array} =reshape(A.data, (cellsize(A)..., length(A)))
440
441
@inlineplain_arrayflat(A::CellArray{T,N,B,T_array}) where {T,N,B,T_array} =@ArgumentError("The operation is not supported if parameter `B` of `A` is neither `0` nor `1`.")
441
442
443
+
# NOTE: the following function could be provided in public API:
442
444
# """
443
445
# plain_cellflat(A)
444
446
#
445
447
# Return a plain `N`-dimensional array view of CellArray `A` with flat cell indexing (modifying the view will modify `A`), where `N` is the sum of the dimensionalities of `A` and the length of the cell type of `A`. The view's dimensions are `(size(A)..., celllength(A))` if parameter `B` of `A` is `0`, and `(celllength(A), size(A)...)` if parameter `B` of `A` is `1`. The operation is not supported if parameter `B` of `A` is neither `0` nor `1`.
446
448
#
447
449
# """
448
-
@inlineplain_cellflat(A::CellArray{T,N,0,T_array}) where {T,N, T_array} =reshape(A.data, (size(A)..., celllength(A)))
449
-
@inlineplain_cellflat(A::CellArray{T,N,1,T_array}) where {T,N, T_array} =reshape(A.data, (celllength(A), size(A)...))
450
-
@inlineplain_cellflat(A::CellArray{T,N,B,T_array}) where {T,N,B,T_array} =@ArgumentError("The operation is not supported if parameter `B` of `A` is neither `0` nor `1`.")
450
+
#@inline plain_cellflat(A::CellArray{T,N,0,T_array}) where {T,N, T_array} = reshape(A.data, (size(A)..., celllength(A)))
451
+
#@inline plain_cellflat(A::CellArray{T,N,1,T_array}) where {T,N, T_array} = reshape(A.data, (celllength(A), size(A)...))
452
+
#@inline plain_cellflat(A::CellArray{T,N,B,T_array}) where {T,N,B,T_array} = @ArgumentError("The operation is not supported if parameter `B` of `A` is neither `0` nor `1`.")
0 commit comments