Skip to content

Commit b431b32

Browse files
committed
Add comment about copyto! with LinearAlgebra.I
1 parent 4322f5c commit b431b32

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/factorizations/svd.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ function MatrixAlgebraKit.svd_compact!(
191191
bcolIs = Int.(last.(Tuple.(bIs)))
192192
emptyrows = setdiff(1:blocksize(A, 1), browIs)
193193
emptycols = setdiff(1:blocksize(A, 2), bcolIs)
194+
# needs copyto! instead because size(::LinearAlgebra.I) doesn't work
195+
# U[Block(row, col)] = LinearAlgebra.I
196+
# Vt[Block(col, col)] = LinearAlgebra.I
194197
for (row, col) in zip(emptyrows, emptycols)
195198
copyto!(@view!(U[Block(row, col)]), LinearAlgebra.I)
196199
copyto!(@view!(Vt[Block(col, col)]), LinearAlgebra.I)
@@ -221,6 +224,9 @@ function MatrixAlgebraKit.svd_full!(
221224
bcolIs = Int.(last.(Tuple.(bIs)))
222225
emptyrows = setdiff(1:blocksize(A, 1), browIs)
223226
emptycols = setdiff(1:blocksize(A, 2), bcolIs)
227+
# needs copyto! instead because size(::LinearAlgebra.I) doesn't work
228+
# U[Block(row, col)] = LinearAlgebra.I
229+
# Vt[Block(col, col)] = LinearAlgebra.I
224230
for (row, col) in zip(emptyrows, emptycols)
225231
copyto!(@view!(U[Block(row, col)]), LinearAlgebra.I)
226232
copyto!(@view!(Vt[Block(col, col)]), LinearAlgebra.I)

0 commit comments

Comments
 (0)