Skip to content

Commit e8d8b12

Browse files
committed
improve truncation
1 parent 84537c7 commit e8d8b12

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/implementations/truncation.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@ end
2828

2929
# special case `NoTruncation` for null: should keep exact zeros due to rectangularity
3030
function truncate(::typeof(left_null!), (U, S), strategy::NoTruncation)
31-
ind = (1:max(0, size(S, 1) - size(S, 2))) .+ length(diagview(S))
31+
m, n = size(S)
32+
ind = (n + 1):m
3233
return U[:, ind], ind
3334
end
3435
function truncate(::typeof(right_null!), (S, Vᴴ), strategy::NoTruncation)
35-
ind = (1:max(0, size(S, 2) - size(S, 1))) .+ length(diagview(S))
36+
m, n = size(S)
37+
ind = (m + 1):n
3638
return Vᴴ[ind, :], ind
3739
end
3840

0 commit comments

Comments
 (0)