removed transposition at the end of the svdGolubKahan

This commit is contained in:
margarita0303 2022-08-02 23:01:11 +03:00
parent 38ed6dd995
commit 68609d7846
2 changed files with 5 additions and 5 deletions

View File

@ -841,7 +841,7 @@ public open class DoubleTensorAlgebra :
val size = tensor.dimension
val commonShape = tensor.shape.sliceArray(0 until size - 2)
val (n, m) = tensor.shape.sliceArray(size - 2 until size)
val uTensor = zeros(commonShape + intArrayOf(m, n))
val uTensor = zeros(commonShape + intArrayOf(n, m))
val sTensor = zeros(commonShape + intArrayOf(m))
val vTensor = zeros(commonShape + intArrayOf(m, m))
@ -863,7 +863,7 @@ public open class DoubleTensorAlgebra :
iterations, epsilon)
}
return Triple(uTensor.transpose(), sTensor, vTensor)
return Triple(uTensor, sTensor, vTensor)
}
/**

View File

@ -647,9 +647,9 @@ internal fun MutableStructure2D<Double>.svdGolubKahanHelper(u: MutableStructure2
}
}
for (i in 0 until m) {
for (j in 0 until n) {
u[j, i] = this[i, j]
for (i in 0 until n) {
for (j in 0 until m) {
u[j, i] = this[j, i]
}
}
}