From d7a4228f5f5da85d425d6778080f8ab38488ee0e Mon Sep 17 00:00:00 2001 From: Iaroslav Postovalov Date: Thu, 20 May 2021 19:43:29 +0700 Subject: [PATCH] Add out variance to StructureND and some related types, make some unrelated changes --- CHANGELOG.md | 19 ++++++++++--------- README.md | 15 +++++++-------- docs/templates/README-TEMPLATE.md | 2 +- .../space/kscience/kmath/tensors/PCA.kt | 2 +- kmath-ast/README.md | 6 +++--- kmath-complex/README.md | 6 +++--- kmath-core/README.md | 6 +++--- .../kscience/kmath/linear/MatrixBuilder.kt | 2 +- .../kscience/kmath/linear/MatrixWrapper.kt | 13 ++++++------- .../kscience/kmath/linear/VirtualMatrix.kt | 2 +- .../space/kscience/kmath/nd/AlgebraND.kt | 8 ++++---- .../kscience/kmath/nd/BufferAlgebraND.kt | 2 +- .../space/kscience/kmath/nd/BufferND.kt | 2 +- .../space/kscience/kmath/nd/Structure1D.kt | 12 ++++++++---- .../space/kscience/kmath/nd/Structure2D.kt | 4 ++-- .../space/kscience/kmath/nd/StructureND.kt | 6 ++---- .../space/kscience/kmath/structures/Buffer.kt | 2 +- .../kmath/structures/FlaggedBuffer.kt | 2 +- .../kmath/expressions/SimpleAutoDiffTest.kt | 2 +- .../kmath/structures/LazyStructureND.kt | 2 +- kmath-ejml/README.md | 6 +++--- .../space/kscience/kmath/ejml/EjmlMatrix.kt | 2 +- kmath-for-real/README.md | 6 +++--- kmath-functions/README.md | 6 +++--- kmath-kotlingrad/README.md | 8 ++++---- kmath-memory/build.gradle.kts | 2 +- kmath-nd4j/README.md | 6 +++--- kmath-tensors/README.md | 14 +++++++------- 28 files changed, 83 insertions(+), 82 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5acd4660..274a403b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,19 +20,20 @@ - Space is replaced by Group. Space is reserved for vector spaces. - VectorSpace is now a vector space - Buffer factories for primitives moved to MutableBuffer.Companion -- NDStructure and NDAlgebra to StructureND and AlgebraND respectively -- Real -> Double +- Rename `NDStructure` and `NDAlgebra` to `StructureND` and `AlgebraND` respectively +- `Real` -> `Double` - DataSets are moved from functions to core - Redesign advanced Chain API -- Redesign MST. Remove MSTExpression. -- Move MST to core +- Redesign `MST`. Remove `MstExpression`. +- Move `MST` to core - Separated benchmarks and examples -- Rewritten EJML module without ejml-simple -- Stability of kmath-ast and kmath-kotilngrad promoted to EXPERIMENTAL. +- Rewrite `kmath-ejml` without `ejml-simple` artifact, support sparse matrices +- Promote stability of kmath-ast and kmath-kotlingrad to EXPERIMENTAL. - ColumnarData returns nullable column -- MST is made sealed interface -- Replaced MST.Symbolic by Symbol, Symbol now implements MST -- Removed Any restriction on polynomials +- `MST` is made sealed interface +- Replace `MST.Symbolic` by `Symbol`, `Symbol` now implements MST +- Remove Any restriction on polynomials +- Add `out` variance to type parameters of `StructureND` and its implementations where possible ### Deprecated diff --git a/README.md b/README.md index 519472a69..9117582ac 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ KMath is a modular library. Different modules provide different features with di * **PROTOTYPE**. On this level there are no compatibility guarantees. All methods and classes form those modules could break any moment. You can still use it, but be sure to fix the specific version. * **EXPERIMENTAL**. The general API is decided, but some changes could be made. Volatile API is marked with `@UnstableKmathAPI` or other stability warning annotations. -* **DEVELOPMENT**. API breaking genrally follows semantic versioning ideology. There could be changes in minor versions, but not in patch versions. API is protected with [binary-compatibility-validator](https://github.com/Kotlin/binary-compatibility-validator) tool. +* **DEVELOPMENT**. API breaking generally follows semantic versioning ideology. There could be changes in minor versions, but not in patch versions. API is protected with [binary-compatibility-validator](https://github.com/Kotlin/binary-compatibility-validator) tool. * **STABLE**. The API stabilized. Breaking changes are allowed only in major releases. @@ -213,7 +213,7 @@ One can still use generic algebras though. > > **Features:** > - [differentiable-mst-expression](kmath-kotlingrad/src/main/kotlin/space/kscience/kmath/kotlingrad/DifferentiableMstExpression.kt) : MST based DifferentiableExpression. -> - [differentiable-mst-expression](kmath-kotlingrad/src/main/kotlin/space/kscience/kmath/kotlingrad/DifferentiableMstExpression.kt) : Conversions between Kotlin∇'s SFun and MST +> - [differentiable-mst-expression](kmath-kotlingrad/src/main/kotlin/space/kscience/kmath/kotlingrad/DifferentiableMstExpression.kt) : Conversions between Kotlin∇'s SFun and MST
@@ -247,10 +247,9 @@ One can still use generic algebras though. > **Maturity**: PROTOTYPE > > **Features:** -> - [tensor algebra](kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/api/TensorAlgebra.kt) : Interface for basic linear algebra operations on tensors (plus, dot, etc.) -> - [linear algebra operations](kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/api/LinearOpsTensorAlgebra.kt) : Interface for advanced linear algebra operations like LU decomposition, SVD, etc. -> - [tensor algebra over Double](kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/core/DoubleTensorAlgebra.kt): Full implementation of operations for tensors over `Double`'s. -> - [tensor algebra with broadcasting](kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/core/BroadcastDoubleTensorAlgebra.kt) : Basic linear algebra operations implemented with broadcasting for tensors over `Double`'s. +> - [tensor algebra](kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/api/TensorAlgebra.kt) : Basic linear algebra operations on tensors (plus, dot, etc.) +> - [tensor algebra with broadcasting](kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/core/algebras/BroadcastDoubleTensorAlgebra.kt) : Basic linear algebra operations implemented with broadcasting. +> - [linear algebra operations](kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/api/LinearOpsTensorAlgebra.kt) : Advanced linear algebra operations like LU decomposition, SVD, etc.
@@ -294,8 +293,8 @@ repositories { } dependencies { - api("space.kscience:kmath-core:0.3.0-dev-8") - // api("space.kscience:kmath-core-jvm:0.3.0-dev-8") for jvm-specific version + api("space.kscience:kmath-core:0.3.0-dev-11") + // api("space.kscience:kmath-core-jvm:0.3.0-dev-11") for jvm-specific version } ``` diff --git a/docs/templates/README-TEMPLATE.md b/docs/templates/README-TEMPLATE.md index 99951b4d6..6bb1e9085 100644 --- a/docs/templates/README-TEMPLATE.md +++ b/docs/templates/README-TEMPLATE.md @@ -40,7 +40,7 @@ KMath is a modular library. Different modules provide different features with di * **PROTOTYPE**. On this level there are no compatibility guarantees. All methods and classes form those modules could break any moment. You can still use it, but be sure to fix the specific version. * **EXPERIMENTAL**. The general API is decided, but some changes could be made. Volatile API is marked with `@UnstableKmathAPI` or other stability warning annotations. -* **DEVELOPMENT**. API breaking genrally follows semantic versioning ideology. There could be changes in minor versions, but not in patch versions. API is protected with [binary-compatibility-validator](https://github.com/Kotlin/binary-compatibility-validator) tool. +* **DEVELOPMENT**. API breaking generally follows semantic versioning ideology. There could be changes in minor versions, but not in patch versions. API is protected with [binary-compatibility-validator](https://github.com/Kotlin/binary-compatibility-validator) tool. * **STABLE**. The API stabilized. Breaking changes are allowed only in major releases. diff --git a/examples/src/main/kotlin/space/kscience/kmath/tensors/PCA.kt b/examples/src/main/kotlin/space/kscience/kmath/tensors/PCA.kt index e47b87177..411e048d7 100644 --- a/examples/src/main/kotlin/space/kscience/kmath/tensors/PCA.kt +++ b/examples/src/main/kotlin/space/kscience/kmath/tensors/PCA.kt @@ -11,7 +11,7 @@ import space.kscience.kmath.tensors.core.BroadcastDoubleTensorAlgebra // simple PCA -fun main() = BroadcastDoubleTensorAlgebra { // work in context with broadcast methods +fun main(): Unit = BroadcastDoubleTensorAlgebra { // work in context with broadcast methods val seed = 100500L // assume x is range from 0 until 10 diff --git a/kmath-ast/README.md b/kmath-ast/README.md index 646ab4306..b0f2d59e5 100644 --- a/kmath-ast/README.md +++ b/kmath-ast/README.md @@ -10,7 +10,7 @@ Performance and visualization extensions to MST API. ## Artifact: -The Maven coordinates of this project are `space.kscience:kmath-ast:0.3.0-dev-8`. +The Maven coordinates of this project are `space.kscience:kmath-ast:0.3.0-dev-11`. **Gradle:** ```gradle @@ -20,7 +20,7 @@ repositories { } dependencies { - implementation 'space.kscience:kmath-ast:0.3.0-dev-8' + implementation 'space.kscience:kmath-ast:0.3.0-dev-11' } ``` **Gradle Kotlin DSL:** @@ -31,7 +31,7 @@ repositories { } dependencies { - implementation("space.kscience:kmath-ast:0.3.0-dev-8") + implementation("space.kscience:kmath-ast:0.3.0-dev-11") } ``` diff --git a/kmath-complex/README.md b/kmath-complex/README.md index ee5ad416f..04431cf6c 100644 --- a/kmath-complex/README.md +++ b/kmath-complex/README.md @@ -8,7 +8,7 @@ Complex and hypercomplex number systems in KMath. ## Artifact: -The Maven coordinates of this project are `space.kscience:kmath-complex:0.3.0-dev-8`. +The Maven coordinates of this project are `space.kscience:kmath-complex:0.3.0-dev-11`. **Gradle:** ```gradle @@ -18,7 +18,7 @@ repositories { } dependencies { - implementation 'space.kscience:kmath-complex:0.3.0-dev-8' + implementation 'space.kscience:kmath-complex:0.3.0-dev-11' } ``` **Gradle Kotlin DSL:** @@ -29,6 +29,6 @@ repositories { } dependencies { - implementation("space.kscience:kmath-complex:0.3.0-dev-8") + implementation("space.kscience:kmath-complex:0.3.0-dev-11") } ``` diff --git a/kmath-core/README.md b/kmath-core/README.md index 7283a18ce..700eaef38 100644 --- a/kmath-core/README.md +++ b/kmath-core/README.md @@ -15,7 +15,7 @@ performance calculations to code generation. ## Artifact: -The Maven coordinates of this project are `space.kscience:kmath-core:0.3.0-dev-8`. +The Maven coordinates of this project are `space.kscience:kmath-core:0.3.0-dev-11`. **Gradle:** ```gradle @@ -25,7 +25,7 @@ repositories { } dependencies { - implementation 'space.kscience:kmath-core:0.3.0-dev-8' + implementation 'space.kscience:kmath-core:0.3.0-dev-11' } ``` **Gradle Kotlin DSL:** @@ -36,6 +36,6 @@ repositories { } dependencies { - implementation("space.kscience:kmath-core:0.3.0-dev-8") + implementation("space.kscience:kmath-core:0.3.0-dev-11") } ``` diff --git a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/linear/MatrixBuilder.kt b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/linear/MatrixBuilder.kt index e6115a1e5..72d22233a 100644 --- a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/linear/MatrixBuilder.kt +++ b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/linear/MatrixBuilder.kt @@ -8,7 +8,7 @@ package space.kscience.kmath.linear import space.kscience.kmath.misc.UnstableKMathAPI import space.kscience.kmath.operations.Ring -public class MatrixBuilder>( +public class MatrixBuilder>( public val linearSpace: LinearSpace, public val rows: Int, public val columns: Int, diff --git a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/linear/MatrixWrapper.kt b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/linear/MatrixWrapper.kt index 4d1180c17..16aadab3b 100644 --- a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/linear/MatrixWrapper.kt +++ b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/linear/MatrixWrapper.kt @@ -16,7 +16,7 @@ import kotlin.reflect.KClass * * @param T the type of items. */ -public class MatrixWrapper internal constructor( +public class MatrixWrapper internal constructor( public val origin: Matrix, public val features: Set, ) : Matrix by origin { @@ -26,12 +26,11 @@ public class MatrixWrapper internal constructor( */ @UnstableKMathAPI @Suppress("UNCHECKED_CAST") - override fun getFeature(type: KClass): F? = features.singleOrNull { type.isInstance(it) } as? F - ?: origin.getFeature(type) + public override fun getFeature(type: KClass): F? = + features.singleOrNull(type::isInstance) as? F + ?: origin.getFeature(type) - override fun toString(): String { - return "MatrixWrapper(matrix=$origin, features=$features)" - } + public override fun toString(): String = "MatrixWrapper(matrix=$origin, features=$features)" } /** @@ -82,7 +81,7 @@ public fun LinearSpace>.zero( elementAlgebra.zero } + ZeroFeature -public class TransposedFeature(public val original: Matrix) : MatrixFeature +public class TransposedFeature(public val original: Matrix) : MatrixFeature /** * Create a virtual transposed matrix without copying anything. `A.transpose().transpose() === A` diff --git a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/linear/VirtualMatrix.kt b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/linear/VirtualMatrix.kt index e4c2b49f0..3751bd33b 100644 --- a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/linear/VirtualMatrix.kt +++ b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/linear/VirtualMatrix.kt @@ -10,7 +10,7 @@ package space.kscience.kmath.linear * * @property generator the function that provides elements. */ -public class VirtualMatrix( +public class VirtualMatrix( override val rowNum: Int, override val colNum: Int, public val generator: (i: Int, j: Int) -> T, diff --git a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/AlgebraND.kt b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/AlgebraND.kt index 1b3cb9e0a..93187eb41 100644 --- a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/AlgebraND.kt +++ b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/AlgebraND.kt @@ -26,7 +26,7 @@ public class ShapeMismatchException(public val expected: IntArray, public val ac * @param C the type of the element context. * @param N the type of the structure. */ -public interface AlgebraND> { +public interface AlgebraND> { /** * The shape of ND-structures this algebra operates on. */ @@ -121,7 +121,7 @@ internal fun > AlgebraND.checkShape(element: StructureND * @param N the type of ND structure. * @param S the type of space of structure elements. */ -public interface GroupND> : Group>, AlgebraND { +public interface GroupND> : Group>, AlgebraND { /** * Element-wise addition. * @@ -189,7 +189,7 @@ public interface GroupND> : Group>, AlgebraND> : Ring>, GroupND { +public interface RingND> : Ring>, GroupND { /** * Element-wise multiplication. * @@ -230,7 +230,7 @@ public interface RingND> : Ring>, GroupND { * @param N the type of ND structure. * @param F the type field of structure elements. */ -public interface FieldND> : Field>, RingND, ScaleOperations> { +public interface FieldND> : Field>, RingND, ScaleOperations> { /** * Element-wise division. * diff --git a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/BufferAlgebraND.kt b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/BufferAlgebraND.kt index 905a48d5c..2b82a36ae 100644 --- a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/BufferAlgebraND.kt +++ b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/BufferAlgebraND.kt @@ -11,7 +11,7 @@ import space.kscience.kmath.structures.BufferFactory import kotlin.contracts.InvocationKind import kotlin.contracts.contract -public interface BufferAlgebraND> : AlgebraND { +public interface BufferAlgebraND> : AlgebraND { public val strides: Strides public val bufferFactory: BufferFactory diff --git a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/BufferND.kt b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/BufferND.kt index 425808aeb..904419302 100644 --- a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/BufferND.kt +++ b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/BufferND.kt @@ -18,7 +18,7 @@ import space.kscience.kmath.structures.MutableBufferFactory * @param strides The strides to access elements of [Buffer] by linear indices. * @param buffer The underlying buffer. */ -public open class BufferND( +public open class BufferND( public val strides: Strides, public val buffer: Buffer, ) : StructureND { diff --git a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/Structure1D.kt b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/Structure1D.kt index cc0528793..150ebf6fb 100644 --- a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/Structure1D.kt +++ b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/Structure1D.kt @@ -15,7 +15,7 @@ import kotlin.jvm.JvmInline /** * A structure that is guaranteed to be one-dimensional */ -public interface Structure1D : StructureND, Buffer { +public interface Structure1D : StructureND, Buffer { public override val dimension: Int get() = 1 public override operator fun get(index: IntArray): T { @@ -42,7 +42,7 @@ public interface MutableStructure1D : Structure1D, MutableStructureND, * A 1D wrapper for nd-structure */ @JvmInline -private value class Structure1DWrapper(val structure: StructureND) : Structure1D { +private value class Structure1DWrapper(val structure: StructureND) : Structure1D { override val shape: IntArray get() = structure.shape override val size: Int get() = structure.shape[0] @@ -68,7 +68,11 @@ private class MutableStructure1DWrapper(val structure: MutableStructureND) } @PerformancePitfall - override fun copy(): MutableBuffer = structure.elements().map { it.second }.toMutableList().asMutableBuffer() + override fun copy(): MutableBuffer = structure + .elements() + .map(Pair::second) + .toMutableList() + .asMutableBuffer() } @@ -76,7 +80,7 @@ private class MutableStructure1DWrapper(val structure: MutableStructureND) * A structure wrapper for buffer */ @JvmInline -private value class Buffer1DWrapper(val buffer: Buffer) : Structure1D { +private value class Buffer1DWrapper(val buffer: Buffer) : Structure1D { override val shape: IntArray get() = intArrayOf(buffer.size) override val size: Int get() = buffer.size diff --git a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/Structure2D.kt b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/Structure2D.kt index 5b8183699..f353b6974 100644 --- a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/Structure2D.kt +++ b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/Structure2D.kt @@ -18,7 +18,7 @@ import kotlin.reflect.KClass * * @param T the type of items. */ -public interface Structure2D : StructureND { +public interface Structure2D : StructureND { /** * The number of rows in this structure. */ @@ -100,7 +100,7 @@ public interface MutableStructure2D : Structure2D, MutableStructureND { * A 2D wrapper for nd-structure */ @JvmInline -private value class Structure2DWrapper(val structure: StructureND) : Structure2D { +private value class Structure2DWrapper(val structure: StructureND) : Structure2D { override val shape: IntArray get() = structure.shape override val rowNum: Int get() = shape[0] diff --git a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/StructureND.kt b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/StructureND.kt index b9f1a063a..7fc91e321 100644 --- a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/StructureND.kt +++ b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/StructureND.kt @@ -24,7 +24,7 @@ public interface StructureFeature * * @param T the type of items. */ -public interface StructureND { +public interface StructureND { /** * The shape of structure, i.e. non-empty sequence of non-negative integers that specify sizes of dimensions of * this structure. @@ -213,9 +213,7 @@ public interface Strides { /** * Iterate over ND indices in a natural order */ - public fun indices(): Sequence = (0 until linearSize).asSequence().map { - index(it) - } + public fun indices(): Sequence = (0 until linearSize).asSequence().map(::index) } /** diff --git a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/structures/Buffer.kt b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/structures/Buffer.kt index be5dfb359..82f17b807 100644 --- a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/structures/Buffer.kt +++ b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/structures/Buffer.kt @@ -283,7 +283,7 @@ public value class ReadOnlyBuffer(public val buffer: MutableBuffer) : Buff * * @param T the type of elements provided by the buffer. */ -public class VirtualBuffer(override val size: Int, private val generator: (Int) -> T) : Buffer { +public class VirtualBuffer(override val size: Int, private val generator: (Int) -> T) : Buffer { override operator fun get(index: Int): T { if (index < 0 || index >= size) throw IndexOutOfBoundsException("Expected index from 0 to ${size - 1}, but found $index") return generator(index) diff --git a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/structures/FlaggedBuffer.kt b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/structures/FlaggedBuffer.kt index a63f452f5..0b16a3afc 100644 --- a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/structures/FlaggedBuffer.kt +++ b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/structures/FlaggedBuffer.kt @@ -37,7 +37,7 @@ public enum class ValueFlag(public val mask: Byte) { /** * A buffer with flagged values. */ -public interface FlaggedBuffer : Buffer { +public interface FlaggedBuffer : Buffer { public fun getFlag(index: Int): Byte } diff --git a/kmath-core/src/commonTest/kotlin/space/kscience/kmath/expressions/SimpleAutoDiffTest.kt b/kmath-core/src/commonTest/kotlin/space/kscience/kmath/expressions/SimpleAutoDiffTest.kt index c6852cbbf..201890933 100644 --- a/kmath-core/src/commonTest/kotlin/space/kscience/kmath/expressions/SimpleAutoDiffTest.kt +++ b/kmath-core/src/commonTest/kotlin/space/kscience/kmath/expressions/SimpleAutoDiffTest.kt @@ -17,7 +17,7 @@ import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertTrue -class SimpleAutoDiffTest { +internal class SimpleAutoDiffTest { fun dx( xBinding: Pair, diff --git a/kmath-coroutines/src/jvmMain/kotlin/space/kscience/kmath/structures/LazyStructureND.kt b/kmath-coroutines/src/jvmMain/kotlin/space/kscience/kmath/structures/LazyStructureND.kt index 1cd16054a..ded8c9c44 100644 --- a/kmath-coroutines/src/jvmMain/kotlin/space/kscience/kmath/structures/LazyStructureND.kt +++ b/kmath-coroutines/src/jvmMain/kotlin/space/kscience/kmath/structures/LazyStructureND.kt @@ -11,7 +11,7 @@ import space.kscience.kmath.misc.PerformancePitfall import space.kscience.kmath.nd.DefaultStrides import space.kscience.kmath.nd.StructureND -public class LazyStructureND( +public class LazyStructureND( public val scope: CoroutineScope, public override val shape: IntArray, public val function: suspend (IntArray) -> T, diff --git a/kmath-ejml/README.md b/kmath-ejml/README.md index cb12ef98d..79a28b824 100644 --- a/kmath-ejml/README.md +++ b/kmath-ejml/README.md @@ -9,7 +9,7 @@ EJML based linear algebra implementation. ## Artifact: -The Maven coordinates of this project are `space.kscience:kmath-ejml:0.3.0-dev-8`. +The Maven coordinates of this project are `space.kscience:kmath-ejml:0.3.0-dev-11`. **Gradle:** ```gradle @@ -19,7 +19,7 @@ repositories { } dependencies { - implementation 'space.kscience:kmath-ejml:0.3.0-dev-8' + implementation 'space.kscience:kmath-ejml:0.3.0-dev-11' } ``` **Gradle Kotlin DSL:** @@ -30,6 +30,6 @@ repositories { } dependencies { - implementation("space.kscience:kmath-ejml:0.3.0-dev-8") + implementation("space.kscience:kmath-ejml:0.3.0-dev-11") } ``` diff --git a/kmath-ejml/src/main/kotlin/space/kscience/kmath/ejml/EjmlMatrix.kt b/kmath-ejml/src/main/kotlin/space/kscience/kmath/ejml/EjmlMatrix.kt index fd43f295c..cec31eb7d 100644 --- a/kmath-ejml/src/main/kotlin/space/kscience/kmath/ejml/EjmlMatrix.kt +++ b/kmath-ejml/src/main/kotlin/space/kscience/kmath/ejml/EjmlMatrix.kt @@ -16,7 +16,7 @@ import space.kscience.kmath.nd.Structure2D * @property origin The underlying EJML matrix. * @author Iaroslav Postovalov */ -public abstract class EjmlMatrix(public open val origin: M) : Structure2D { +public abstract class EjmlMatrix(public open val origin: M) : Structure2D { public override val rowNum: Int get() = origin.numRows public override val colNum: Int get() = origin.numCols } diff --git a/kmath-for-real/README.md b/kmath-for-real/README.md index 8b3b8e9e0..5ca805093 100644 --- a/kmath-for-real/README.md +++ b/kmath-for-real/README.md @@ -9,7 +9,7 @@ Specialization of KMath APIs for Double numbers. ## Artifact: -The Maven coordinates of this project are `space.kscience:kmath-for-real:0.3.0-dev-8`. +The Maven coordinates of this project are `space.kscience:kmath-for-real:0.3.0-dev-11`. **Gradle:** ```gradle @@ -19,7 +19,7 @@ repositories { } dependencies { - implementation 'space.kscience:kmath-for-real:0.3.0-dev-8' + implementation 'space.kscience:kmath-for-real:0.3.0-dev-11' } ``` **Gradle Kotlin DSL:** @@ -30,6 +30,6 @@ repositories { } dependencies { - implementation("space.kscience:kmath-for-real:0.3.0-dev-8") + implementation("space.kscience:kmath-for-real:0.3.0-dev-11") } ``` diff --git a/kmath-functions/README.md b/kmath-functions/README.md index 4f592c845..2497f7102 100644 --- a/kmath-functions/README.md +++ b/kmath-functions/README.md @@ -11,7 +11,7 @@ Functions and interpolations. ## Artifact: -The Maven coordinates of this project are `space.kscience:kmath-functions:0.3.0-dev-8`. +The Maven coordinates of this project are `space.kscience:kmath-functions:0.3.0-dev-11`. **Gradle:** ```gradle @@ -21,7 +21,7 @@ repositories { } dependencies { - implementation 'space.kscience:kmath-functions:0.3.0-dev-8' + implementation 'space.kscience:kmath-functions:0.3.0-dev-11' } ``` **Gradle Kotlin DSL:** @@ -32,6 +32,6 @@ repositories { } dependencies { - implementation("space.kscience:kmath-functions:0.3.0-dev-8") + implementation("space.kscience:kmath-functions:0.3.0-dev-11") } ``` diff --git a/kmath-kotlingrad/README.md b/kmath-kotlingrad/README.md index 686df3271..4393cbf8c 100644 --- a/kmath-kotlingrad/README.md +++ b/kmath-kotlingrad/README.md @@ -1,6 +1,6 @@ # Module kmath-kotlingrad -[Kotlin∇](https://github.com/breandan/kotlingrad) integration module. +[Kotlin∇](https://www.htmlsymbols.xyz/unicode/U+2207) integration module. - [differentiable-mst-expression](src/main/kotlin/space/kscience/kmath/kotlingrad/DifferentiableMstExpression.kt) : MST based DifferentiableExpression. - [differentiable-mst-expression](src/main/kotlin/space/kscience/kmath/kotlingrad/DifferentiableMstExpression.kt) : Conversions between Kotlin∇'s SFun and MST @@ -8,7 +8,7 @@ ## Artifact: -The Maven coordinates of this project are `space.kscience:kmath-kotlingrad:0.3.0-dev-8`. +The Maven coordinates of this project are `space.kscience:kmath-kotlingrad:0.3.0-dev-11`. **Gradle:** ```gradle @@ -18,7 +18,7 @@ repositories { } dependencies { - implementation 'space.kscience:kmath-kotlingrad:0.3.0-dev-8' + implementation 'space.kscience:kmath-kotlingrad:0.3.0-dev-11' } ``` **Gradle Kotlin DSL:** @@ -29,6 +29,6 @@ repositories { } dependencies { - implementation("space.kscience:kmath-kotlingrad:0.3.0-dev-8") + implementation("space.kscience:kmath-kotlingrad:0.3.0-dev-11") } ``` diff --git a/kmath-memory/build.gradle.kts b/kmath-memory/build.gradle.kts index 288c61a51..4478e5b80 100644 --- a/kmath-memory/build.gradle.kts +++ b/kmath-memory/build.gradle.kts @@ -7,6 +7,6 @@ plugins { readme { maturity = ru.mipt.npm.gradle.Maturity.DEVELOPMENT description = """ - An API and basic implementation for arranging objects in a continous memory block. + An API and basic implementation for arranging objects in a continuous memory block. """.trimIndent() } diff --git a/kmath-nd4j/README.md b/kmath-nd4j/README.md index 5f33c1db1..6408be13b 100644 --- a/kmath-nd4j/README.md +++ b/kmath-nd4j/README.md @@ -9,7 +9,7 @@ ND4J based implementations of KMath abstractions. ## Artifact: -The Maven coordinates of this project are `space.kscience:kmath-nd4j:0.3.0-dev-8`. +The Maven coordinates of this project are `space.kscience:kmath-nd4j:0.3.0-dev-11`. **Gradle:** ```gradle @@ -19,7 +19,7 @@ repositories { } dependencies { - implementation 'space.kscience:kmath-nd4j:0.3.0-dev-8' + implementation 'space.kscience:kmath-nd4j:0.3.0-dev-11' } ``` **Gradle Kotlin DSL:** @@ -30,7 +30,7 @@ repositories { } dependencies { - implementation("space.kscience:kmath-nd4j:0.3.0-dev-8") + implementation("space.kscience:kmath-nd4j:0.3.0-dev-11") } ``` diff --git a/kmath-tensors/README.md b/kmath-tensors/README.md index affdad665..75de2bf35 100644 --- a/kmath-tensors/README.md +++ b/kmath-tensors/README.md @@ -2,14 +2,14 @@ Common linear algebra operations on tensors. - - [tensor algebra](src/commonMain/kotlin/space/kscience/kmath/tensors/api/TensorAlgebra.kt) : Interface for basic linear algebra operations on tensors (plus, dot, etc.) - - [linear algebra operations](src/commonMain/kotlin/space/kscience/kmath/tensors/api/LinearOpsTensorAlgebra.kt) : Interface for advanced linear algebra operations like LU decomposition, SVD, etc. - - [tensor algebra over Double](src/commonMain/kotlin/space/kscience/kmath/tensors/core/DoubleTensorAlgebra.kt): Full implementation of operations for tensors over `Double`'s. - - [tensor algebra with broadcasting](src/commonMain/kotlin/space/kscience/kmath/tensors/core/BroadcastDoubleTensorAlgebra.kt) : Basic linear algebra operations implemented with broadcasting for tensors over `Double`'s. + - [tensor algebra](src/commonMain/kotlin/space/kscience/kmath/tensors/api/TensorAlgebra.kt) : Basic linear algebra operations on tensors (plus, dot, etc.) + - [tensor algebra with broadcasting](src/commonMain/kotlin/space/kscience/kmath/tensors/core/algebras/BroadcastDoubleTensorAlgebra.kt) : Basic linear algebra operations implemented with broadcasting. + - [linear algebra operations](src/commonMain/kotlin/space/kscience/kmath/tensors/api/LinearOpsTensorAlgebra.kt) : Advanced linear algebra operations like LU decomposition, SVD, etc. + ## Artifact: -The Maven coordinates of this project are `space.kscience:kmath-tensors:0.3.0-dev-8`. +The Maven coordinates of this project are `space.kscience:kmath-tensors:0.3.0-dev-11`. **Gradle:** ```gradle @@ -19,7 +19,7 @@ repositories { } dependencies { - implementation 'space.kscience:kmath-tensors:0.3.0-dev-8' + implementation 'space.kscience:kmath-tensors:0.3.0-dev-11' } ``` **Gradle Kotlin DSL:** @@ -30,6 +30,6 @@ repositories { } dependencies { - implementation("space.kscience:kmath-tensors:0.3.0-dev-8") + implementation("space.kscience:kmath-tensors:0.3.0-dev-11") } ```