4848# work around strange bug with bool size
4949SubOperator (A,inds,dims:: Tuple{Bool,Bool} ,lu) = SubOperator (A,inds,Int .(dims),lu)
5050
51- function SubOperator (A,inds:: Tuple{Block ,Block} ,lu)
51+ function SubOperator (A,inds:: NTuple{2 ,Block} ,lu)
5252 checkbounds (A,inds... )
5353 SubOperator (A,inds,(blocklengths (rangespace (A))[inds[1 ]. n[1 ]],blocklengths (domainspace (A))[inds[2 ]. n[1 ]]),lu)
5454end
5555
56- SubOperator (A, inds:: Tuple{Block ,Block} ) = SubOperator (A,inds,subblockbandwidths (A))
56+ SubOperator (A, inds:: NTuple{2 ,Block} ) = SubOperator (A,inds,subblockbandwidths (A))
5757function SubOperator (A, inds:: Tuple{BlockRange{1,R},BlockRange{1,R}} ) where R
5858 checkbounds (A,inds... )
5959 dims = (sum (blocklengths (rangespace (A))[inds[1 ]. indices[1 ]]),
@@ -169,7 +169,7 @@ view(V::SubOperator, kr, jr) = view(V.parent,reindex(V,parentindices(V),(kr,jr))
169169view (V:: SubOperator ,kr:: InfRanges ,jr:: InfRanges ) = view (V. parent,reindex (V,parentindices (V),(kr,jr))... )
170170
171171bandwidths (S:: SubOperator ) = S. bandwidths
172- function colstop (S:: SubOperator{T,OP,Tuple{UnitRange{Int} ,UnitRange{Int}}} ,j:: Integer ) where {T,OP}
172+ function colstop (S:: SubOperator{<:Any,<:Any,NTuple{2 ,UnitRange{Int}}} ,j:: Integer )
173173 cs = colstop (parent (S),parentindices (S)[2 ][j])
174174 kr = parentindices (S)[1 ]
175175 n = size (S,1 )
@@ -181,34 +181,34 @@ function colstop(S::SubOperator{T,OP,Tuple{UnitRange{Int},UnitRange{Int}}},j::In
181181 min (n,findfirst (isequal (cs),kr))
182182 end
183183end
184- colstart (S:: SubOperator{T,OP,Tuple{UnitRange{Int} ,UnitRange{Int}}} ,j:: Integer ) where {T,OP} =
184+ colstart (S:: SubOperator{<:Any,<:Any,NTuple{2 ,UnitRange{Int}}} ,j:: Integer ) =
185185 max (findfirst (parentindices (S)[1 ],colstart (parent (S),parentindices (S)[2 ][j])),1 )
186- rowstart (S:: SubOperator{T,OP,Tuple{UnitRange{Int} ,UnitRange{Int}}} ,j:: Integer ) where {T,OP} =
186+ rowstart (S:: SubOperator{<:Any,<:Any,NTuple{2 ,UnitRange{Int}}} ,j:: Integer ) =
187187 max (1 ,findfirst (parentindices (S)[2 ],rowstart (parent (S),parentindices (S)[1 ][j])))
188- rowstop (S:: SubOperator{T,OP,Tuple{UnitRange{Int} ,UnitRange{Int}}} ,j:: Integer ) where {T,OP} =
188+ rowstop (S:: SubOperator{<:Any,<:Any,NTuple{2 ,UnitRange{Int}}} ,j:: Integer ) =
189189 findfirst (parentindices (S)[2 ],rowstop (parent (S),parentindices (S)[1 ][j]))
190190
191191
192192# blocks don't change
193- blockcolstop (S:: SubOperator{T,OP,Tuple{II,JJ}} ,J :: Integer ) where {T,OP,II <: AbstractRange{Int} ,JJ <: AbstractRange{Int} } =
193+ blockcolstop (S:: SubOperator{<:Any,<:Any,Tuple{ AbstractRange{Int},AbstractRange{Int}}} ,J :: Integer ) =
194194 blockcolstop (parent (S),J)
195195
196196israggedbelow (S:: SubOperator ) = israggedbelow (parent (S))
197197
198198# since blocks don't change with indexex, neither do blockbandwidths
199- blockbandwidths (S:: SubOperator{T,OP,Tuple{II,JJ}} ) where {T,OP,II <: AbstractRange{Int} ,JJ <: AbstractRange{Int} } =
199+ blockbandwidths (S:: SubOperator{<:Any,<:Any,NTuple{2, AbstractRange{Int}}} ) =
200200 blockbandwidths (parent (S))
201- function blockbandwidths (S:: SubOperator{T,B,Tuple{BlockRange1 ,BlockRange1}} ) where {T,B}
201+ function blockbandwidths (S:: SubOperator{<:Any,<:Any,NTuple{2 ,BlockRange1}} )
202202 KR,JR = parentindices (S)
203203 l,u = blockbandwidths (parent (S))
204204 sh = first (KR). n[1 ]- first (JR). n[1 ]
205205 l- sh,u+ sh
206206end
207207
208- isblockbanded (S:: SubOperator{T,B,Tuple{Block ,Block}} ) where {T,B} = false
209- isbanded (S:: SubOperator{T,B,Tuple{Block ,Block}} ) where {T,B} = isbandedblockbanded (parent (S))
210- bandwidths (S:: SubOperator{T,B,Tuple{Block ,Block}} ) where {T,B} = subblockbandwidths (parent (S))
211- blockbandwidths (S:: SubOperator{T,B,Tuple{Block ,Block}} ) where {T,B} = 0 ,0
208+ isblockbanded (S:: SubOperator{<:Any,<:Any,NTuple{2 ,Block}} ) = false
209+ isbanded (S:: SubOperator{<:Any,<:Any,NTuple{2 ,Block}} ) = isbandedblockbanded (parent (S))
210+ bandwidths (S:: SubOperator{<:Any,<:Any,NTuple{2 ,Block}} ) = subblockbandwidths (parent (S))
211+ blockbandwidths (S:: SubOperator{<:Any,<:Any,NTuple{2 ,Block}} ) = 0 ,0
212212
213213function BandedBlockBandedMatrix (:: Type{Zeros} , S:: SubOperator )
214214 kr,jr= parentindices (S)
@@ -234,7 +234,7 @@ function BandedBlockBandedMatrix(::Type{Zeros}, S::SubOperator)
234234 rows,cols, (l,u), (λ- jsh,μ+ ksh))
235235end
236236
237- function BandedBlockBandedMatrix (:: Type{Zeros} , S:: SubOperator{T,B ,Tuple{BlockRange1,BlockRange1}} ) where {T,B}
237+ function BandedBlockBandedMatrix (:: Type{Zeros} , S:: SubOperator{<:Any,<:Any ,Tuple{BlockRange1,BlockRange1}} )
238238 KR,JR = parentindices (S)
239239 KO = parent (S)
240240 l,u = blockbandwidths (KO):: Tuple{Int,Int}
297297_colstops (V) = Int[max (0 ,colstop (V,j)) for j= 1 : size (V,2 )]
298298
299299for TYP in (:RaggedMatrix , :Matrix )
300- def_TYP = Meta . parse ( " default_" * string ( TYP) )
300+ def_TYP = Symbol ( : default_, TYP)
301301 @eval begin
302302 function $TYP (V:: SubOperator )
303303 if isinf (size (V,1 )) || isinf (size (V,2 ))
@@ -311,7 +311,7 @@ for TYP in (:RaggedMatrix, :Matrix)
311311 end
312312 end
313313
314- function $TYP (V:: SubOperator{T,BB ,NTuple{2,UnitRange{Int}}} ) where {T,BB}
314+ function $TYP (V:: SubOperator{<:Any,<:Any ,NTuple{2,UnitRange{Int}}} )
315315 if isinf (size (V,1 )) || isinf (size (V,2 ))
316316 error (" Cannot convert $V to a $TYP " )
317317 end
@@ -331,7 +331,7 @@ for TYP in (:RaggedMatrix, :Matrix)
331331end
332332
333333# fast converts to banded matrices would be based on indices, not blocks
334- function BandedMatrix (S:: SubOperator{T,B ,Tuple{BlockRange1,BlockRange1}} ) where {T,B}
334+ function BandedMatrix (S:: SubOperator{<:Any,<:Any ,Tuple{BlockRange1,BlockRange1}} )
335335 A = parent (S)
336336 ds = domainspace (A)
337337 rs = rangespace (A)
@@ -344,14 +344,14 @@ end
344344
345345
346346
347- function mul_coefficients (A:: SubOperator{T,B,Tuple{UnitRange{Int} ,UnitRange{Int}}} ,b) where {T,B}
347+ function mul_coefficients (A:: SubOperator{<:Any,<:Any,NTuple{2 ,UnitRange{Int}}} , b)
348348 if size (A,2 ) == length (b)
349349 AbstractMatrix (A)* b
350350 else
351351 view (A,:,1 : length (b))* b
352352 end
353353end
354- function mul_coefficients! (A:: SubOperator{T,B,Tuple{UnitRange{Int} ,UnitRange{Int}}} ,b) where {T,B}
354+ function mul_coefficients! (A:: SubOperator{<:Any,<:Any,NTuple{2 ,UnitRange{Int}}} , b)
355355 if size (A,2 ) == length (b)
356356 mul! (b, AbstractMatrix (A), b)
357357 else
0 commit comments