@@ -58,8 +58,14 @@ function _broadcast_blockbandwidths((l,u), A::AbstractArray, (ax1,ax2))
5858end
5959
6060
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
6369
6470blockbandwidths (bc:: Broadcasted{<:Union{Nothing,BroadcastStyle},<:Any,typeof(/)} ) = _broadcast_blockbandwidths (_blockbnds (bc), first (bc. args), axes (bc))
6571blockbandwidths (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)
7682 subblockbandwidths (A) # need to special case vector broadcasting
7783end
7884
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
8192
8293subblockbandwidths (bc:: Broadcasted{<:Union{Nothing,BroadcastStyle},<:Any,typeof(/)} ) = _broadcast_subblockbandwidths (_subblockbnds (bc), first (bc. args))
8394subblockbandwidths (bc:: Broadcasted{<:Union{Nothing,BroadcastStyle},<:Any,typeof(\)} ) = _broadcast_subblockbandwidths (_subblockbnds (bc), last (bc. args))
8495
8596function subblockbandwidths (bc:: Broadcasted )
8697 (a,b) = size (bc)
8798 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
89105 bnds
90106end
91107
0 commit comments