Skip to content

Commit c875ecc

Browse files
authored
Improve type-inference in LowRankOperator bandwidth (#442)
1 parent c13e52b commit c875ecc

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Operators/almostbanded/LowRankOperator.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,9 @@ function convert(::Type{Operator{T}},L::LowRankOperator{S}) where {S,T}
4242
end
4343

4444

45-
datasize(L::LowRankOperator,k) =
46-
k==1 ? mapreduce(ncoefficients,max,L.U) : mapreduce(a -> bandwidth(a,1) + bandwidth(a,2)+1,max,L.V)
47-
datasize(L::LowRankOperator) = datasize(L,1),datasize(L,2)
48-
bandwidths(L::LowRankOperator) = datasize(L,1)-1,datasize(L,2)-1
45+
datasize(L::LowRankOperator,k) = datasize(L)[k]
46+
datasize(L::LowRankOperator) = (mapreduce(ncoefficients,max,L.U), mapreduce(a -> bandwidth(a,1) + bandwidth(a,2)+1,max,L.V))
47+
bandwidths(L::LowRankOperator) = datasize(L) .- 1
4948

5049
domainspace(L::LowRankOperator) = domainspace(first(L.V))
5150
rangespace(L::LowRankOperator) = space(first(L.U))

0 commit comments

Comments
 (0)