Skip to content

Commit 1ee0cd7

Browse files
authored
remove excessive paramterization of InterlaceOperator (#409)
* remove excessive paramterization of InterlaceOperator * don't assert in plusop
1 parent e842e74 commit 1ee0cd7

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

src/Caching/almostbanded.jl

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,8 @@ end
176176

177177
# Grow cached interlace operator
178178

179-
function resizedata!(co::CachedOperator{T,AlmostBandedMatrix{T},
180-
InterlaceOperator{T,1,DS,RS,DI,RI,BI}},
181-
n::Integer,::Colon) where {T<:Number,DS,RS,DI,RI,BI}
179+
function resizedata!(co::CachedOperator{T,AlmostBandedMatrix{T},<:InterlaceOperator{T,1}},
180+
n::Integer,::Colon) where {T<:Number}
182181
if n co.datasize[1]
183182
return co
184183
end
@@ -211,9 +210,8 @@ end
211210

212211

213212

214-
function resizedata!(co::CachedOperator{T,AlmostBandedMatrix{T},
215-
InterlaceOperator{T,2,DS,RS,DI,RI,BI}},
216-
n::Integer,::Colon) where {T<:Number,DS,RS,DI,RI,BI}
213+
function resizedata!(co::CachedOperator{T,AlmostBandedMatrix{T},<:InterlaceOperator{T,2}},
214+
n::Integer,::Colon) where {T<:Number}
217215
if n co.datasize[1]
218216
return co
219217
end
@@ -259,14 +257,12 @@ function resizedata!(co::CachedOperator{T,AlmostBandedMatrix{T},
259257
end
260258

261259

262-
resizedata!(co::CachedOperator{T,AlmostBandedMatrix{T},
263-
InterlaceOperator{T,1,DS,RS,DI,RI,BI}},
264-
n::Integer,m::Integer) where {T<:Number,DS,RS,DI,RI,BI} = resizedata!(co,max(n,m+bandwidth(co.data.bands,1)),:)
260+
resizedata!(co::CachedOperator{T,AlmostBandedMatrix{T},<:InterlaceOperator{T,1}},
261+
n::Integer,m::Integer) where {T<:Number} = resizedata!(co,max(n,m+bandwidth(co.data.bands,1)),:)
265262

266263

267-
resizedata!(co::CachedOperator{T,AlmostBandedMatrix{T},
268-
InterlaceOperator{T,2,DS,RS,DI,RI,BI}},
269-
n::Integer,m::Integer) where {T<:Number,DS,RS,DI,RI,BI} = resizedata!(co,max(n,m+bandwidth(co.data.bands,1)),:)
264+
resizedata!(co::CachedOperator{T,AlmostBandedMatrix{T},<:InterlaceOperator{T,2}},
265+
n::Integer,m::Integer) where {T<:Number} = resizedata!(co,max(n,m+bandwidth(co.data.bands,1)),:)
270266

271267

272268

src/Operators/general/InterlaceOperator.jl

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,7 @@ end
346346
for TYP in (:BandedMatrix, :BlockBandedMatrix, :BandedBlockBandedMatrix, :RaggedMatrix,
347347
:Matrix)
348348
@eval begin
349-
function $TYP(S::SubOperator{T,InterlaceOperator{T,1,SS,PS,DI,RI,BI},
350-
NTuple{2,UnitRange{Int}}}) where {SS,PS,DI,RI,BI,T}
349+
function $TYP(S::SubOperator{T,<:InterlaceOperator{T,1},NTuple{2,UnitRange{Int}}}) where {T}
351350
kr,jr=parentindices(S)
352351
L=parent(S)
353352

@@ -370,8 +369,7 @@ for TYP in (:BandedMatrix, :BlockBandedMatrix, :BandedBlockBandedMatrix, :Ragged
370369
ret
371370
end
372371

373-
function $TYP(S::SubOperator{T,InterlaceOperator{T,2,SS,PS,DI,RI,BI},
374-
NTuple{2,UnitRange{Int}}}) where {SS,PS,DI,RI,BI,T}
372+
function $TYP(S::SubOperator{T,<:InterlaceOperator{T,2},NTuple{2,UnitRange{Int}}}) where {T}
375373
kr,jr=parentindices(S)
376374
L=parent(S)
377375

@@ -438,8 +436,8 @@ function blockbanded_interlace_convert!(S,ret)
438436
end
439437

440438
for d in (:1,:2)
441-
@eval BlockBandedMatrix(S::SubOperator{T,InterlaceOperator{T,$d,SS,PS,DI,RI,BI},
442-
Tuple{BlockRange1,BlockRange1}}) where {SS,PS,DI,RI,BI,T} =
439+
@eval BlockBandedMatrix(S::SubOperator{T,<:InterlaceOperator{T,$d},
440+
Tuple{BlockRange1,BlockRange1}}) where {T} =
443441
blockbanded_interlace_convert!(S, BlockBandedMatrix(Zeros, S))
444442
end
445443

0 commit comments

Comments
 (0)