Golub-Kahan SVD algorithm for KMP tensors #499
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user