@@ -68,8 +68,8 @@ function MatrixAlgebraKit.initialize_output(
68
68
# this is a convention, which at least gives the expected results for blockdiagonal
69
69
emptyrows = setdiff (1 : bm, browIs)
70
70
emptycols = setdiff (1 : bn, bcolIs)
71
- for (row, col) in zip (emptyrows, emptycols)
72
- s_axes[col ] = infimum (brows[row], bcols[col])
71
+ for (I, ( row, col)) in enumerate ( zip (emptyrows, emptycols) )
72
+ s_axes[I + length (bIs) ] = infimum (brows[row], bcols[col])
73
73
end
74
74
75
75
s_axis = mortar_axis (s_axes)
@@ -88,9 +88,9 @@ function MatrixAlgebraKit.initialize_output(
88
88
end
89
89
90
90
# allocate output for blocks that aren't present -- do we also fill identities here?
91
- for (row, col) in zip (emptyrows, emptycols)
92
- @view! (U[Block (row, col )])
93
- @view! (Vt[Block (col , col)])
91
+ for (I, ( row, col)) in enumerate ( zip (emptyrows, emptycols) )
92
+ @view! (U[Block (row, I + length (bIs) )])
93
+ @view! (Vt[Block (I + length (bIs) , col)])
94
94
end
95
95
96
96
return U, S, Vt
@@ -117,7 +117,7 @@ function MatrixAlgebraKit.initialize_output(
117
117
v_axes = similar (bcols, bn)
118
118
119
119
# fill in values for blocks that are present
120
- bIs = sort! (collect (eachblockstoredindex (A)), by= Int ∘ last ∘ Tuple)
120
+ bIs = sort! (collect (eachblockstoredindex (A)); by= Int ∘ last ∘ Tuple)
121
121
browIs = Int .(first .(Tuple .(bIs)))
122
122
bcolIs = Int .(last .(Tuple .(bIs)))
123
123
for (I, bI) in enumerate (bIs)
@@ -132,9 +132,9 @@ function MatrixAlgebraKit.initialize_output(
132
132
u_axes[length (bIs) .+ (1 : length (emptyrows))] .= brows[emptyrows]
133
133
emptycols = setdiff (1 : bn, bcolIs)
134
134
v_axes[length (bIs) .+ (1 : length (emptycols))] .= bcols[emptycols]
135
-
135
+
136
136
u_axis = mortar_axis (u_axes)
137
- v_axis = mortar_axis (@show v_axes)
137
+ v_axis = mortar_axis (v_axes)
138
138
S_axes = (u_axis, v_axis)
139
139
U, S, Vt = similar_output (svd_full!, A, S_axes, alg)
140
140
@@ -151,12 +151,12 @@ function MatrixAlgebraKit.initialize_output(
151
151
152
152
# allocate output for blocks that aren't present -- do we also fill identities here?
153
153
for (I, row) in enumerate (emptyrows)
154
- @view! (U[Block (row, I)])
154
+ @view! (U[Block (row, length (bIs) + I)])
155
155
end
156
156
for (I, col) in enumerate (emptycols)
157
- @view! (Vt[Block (I, col)])
157
+ @view! (Vt[Block (length (bIs) + I, col)])
158
158
end
159
-
159
+
160
160
return U, S, Vt
161
161
end
162
162
@@ -210,9 +210,9 @@ function MatrixAlgebraKit.svd_compact!(
210
210
# needs copyto! instead because size(::LinearAlgebra.I) doesn't work
211
211
# U[Block(row, col)] = LinearAlgebra.I
212
212
# Vᴴ[Block(col, col)] = LinearAlgebra.I
213
- for (row, col) in zip (emptyrows, emptycols)
214
- copyto! (@view! (U[Block (row, col )]), LinearAlgebra. I)
215
- copyto! (@view! (Vᴴ[Block (col , col)]), LinearAlgebra. I)
213
+ for (I, ( row, col)) in enumerate ( zip (emptyrows, emptycols) )
214
+ copyto! (@view! (U[Block (row, I + length (bIs) )]), LinearAlgebra. I)
215
+ copyto! (@view! (Vᴴ[Block (I + length (bIs) , col)]), LinearAlgebra. I)
216
216
end
217
217
218
218
return (U, S, Vᴴ)
0 commit comments