|
1 | 1 | const OneToInfCumsum = InfiniteArrays.RangeCumsum{Int,OneToInf{Int}}
|
2 | 2 | const OneToCumsum = InfiniteArrays.RangeCumsum{Int,OneTo{Int}}
|
3 | 3 |
|
| 4 | +BlockArrays.sortedunion(::AbstractVector{Infinity}, ::AbstractVector{Infinity}) = [∞] |
| 5 | +function BlockArrays.sortedunion(::AbstractVector{Infinity}, b) |
| 6 | + @assert isinf(length(b)) |
| 7 | + b |
| 8 | +end |
| 9 | + |
| 10 | +function BlockArrays.sortedunion(b, ::AbstractVector{Infinity}) |
| 11 | + @assert isinf(length(b)) |
| 12 | + b |
| 13 | +end |
4 | 14 | BlockArrays.sortedunion(a::OneToInfCumsum, ::OneToInfCumsum) = a
|
5 | 15 | BlockArrays.sortedunion(a::OneToCumsum, ::OneToCumsum) = a
|
| 16 | +function BlockArrays.sortedunion(a::RangeCumsum{<:Any,<:InfStepRange}, b::RangeCumsum{<:Any,<:InfStepRange}) |
| 17 | + @assert a == b |
| 18 | + a |
| 19 | +end |
| 20 | + |
6 | 21 |
|
7 | 22 | function BlockArrays.sortedunion(a::Vcat{Int,1,<:Tuple{<:AbstractVector{Int},InfStepRange{Int,Int}}},
|
8 | 23 | b::Vcat{Int,1,<:Tuple{<:AbstractVector{Int},InfStepRange{Int,Int}}})
|
@@ -49,12 +64,11 @@ BroadcastStyle(::Type{<:SubArray{T,N,Arr,<:NTuple{N,BlockSlice{BlockRange{1,Tupl
|
49 | 64 | LazyArrayStyle{N}()
|
50 | 65 |
|
51 | 66 | # TODO: generalise following
|
52 |
| -for Ax in (:(RangeCumsum{Int,OneToInf{Int}}), :(OneToInf{Int})) |
53 |
| - @eval begin |
54 |
| - BroadcastStyle(::Type{BlockArray{T,N,Arr,NTuple{N,BlockedUnitRange{$Ax}}}}) where {T,N,Arr} = LazyArrayStyle{N}() |
55 |
| - BroadcastStyle(::Type{PseudoBlockArray{T,N,Arr,NTuple{N,BlockedUnitRange{$Ax}}}}) where {T,N,Arr} = LazyArrayStyle{N}() |
56 |
| - end |
57 |
| -end |
| 67 | +BroadcastStyle(::Type{<:BlockArray{T,N,<:AbstractArray{<:AbstractArray{T,N},N},<:NTuple{N,BlockedUnitRange{<:InfRanges}}}}) where {T,N} = LazyArrayStyle{N}() |
| 68 | +BroadcastStyle(::Type{<:PseudoBlockArray{T,N,<:AbstractArray{T,N},<:NTuple{N,BlockedUnitRange{<:InfRanges}}}}) where {T,N} = LazyArrayStyle{N}() |
| 69 | +BroadcastStyle(::Type{<:BlockArray{T,N,<:AbstractArray{<:AbstractArray{T,N},N},<:NTuple{N,BlockedUnitRange{<:RangeCumsum{Int,<:InfRanges}}}}}) where {T,N} = LazyArrayStyle{N}() |
| 70 | +BroadcastStyle(::Type{<:PseudoBlockArray{T,N,<:AbstractArray{T,N},<:NTuple{N,BlockedUnitRange{<:RangeCumsum{Int,<:InfRanges}}}}}) where {T,N} = LazyArrayStyle{N}() |
| 71 | + |
58 | 72 |
|
59 | 73 | BlockArrays._length(::BlockedUnitRange, ::OneToInf) = ∞
|
60 | 74 | BlockArrays._last(::BlockedUnitRange, ::OneToInf) = ∞
|
|
0 commit comments