forked from kscience/kmath
fix
This commit is contained in:
parent
2503d35ba8
commit
139534fdb3
@ -183,11 +183,7 @@ public class DoubleLinearOpsTensorAlgebra :
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun MutableStructure1D<Double>.l2Norm(): Double {
|
private fun MutableStructure1D<Double>.l2Norm(): Double {
|
||||||
var squareSum = 0.0
|
return sqrt((0 until size).sumOf { this[it] * this[it] })
|
||||||
for (i in 0 until size) {
|
|
||||||
squareSum += this[i] * this[i]
|
|
||||||
}
|
|
||||||
return sqrt(squareSum)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun qrHelper(
|
fun qrHelper(
|
||||||
@ -223,7 +219,7 @@ public class DoubleLinearOpsTensorAlgebra :
|
|||||||
val (q, r) = qr
|
val (q, r) = qr
|
||||||
qrHelper(matrix.as2D(), q.as2D(), r.as2D())
|
qrHelper(matrix.as2D(), q.as2D(), r.as2D())
|
||||||
}
|
}
|
||||||
return Pair(qTensor, rTensor)
|
return qTensor to rTensor
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun DoubleTensor.svd(): Triple<DoubleTensor, DoubleTensor, DoubleTensor> {
|
override fun DoubleTensor.svd(): Triple<DoubleTensor, DoubleTensor, DoubleTensor> {
|
||||||
|
Loading…
Reference in New Issue
Block a user