Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/Operators/general/InterlaceOperator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ const MatrixInterlaceOperator = InterlaceOperator{T,2,DS,RS} where {T,DS,RS<:Spa
__interlace_ops_bandwidths(ops::AbstractMatrix) = bandwidths.(ops)
__interlace_ops_bandwidths(ops::Diagonal) = bandwidths.(parent(ops))
function __interlace_bandwidths_square(ops::AbstractMatrix, bw = __interlace_ops_bandwidths(ops))
Base.require_one_based_indexing(ops)
p=size(ops,1)
l,u = 0,0
opbw = bw[1,1]
l,u = p*opbw[1], p*opbw[2]
for k=axes(ops,1), j=axes(ops,2)
opbw = bw[k,j]
l = max(l, p*opbw[1]+k-j)
Expand All @@ -105,8 +107,9 @@ function __interlace_bandwidths_square(ops::AbstractMatrix, bw = __interlace_ops
end
function __interlace_bandwidths_square(ops::Diagonal, bw = __interlace_ops_bandwidths(ops))
p=size(ops,1)
l,u = 0,0
for k=axes(ops,1)
opbw = bw[1]
l,u = p*opbw[1], p*opbw[2]
for k=axes(ops,1)[2:end]
opbw = bw[k]
l = max(l, p*opbw[1])
u = max(u, p*opbw[2])
Expand Down