We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 84fe2aa + f19cd8a commit 7f40992Copy full SHA for 7f40992
src/abstractblocksparsearray/abstractblocksparsematrix.jl
@@ -49,9 +49,10 @@ function _allocate_svd_output(A::AbstractBlockSparseMatrix, full::Bool, ::Algori
49
slengths[col] = min(brows[row], bcols[col])
50
end
51
52
- U = similar(A, axes(A, 1), blockedrange(slengths))
53
- S = similar(A, real(eltype(A)), blockedrange(slengths))
54
- Vt = similar(A, blockedrange(slengths), axes(A, 2))
+ s_axis = blockedrange(slengths)
+ U = similar(A, axes(A, 1), s_axis)
+ S = similar(A, real(eltype(A)), s_axis)
55
+ Vt = similar(A, s_axis, axes(A, 2))
56
57
return U, S, Vt
58
@@ -67,10 +68,10 @@ function svd!(
67
68
U, S, Vt = _allocate_svd_output(A, full, alg)
69
for bI in eachblockstoredindex(A)
70
bUSV = svd!(A[bI]; full, alg)
- brow, bcol = Int.(Tuple(bI))
71
- U[Block(brow, bcol)] = bUSV.U
72
- S[Block(bcol)] = bUSV.S
73
- Vt[Block(bcol, bcol)] = bUSV.Vt
+ brow, bcol = Tuple(bI)
+ U[brow, bcol] = bUSV.U
+ S[bcol] = bUSV.S
74
+ Vt[bcol, bcol] = bUSV.Vt
75
76
return SVD(U, S, Vt)
77
0 commit comments