From 06bc8fecf6a8d004747d3b7a25f5f3b9f16fa965 Mon Sep 17 00:00:00 2001 From: Roland Grinis Date: Sat, 10 Jul 2021 22:21:20 +0100 Subject: [PATCH] LU decomp doc in NOA --- .../src/main/kotlin/space/kscience/kmath/noa/algebras.kt | 4 +++- .../kscience/kmath/tensors/api/LinearOpsTensorAlgebra.kt | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/kmath-noa/src/main/kotlin/space/kscience/kmath/noa/algebras.kt b/kmath-noa/src/main/kotlin/space/kscience/kmath/noa/algebras.kt index ec91436d6..fbd89a5a4 100644 --- a/kmath-noa/src/main/kotlin/space/kscience/kmath/noa/algebras.kt +++ b/kmath-noa/src/main/kotlin/space/kscience/kmath/noa/algebras.kt @@ -252,7 +252,9 @@ protected constructor(scope: NoaScope) : JNoa.qrTensor(tensor.tensorHandle, Q, R) return Pair(wrap(Q), wrap(R)) } - + /** + * this implementation satisfies `tensor = P dot L dot U` + */ override fun Tensor.lu(): Triple { val P = JNoa.emptyTensor() val L = JNoa.emptyTensor() diff --git a/kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/api/LinearOpsTensorAlgebra.kt b/kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/api/LinearOpsTensorAlgebra.kt index b8a99a560..ad6cc9e78 100644 --- a/kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/api/LinearOpsTensorAlgebra.kt +++ b/kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/api/LinearOpsTensorAlgebra.kt @@ -63,7 +63,7 @@ public interface LinearOpsTensorAlgebra : TensorPartialDivisionAlgebra { * * Computes the LUP decomposition of a matrix or a batch of matrices. * Given a tensor `input`, return tensors (P, L, U) satisfying : - * `P dot input = L dot U` or `input = P dot L dot U` + * `P dot input = L dot U` or `input = P dot L dot U` * depending on the implementation, with : * `P` being a permutation matrix or batch of matrices, * `L` being a lower triangular matrix or batch of matrices,