@@ -138,14 +138,10 @@ function MatrixAlgebraKit.svd_compact!(
138
138
)
139
139
check_input (svd_compact!, A, USVᴴ, alg)
140
140
141
- Ad, rowperm, colperm = blockdiagonalize (A)
141
+ Ad, transform_rows, transform_cols = blockdiagonalize (A)
142
142
Ud, S, Vᴴd = svd_compact! (Ad, BlockDiagonalAlgorithm (alg))
143
-
144
- inv_rowperm = Block .(invperm (Int .(rowperm)))
145
- U = Ud[inv_rowperm, :]
146
-
147
- inv_colperm = Block .(invperm (Int .(colperm)))
148
- Vᴴ = Vᴴd[:, inv_colperm]
143
+ U = transform_rows (Ud)
144
+ Vᴴ = transform_cols (Vᴴd)
149
145
150
146
return U, S, Vᴴ
151
147
end
@@ -177,14 +173,10 @@ function MatrixAlgebraKit.svd_full!(
177
173
)
178
174
check_input (svd_full!, A, USVᴴ, alg)
179
175
180
- Ad, rowperm, colperm = blockdiagonalize (A)
176
+ Ad, transform_rows, transform_cols = blockdiagonalize (A)
181
177
Ud, S, Vᴴd = svd_full! (Ad, BlockDiagonalAlgorithm (alg))
182
-
183
- inv_rowperm = Block .(invperm (Int .(rowperm)))
184
- U = Ud[inv_rowperm, :]
185
-
186
- inv_colperm = Block .(invperm (Int .(colperm)))
187
- Vᴴ = Vᴴd[:, inv_colperm]
178
+ U = transform_rows (Ud)
179
+ Vᴴ = transform_cols (Vᴴd)
188
180
189
181
return U, S, Vᴴ
190
182
end
0 commit comments