Skip to content

Commit b55f2df

Browse files
committed
Simplify
1 parent e835a39 commit b55f2df

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/factorizations/svd.jl

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,17 @@ function MatrixAlgebraKit.default_svd_algorithm(A::AbstractBlockSparseMatrix; kw
2121
return BlockPermutedDiagonalAlgorithm(alg)
2222
end
2323

24-
# TODO: this should be replaced with a more general similar function that can handle setting
25-
# the blocktype and element type - something like S = similar(A, BlockType(...))
26-
function _similar_S(A::AbstractBlockSparseMatrix, s_axis)
27-
T = real(eltype(A))
28-
return BlockSparseMatrix{T,Diagonal{T,Vector{T}}}(undef, (s_axis, s_axis))
29-
end
30-
3124
function similar_output(
3225
::typeof(svd_compact!),
3326
A,
3427
s_axis::AbstractUnitRange,
3528
alg::MatrixAlgebraKit.AbstractAlgorithm,
3629
)
3730
U = similar(A, axes(A, 1), s_axis)
38-
S = _similar_S(A, s_axis)
31+
T = real(eltype(A))
32+
# TODO: this should be replaced with a more general similar function that can handle setting
33+
# the blocktype and element type - something like S = similar(A, BlockType(...))
34+
S = BlockSparseMatrix{T,Diagonal{T,Vector{T}}}(undef, (s_axis, s_axis))
3935
Vt = similar(A, s_axis, axes(A, 2))
4036
return U, S, Vt
4137
end

0 commit comments

Comments
 (0)