Skip to content

Commit 4bcb679

Browse files
committed
Add tests for image and null space for GPU
1 parent 4fbc3bf commit 4bcb679

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/implementations/truncation.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ function truncate(::typeof(left_null!), (U, S), strategy::TruncationStrategy)
1717
# TODO: avoid allocation?
1818
extended_S = vcat(diagview(S), zeros(eltype(S), max(0, size(S, 1) - size(S, 2))))
1919
ind = findtruncated(extended_S, strategy)
20-
return U[:, ind], ind
20+
trunc_cols = collect(1:size(U, 2))[ind]
21+
Utrunc = similar(U, (size(U, 1), length(trunc_cols)))
22+
Utrunc .= U[:, trunc_cols]
23+
return Utrunc, ind
2124
end
2225
function truncate(::typeof(right_null!), (S, Vᴴ), strategy::TruncationStrategy)
2326
# TODO: avoid allocation?

0 commit comments

Comments
 (0)