From ed007589cfc97d4b6c8d01a51719f2511d0ee3b3 Mon Sep 17 00:00:00 2001 From: Roland Grinis Date: Tue, 2 Mar 2021 14:54:07 +0000 Subject: [PATCH] LU decomposition set up --- .../kscience/kmath/tensors/RealTensorAlgebra.kt | 13 +++++++++++++ .../space/kscience/kmath/tensors/TensorAlgebra.kt | 3 +++ 2 files changed, 16 insertions(+) diff --git a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/tensors/RealTensorAlgebra.kt b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/tensors/RealTensorAlgebra.kt index 24612a6aa..f234d7d6a 100644 --- a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/tensors/RealTensorAlgebra.kt +++ b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/tensors/RealTensorAlgebra.kt @@ -1,5 +1,6 @@ package space.kscience.kmath.tensors +import space.kscience.kmath.linear.LupDecompositionFeature import space.kscience.kmath.nd.MutableNDBuffer import space.kscience.kmath.structures.RealBuffer import space.kscience.kmath.structures.array @@ -164,7 +165,19 @@ public class RealTensorAlgebra : TensorPartialDivisionAlgebra { + /** + * Main first task for @AndreiKingsley + * Compare with the implementation of [LupDecomposition] + * and provide a common API + */ + TODO("Not yet implemented") + } + override fun RealTensor.svd(): Triple { + /** + * Main first task for @AlyaNovikova + */ TODO("Not yet implemented") } diff --git a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/tensors/TensorAlgebra.kt b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/tensors/TensorAlgebra.kt index cddda7670..03f6f05c2 100644 --- a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/tensors/TensorAlgebra.kt +++ b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/tensors/TensorAlgebra.kt @@ -66,6 +66,9 @@ public interface TensorPartialDivisionAlgebra public fun TensorType.log(): TensorType public fun TensorType.logAssign(): Unit + //https://pytorch.org/docs/stable/generated/torch.lu.html + public fun TensorType.lu(): Pair + //https://pytorch.org/docs/stable/generated/torch.svd.html public fun TensorType.svd(): Triple