|
1 | 1 | """ |
2 | | - ParallelUtilities.AbstractConstrainedProduct{T,N} |
| 2 | + AbstractConstrainedProduct{T,N} |
3 | 3 |
|
4 | | -Supertype of [`ParallelUtilities.ProductSplit`](@ref) and [`ParallelUtilities.ProductSection`](@ref). |
| 4 | +Supertype of [`ProductSplit`](@ref) and [`ProductSection`](@ref). |
5 | 5 | """ |
6 | 6 | abstract type AbstractConstrainedProduct{T,N} end |
7 | 7 | Base.eltype(::AbstractConstrainedProduct{T}) where {T} = T |
@@ -183,9 +183,9 @@ function Base.first(ps::AbstractConstrainedProduct) |
183 | 183 | isempty(ps) ? nothing : @inbounds _first(ps.iterators, childindex(ps, ps.firstind)...) |
184 | 184 | end |
185 | 185 |
|
186 | | -Base.@propagate_inbounds function _first(t::Tuple,ind::Integer,rest::Integer...) |
| 186 | +Base.@propagate_inbounds function _first(t::Tuple, ind::Integer, rest::Integer...) |
187 | 187 | @boundscheck (1 <= ind <= length(first(t))) || throw(BoundsError(first(t),ind)) |
188 | | - (@inbounds first(t)[ind], _first(Base.tail(t),rest...)...) |
| 188 | + (@inbounds first(t)[ind], _first(Base.tail(t), rest...)...) |
189 | 189 | end |
190 | 190 | _first(::Tuple{}) = () |
191 | 191 |
|
@@ -871,7 +871,7 @@ function procrange_recast(ps::AbstractConstrainedProduct, np_new::Integer) |
871 | 871 | end |
872 | 872 |
|
873 | 873 | """ |
874 | | - localindex(ps::ProductSplit{T}, val::T) where {T} |
| 874 | + localindex(ps::AbstractConstrainedProduct{T}, val::T) where {T} |
875 | 875 |
|
876 | 876 | Return the index of `val` in `ps`. Return `nothing` if the value |
877 | 877 | is not found. |
@@ -899,6 +899,7 @@ function localindex(ps::AbstractConstrainedProduct{T}, val::T) where {T} |
899 | 899 | indflat - ps.firstind + 1 |
900 | 900 | end |
901 | 901 |
|
| 902 | +# this is only needed because first and last return nothing if the ProductSplit is empty |
902 | 903 | localindex(::AbstractConstrainedProduct, ::Nothing) = nothing |
903 | 904 |
|
904 | 905 | function localindex(iterators::Tuple, val::Tuple, np::Integer, p::Integer) |
|
0 commit comments