Skip to content

Commit 43dde4c

Browse files
committed
refactor null truncation
1 parent b1a594b commit 43dde4c

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/implementations/truncation.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@ function truncate(::typeof(right_null!), (S, Vᴴ), strategy::TruncationStrategy
2626
return Vᴴ[ind, :], ind
2727
end
2828

29+
# special case `NoTruncation` for null: should keep exact zeros due to rectangularity
30+
function truncate(::typeof(left_null!), (U, S), strategy::NoTruncation)
31+
ind = (1:max(0, size(S, 1) - size(S, 2))) .+ length(diagview(S))
32+
return U[:, ind], ind
33+
end
34+
function truncate(::typeof(right_null!), (S, Vᴴ), strategy::NoTruncation)
35+
ind = (1:max(0, size(S, 2) - size(S, 1))) .+ length(diagview(S))
36+
return Vᴴ[ind, :], ind
37+
end
38+
39+
2940
# findtruncated
3041
# -------------
3142
# Generic fallback

0 commit comments

Comments
 (0)