You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3baa70f
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: src/pullbacks/svd.jl
+22-17Lines changed: 22 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -19,8 +19,9 @@ function check_and_prepare_svd_cotangents(
19
19
20
20
# Only the columns ind₀ ⊆ 1:r of UᴴΔAV are computed.
21
21
# By keeping its hermitian and antihermitian parts separate, we can reconstruct the full UᴴΔAV
22
-
J = indS .<= r
23
-
ind₀ = indS[J]
22
+
J₁ =findall(<=(r), indS)
23
+
J₂ =findall(>(r), indS)
24
+
ind₀ = indS[J₁]
24
25
k =length(ind₀)
25
26
full_rank = (ind₀ ==1:minmn)
26
27
@@ -29,11 +30,13 @@ function check_and_prepare_svd_cotangents(
29
30
m ==size(ΔU, 1) ||throw(DimensionMismatch(lazy"first dimension of ΔU ($(size(ΔU, 1))) does not match first dimension of U ($m)"))
30
31
length(indU) ==size(ΔU, 2) ||throw(DimensionMismatch(lazy"length of selected U columns ($(length(indU))) does not match second dimension of ΔU ($(size(ΔU, 2)))"))
@@ -54,11 +57,13 @@ function check_and_prepare_svd_cotangents(
54
57
n ==size(ΔVᴴ, 2) ||throw(DimensionMismatch(lazy"second dimension of ΔVᴴ ($(size(ΔVᴴ, 2))) does not match second dimension of Vᴴ ($n)"))
55
58
length(indV) ==size(ΔVᴴ, 1) ||throw(DimensionMismatch(lazy"length of selected Vᴴ rows ($(length(indV))) does not match first dimension of ΔVᴴ ($(size(ΔVᴴ, 1)))"))
0 commit comments