6969
7070# # Interlace operator
7171
72- struct InterlaceOperator{T,p,DS,RS,DI,RI,BI,BBW} <: Operator{T}
73- ops:: Array{Operator{T},p}
72+ struct InterlaceOperator{T,p,DS,RS,DI,RI,BI,BBW,A <: AbstractArray{<:Operator{T},p} } <: Operator{T}
73+ ops:: A
7474 domainspace:: DS
7575 rangespace:: RS
7676 domaininterlacer:: DI
@@ -79,11 +79,12 @@ struct InterlaceOperator{T,p,DS,RS,DI,RI,BI,BBW} <: Operator{T}
7979 blockbandwidths:: BBW
8080 israggedbelow:: Bool
8181
82- function InterlaceOperator (ops:: Array{Operator{T},p} , ds:: DS , rs:: RS , dsi:: DI , rsi:: RI , bw:: BI ,
82+ function InterlaceOperator (ops:: A , ds:: DS , rs:: RS , dsi:: DI , rsi:: RI , bw:: BI ,
8383 blockbandwidths:: BBW = bandwidthsmax (ops, blockbandwidths),
84- israggedbelow:: Bool = all (israggedbelow, ops)) where {T,p,DS,RS,DI,RI,BI,BBW}
84+ israggedbelow:: Bool = all (israggedbelow, ops)
85+ ) where {T,p,DS,RS,DI,RI,BI,BBW,A<: AbstractArray{<:Operator{T},p} }
8586
86- new {T,p,DS,RS,DI,RI,BI,BBW} (ops, ds, rs, dsi, rsi, bw, blockbandwidths, israggedbelow)
87+ new {T,p,DS,RS,DI,RI,BI,BBW,A } (ops, ds, rs, dsi, rsi, bw, blockbandwidths, israggedbelow)
8788 end
8889end
8990
@@ -146,8 +147,9 @@ function InterlaceOperator(ops::AbstractMatrix{<:Operator},ds::Space,rs::Space;
146147 dsi = interlacer (ds)
147148 rsi = interlacer (rs)
148149
149- MT = Matrix{Operator{promote_eltypeof (ops)}}
150- opsm = strictconvert (MT, ops)
150+ T = promote_eltypeof (ops)
151+ opsm = ops isa AbstractMatrix{Operator{T}} ? ops :
152+ map (x -> strictconvert (Operator{T}, x), ops)
151153 InterlaceOperator (opsm,ds,rs,
152154 cache (dsi),
153155 cache (rsi),
@@ -179,8 +181,10 @@ function InterlaceOperator(ops::VectorOrTupleOfOp, ds::Space, rs::Space;
179181 blockbandwidths = bandwidthsmax (ops, blockbandwidths),
180182 israggedbelow = all (israggedbelow, ops))
181183
182- VT = Vector{Operator{promote_eltypeof (ops)}}
183- opsv = strictconvert (VT, convert_vector (ops))
184+ T = promote_eltypeof (ops)
185+ opsabsv = convert_vector_or_svector (ops)
186+ opsv = opsabsv isa AbstractVector{Operator{T}} ? opsabsv :
187+ map (x -> convert (Operator{T}, x), opsabsv)
184188 InterlaceOperator (opsv,ds,rs,
185189 cache (BlockInterlacer (tuple (blocklengths (ds)))),
186190 cache (interlacer (rs)),
@@ -220,7 +224,7 @@ function convert(::Type{Operator{T}},S::InterlaceOperator) where T
220224 if T == eltype (S)
221225 S
222226 else
223- ops = convert (AbstractArray{ Operator{T}} , S. ops)
227+ ops = map (x -> convert (Operator{T},x) , S. ops)
224228 InterlaceOperator (ops,domainspace (S),rangespace (S),
225229 S. domaininterlacer,S. rangeinterlacer,S. bandwidths,
226230 S. blockbandwidths, S. israggedbelow)
0 commit comments