@@ -58,8 +58,14 @@ function _broadcast_blockbandwidths((l,u), A::AbstractArray, (ax1,ax2))
58
58
end
59
59
60
60
61
- blockbandwidths (bc:: Broadcasted{<:Union{Nothing,BroadcastStyle},<:Any,typeof(*)} ) =
62
- min .(_broadcast_blockbandwidths .(Ref (_blockbnds (bc)), bc. args, Ref (axes (bc)))... )
61
+ function blockbandwidths (bc:: Broadcasted{<:Union{Nothing,BroadcastStyle},<:Any,typeof(*)} )
62
+ ax = axes (bc)
63
+ blkinds = _blockbnds (bc)
64
+ t = map (bc. args) do x
65
+ _broadcast_blockbandwidths (blkinds, x, ax)
66
+ end
67
+ min .(t... )
68
+ end
63
69
64
70
blockbandwidths (bc:: Broadcasted{<:Union{Nothing,BroadcastStyle},<:Any,typeof(/)} ) = _broadcast_blockbandwidths (_blockbnds (bc), first (bc. args), axes (bc))
65
71
blockbandwidths (bc:: Broadcasted{<:Union{Nothing,BroadcastStyle},<:Any,typeof(\)} ) = _broadcast_blockbandwidths (_blockbnds (bc), last (bc. args), axes (bc))
@@ -76,16 +82,26 @@ function _broadcast_subblockbandwidths((l,u), A::AbstractArray)
76
82
subblockbandwidths (A) # need to special case vector broadcasting
77
83
end
78
84
79
- subblockbandwidths (bc:: Broadcasted{<:Union{Nothing,BroadcastStyle},<:Any,typeof(*)} ) =
80
- min .(_broadcast_subblockbandwidths .(Ref (_subblockbnds (bc)), bc. args)... )
85
+ function subblockbandwidths (bc:: Broadcasted{<:Union{Nothing,BroadcastStyle},<:Any,typeof(*)} )
86
+ subbbw = _subblockbnds (bc)
87
+ t = map (bc. args) do x
88
+ _broadcast_subblockbandwidths (subbbw, x)
89
+ end
90
+ min .(t... )
91
+ end
81
92
82
93
subblockbandwidths (bc:: Broadcasted{<:Union{Nothing,BroadcastStyle},<:Any,typeof(/)} ) = _broadcast_subblockbandwidths (_subblockbnds (bc), first (bc. args))
83
94
subblockbandwidths (bc:: Broadcasted{<:Union{Nothing,BroadcastStyle},<:Any,typeof(\)} ) = _broadcast_subblockbandwidths (_subblockbnds (bc), last (bc. args))
84
95
85
96
function subblockbandwidths (bc:: Broadcasted )
86
97
(a,b) = size (bc)
87
98
bnds = (a- 1 ,b- 1 )
88
- _isweakzero (bc. f, bc. args... ) && return min .(bnds, max .(_broadcast_subblockbandwidths .(Ref (bnds), bc. args)... ))
99
+ if _isweakzero (bc. f, bc. args... )
100
+ t = map (bc. args) do x
101
+ _broadcast_subblockbandwidths (bnds, x)
102
+ end
103
+ return min .(bnds, max .(t... ))
104
+ end
89
105
bnds
90
106
end
91
107
0 commit comments