Golub-Kahan SVD algorithm for KMP tensors #499

Closed
grinisrit wants to merge 64 commits from dev into dev
Showing only changes of commit a497a5df1a - Show all commits

View File

@ -65,8 +65,7 @@ internal fun MutableStructure2D<Double>.svdGolabKahan(v: MutableStructure2D<Doub
f = this[i, i]
if (f >= 0) {
g = (-1) * abs(sqrt(s))
}
else {
} else {
g = abs(sqrt(s))
}
val h = f * g - s
@ -106,8 +105,7 @@ internal fun MutableStructure2D<Double>.svdGolabKahan(v: MutableStructure2D<Doub
f = this[i, l]
if (f >= 0) {
g = (-1) * abs(sqrt(s))
}
else {
} else {
g = abs(sqrt(s))
}
val h = f * g - s
@ -183,8 +181,7 @@ internal fun MutableStructure2D<Double>.svdGolabKahan(v: MutableStructure2D<Doub
for (j in i until m) {
this[j, i] *= g
}
}
else {
} else {
for (j in i until m) {
this[j, i] = 0.0
}