|
363 | 363 |
|
364 | 364 | Base.length(data::IJFH) = get_Nh(data)
|
365 | 365 |
|
366 |
| -@inline function slab(data::IJFH{S, Nij}, h::Integer) where {S, Nij} |
367 |
| - @boundscheck (1 <= h <= get_Nh(data)) || throw(BoundsError(data, (h,))) |
368 |
| - dataview = @inbounds view(parent(data), :, :, :, h) |
369 |
| - IJF{S, Nij}(dataview) |
370 |
| -end |
| 366 | +Base.@propagate_inbounds slab(data::IJFH, h::Integer) = slab(data, 1, h) |
371 | 367 |
|
372 | 368 | @inline function slab(data::IJFH{S, Nij}, v::Integer, h::Integer) where {S, Nij}
|
373 | 369 | @boundscheck (v >= 1 && 1 <= h <= get_Nh(data)) ||
|
|
531 | 527 | (Nij, Nij, 1, 1, 1)
|
532 | 528 | Base.axes(::DataSlab2D{S, Nij}) where {S, Nij} = (SOneTo(Nij), SOneTo(Nij))
|
533 | 529 |
|
534 |
| -@inline function slab(data::DataSlab2D, h) |
535 |
| - @boundscheck (h >= 1) || throw(BoundsError(data, (h,))) |
536 |
| - data |
537 |
| -end |
| 530 | +Base.@propagate_inbounds slab(data::DataSlab2D, h) = slab(data, 1, h) |
538 | 531 |
|
539 | 532 | @inline function slab(data::DataSlab2D, v, h)
|
540 | 533 | @boundscheck (v >= 1 && h >= 1) || throw(BoundsError(data, (v, h)))
|
|
588 | 581 | Base.axes(::DataSlab1D{S, Ni}) where {S, Ni} = (SOneTo(Ni),)
|
589 | 582 | Base.lastindex(::DataSlab1D{S, Ni}) where {S, Ni} = Ni
|
590 | 583 |
|
591 |
| -@inline function slab(data::DataSlab1D, h) |
592 |
| - @boundscheck (h >= 1) || throw(BoundsError(data, (h,))) |
593 |
| - data |
594 |
| -end |
| 584 | +Base.@propagate_inbounds slab(data::DataSlab1D, h) = slab(data, 1, h) |
595 | 585 |
|
596 | 586 | @inline function slab(data::DataSlab1D, v, h)
|
597 | 587 | @boundscheck (v >= 1 && h >= 1) || throw(BoundsError(data, (v, h)))
|
@@ -678,10 +668,7 @@ nlevels(::VF{S, Nv}) where {S, Nv} = Nv
|
678 | 668 | Base.@propagate_inbounds Base.getproperty(data::VF, i::Integer) =
|
679 | 669 | _property_view(data, Val(i))
|
680 | 670 |
|
681 |
| -@inline function column(data::VF, i, h) |
682 |
| - @boundscheck (i >= 1 && h >= 1) || throw(BoundsError(data, (i, h))) |
683 |
| - data |
684 |
| -end |
| 671 | +Base.@propagate_inbounds column(data::VF, i, h) = column(data, i, 1, h) |
685 | 672 |
|
686 | 673 | @inline function column(data::VF, i, j, h)
|
687 | 674 | @boundscheck (i >= 1 && j >= 1 && h >= 1) ||
|
@@ -832,19 +819,9 @@ Base.length(data::VIFH) = nlevels(data) * get_Nh(data)
|
832 | 819 | IF{S, Ni}(dataview)
|
833 | 820 | end
|
834 | 821 |
|
835 |
| -# Note: construct the subarray view directly as optimizer fails in Base.to_indices (v1.7) |
836 |
| -@inline function column(data::VIFH{S, Nv, Ni, Nh}, i, h) where {S, Nv, Ni, Nh} |
837 |
| - array = parent(data) |
838 |
| - @boundscheck (1 <= i <= Ni && 1 <= h <= Nh) || |
839 |
| - throw(BoundsError(data, (i, h))) |
840 |
| - Nf = ncomponents(data) |
841 |
| - dataview = @inbounds SubArray( |
842 |
| - array, |
843 |
| - (Base.Slice(Base.OneTo(Nv)), i, Base.Slice(Base.OneTo(Nf)), h), |
844 |
| - ) |
845 |
| - VF{S, Nv}(dataview) |
846 |
| -end |
| 822 | +Base.@propagate_inbounds column(data::VIFH, i, h) = column(data, i, 1, h) |
847 | 823 |
|
| 824 | +# Note: construct the subarray view directly as optimizer fails in Base.to_indices (v1.7) |
848 | 825 | @inline function column(
|
849 | 826 | data::VIFH{S, Nv, Ni, Nh},
|
850 | 827 | i,
|
|
0 commit comments