From 65c696254408c960f3b83ce1f909b1cf69f9f526 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Fri, 26 May 2023 16:46:18 +0300 Subject: [PATCH 01/11] Update build tools --- build.gradle.kts | 2 +- gradle.properties | 6 +++--- .../space/kscience/kmath/ast/rendering/TestFeatures.kt | 2 +- .../kscience/kmath/internal/binaryen/index.binaryen.kt | 1 - kmath-complex/build.gradle.kts | 1 - kmath-memory/build.gradle.kts | 5 +++++ .../kotlin/space/kscience/kmath/memory/NativeMemory.kt | 4 ++++ 7 files changed, 14 insertions(+), 7 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index aed79909c..7dbe87445 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -15,7 +15,7 @@ allprojects { } group = "space.kscience" - version = "0.3.1" + version = "0.3.2-dev-1" } subprojects { diff --git a/gradle.properties b/gradle.properties index fee75d428..76f51c4af 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,8 +9,8 @@ kotlin.native.ignoreDisabledTargets=true org.gradle.configureondemand=true org.gradle.jvmargs=-Xmx4096m -toolsVersion=0.14.8-kotlin-1.8.20 - - org.gradle.parallel=true org.gradle.workers.max=4 + +toolsVersion=0.14.8-kotlin-1.9.0-Beta +#kscience.wasm.disabled=true \ No newline at end of file diff --git a/kmath-ast/src/commonTest/kotlin/space/kscience/kmath/ast/rendering/TestFeatures.kt b/kmath-ast/src/commonTest/kotlin/space/kscience/kmath/ast/rendering/TestFeatures.kt index 7b5ec5765..bb6d39204 100644 --- a/kmath-ast/src/commonTest/kotlin/space/kscience/kmath/ast/rendering/TestFeatures.kt +++ b/kmath-ast/src/commonTest/kotlin/space/kscience/kmath/ast/rendering/TestFeatures.kt @@ -17,7 +17,7 @@ internal class TestFeatures { fun printNumeric() { val num = object : Number() { override fun toByte(): Byte = throw UnsupportedOperationException() - override fun toChar(): Char = throw UnsupportedOperationException() +// override fun toChar(): Char = throw UnsupportedOperationException() override fun toDouble(): Double = throw UnsupportedOperationException() override fun toFloat(): Float = throw UnsupportedOperationException() override fun toInt(): Int = throw UnsupportedOperationException() diff --git a/kmath-ast/src/jsMain/kotlin/space/kscience/kmath/internal/binaryen/index.binaryen.kt b/kmath-ast/src/jsMain/kotlin/space/kscience/kmath/internal/binaryen/index.binaryen.kt index d907a12c9..f2e1aae83 100644 --- a/kmath-ast/src/jsMain/kotlin/space/kscience/kmath/internal/binaryen/index.binaryen.kt +++ b/kmath-ast/src/jsMain/kotlin/space/kscience/kmath/internal/binaryen/index.binaryen.kt @@ -8,7 +8,6 @@ "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS", - "NO_EXPLICIT_VISIBILITY_IN_API_MODE_WARNING", "PropertyName", "ClassName", ) diff --git a/kmath-complex/build.gradle.kts b/kmath-complex/build.gradle.kts index 2f8c320cf..3e8b3b75e 100644 --- a/kmath-complex/build.gradle.kts +++ b/kmath-complex/build.gradle.kts @@ -6,7 +6,6 @@ kscience { jvm() js() native() - wasm() dependencies { diff --git a/kmath-memory/build.gradle.kts b/kmath-memory/build.gradle.kts index fe422f751..63811d784 100644 --- a/kmath-memory/build.gradle.kts +++ b/kmath-memory/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension + plugins { id("space.kscience.gradle.mpp") } @@ -15,3 +17,6 @@ readme { An API and basic implementation for arranging objects in a continuous memory block. """.trimIndent() } + +rootProject.the().versions.webpack.version = "5.76.2" +rootProject.the().nodeVersion = "20.2.0" diff --git a/kmath-memory/src/nativeMain/kotlin/space/kscience/kmath/memory/NativeMemory.kt b/kmath-memory/src/nativeMain/kotlin/space/kscience/kmath/memory/NativeMemory.kt index 32bc8d6a5..0ae3c7ebc 100644 --- a/kmath-memory/src/nativeMain/kotlin/space/kscience/kmath/memory/NativeMemory.kt +++ b/kmath-memory/src/nativeMain/kotlin/space/kscience/kmath/memory/NativeMemory.kt @@ -5,6 +5,8 @@ package space.kscience.kmath.memory +import kotlin.experimental.ExperimentalNativeApi + @PublishedApi internal class NativeMemory( val array: ByteArray, @@ -26,6 +28,7 @@ internal class NativeMemory( return NativeMemory(copy) } + @OptIn(ExperimentalNativeApi::class) private val reader: MemoryReader = object : MemoryReader { override val memory: Memory get() = this@NativeMemory @@ -48,6 +51,7 @@ internal class NativeMemory( override fun reader(): MemoryReader = reader + @OptIn(ExperimentalNativeApi::class) private val writer: MemoryWriter = object : MemoryWriter { override val memory: Memory get() = this@NativeMemory From c940645e2e2591314ce7149370ccad9a53b3832d Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Tue, 6 Jun 2023 17:43:38 +0300 Subject: [PATCH 02/11] fix simja version --- gradle.properties | 5 +++-- kmath-symja/build.gradle.kts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index 76f51c4af..0fdf1a058 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,5 +12,6 @@ org.gradle.jvmargs=-Xmx4096m org.gradle.parallel=true org.gradle.workers.max=4 -toolsVersion=0.14.8-kotlin-1.9.0-Beta -#kscience.wasm.disabled=true \ No newline at end of file +toolsVersion=0.14.9-kotlin-1.9.0-Beta +kotlin.experimental.tryK2=true +kscience.wasm.disabled=true \ No newline at end of file diff --git a/kmath-symja/build.gradle.kts b/kmath-symja/build.gradle.kts index 8741de2ae..a996f3bec 100644 --- a/kmath-symja/build.gradle.kts +++ b/kmath-symja/build.gradle.kts @@ -10,7 +10,7 @@ plugins { description = "Symja integration module" dependencies { - api("org.matheclipse:matheclipse-core:2.0.0-SNAPSHOT") { + api("org.matheclipse:matheclipse-core:2.0.0") { // Incorrect transitive dependencies exclude("org.apfloat", "apfloat") exclude("org.hipparchus", "hipparchus-clustering") From 1f6b7abf464b1564ff442b3cfc71b3ead72ec791 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Wed, 7 Jun 2023 15:16:58 +0300 Subject: [PATCH 03/11] wasm test version --- gradle.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index 0fdf1a058..9ffc1ebe3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,6 +12,6 @@ org.gradle.jvmargs=-Xmx4096m org.gradle.parallel=true org.gradle.workers.max=4 -toolsVersion=0.14.9-kotlin-1.9.0-Beta -kotlin.experimental.tryK2=true -kscience.wasm.disabled=true \ No newline at end of file +toolsVersion=0.14.9-kotlin-1.9.0-Beta-dev-3 +#kotlin.experimental.tryK2=true +#kscience.wasm.disabled=true \ No newline at end of file From a001c7402579aa822a3659b752e58238231f4af7 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Thu, 22 Jun 2023 08:49:51 +0300 Subject: [PATCH 04/11] 1.9.0-RC --- buildSrc/settings.gradle.kts | 1 - gradle.properties | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts index e6b69b0b3..02111ba37 100644 --- a/buildSrc/settings.gradle.kts +++ b/buildSrc/settings.gradle.kts @@ -2,7 +2,6 @@ * Copyright 2018-2021 KMath contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -rootProject.name = "kmath" enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") diff --git a/gradle.properties b/gradle.properties index 9ffc1ebe3..81eb66e34 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,6 +12,6 @@ org.gradle.jvmargs=-Xmx4096m org.gradle.parallel=true org.gradle.workers.max=4 -toolsVersion=0.14.9-kotlin-1.9.0-Beta-dev-3 -#kotlin.experimental.tryK2=true +toolsVersion=0.14.9-kotlin-1.9.0-RC-dev-1 +kotlin.experimental.tryK2=true #kscience.wasm.disabled=true \ No newline at end of file From 23c0758ba6e523b587df4d2329b39c3acc4253b4 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Wed, 13 Sep 2023 13:25:54 +0300 Subject: [PATCH 05/11] Kotlin 1.9.20 --- build.gradle.kts | 12 ++---------- gradle.properties | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- .../kotlin/space/kscience/kmath/misc/numbers.kt | 0 .../space/kscience/kmath/operations/isInteger.kt | 0 .../kscience/kmath/memory/WasmDataViewMemory.kt | 0 6 files changed, 5 insertions(+), 13 deletions(-) rename kmath-core/src/{wasmMain => wasmJsMain}/kotlin/space/kscience/kmath/misc/numbers.kt (100%) rename kmath-core/src/{wasmMain => wasmJsMain}/kotlin/space/kscience/kmath/operations/isInteger.kt (100%) rename kmath-memory/src/{wasmMain => wasmJsMain}/kotlin/space/kscience/kmath/memory/WasmDataViewMemory.kt (100%) diff --git a/build.gradle.kts b/build.gradle.kts index 7dbe87445..e4be11db2 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,3 @@ -import space.kscience.gradle.isInDevelopment import space.kscience.gradle.useApache2Licence import space.kscience.gradle.useSPCTeam @@ -64,17 +63,10 @@ ksciencePublish { useApache2Licence() useSPCTeam() } - github("kmath", "SciProgCentre") - space( - if (isInDevelopment) { - "https://maven.pkg.jetbrains.space/spc/p/sci/dev" - } else { - "https://maven.pkg.jetbrains.space/spc/p/sci/maven" - } - ) + repository("spc","https://maven.sciprog.center/kscience") sonatype("https://oss.sonatype.org") } apiValidation.nonPublicMarkers.add("space.kscience.kmath.UnstableKMathAPI") -val multikVersion by extra("0.2.0") +val multikVersion by extra("0.2.2") diff --git a/gradle.properties b/gradle.properties index 81eb66e34..fc9bb4ee7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,6 +12,6 @@ org.gradle.jvmargs=-Xmx4096m org.gradle.parallel=true org.gradle.workers.max=4 -toolsVersion=0.14.9-kotlin-1.9.0-RC-dev-1 -kotlin.experimental.tryK2=true +toolsVersion=0.15.0-kotlin-1.9.20-Beta +#kotlin.experimental.tryK2=true #kscience.wasm.disabled=true \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index fae08049a..db9a6b825 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/kmath-core/src/wasmMain/kotlin/space/kscience/kmath/misc/numbers.kt b/kmath-core/src/wasmJsMain/kotlin/space/kscience/kmath/misc/numbers.kt similarity index 100% rename from kmath-core/src/wasmMain/kotlin/space/kscience/kmath/misc/numbers.kt rename to kmath-core/src/wasmJsMain/kotlin/space/kscience/kmath/misc/numbers.kt diff --git a/kmath-core/src/wasmMain/kotlin/space/kscience/kmath/operations/isInteger.kt b/kmath-core/src/wasmJsMain/kotlin/space/kscience/kmath/operations/isInteger.kt similarity index 100% rename from kmath-core/src/wasmMain/kotlin/space/kscience/kmath/operations/isInteger.kt rename to kmath-core/src/wasmJsMain/kotlin/space/kscience/kmath/operations/isInteger.kt diff --git a/kmath-memory/src/wasmMain/kotlin/space/kscience/kmath/memory/WasmDataViewMemory.kt b/kmath-memory/src/wasmJsMain/kotlin/space/kscience/kmath/memory/WasmDataViewMemory.kt similarity index 100% rename from kmath-memory/src/wasmMain/kotlin/space/kscience/kmath/memory/WasmDataViewMemory.kt rename to kmath-memory/src/wasmJsMain/kotlin/space/kscience/kmath/memory/WasmDataViewMemory.kt From 7a4e9e70f99dcb215b349d4842448b36ba0096b1 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Fri, 22 Sep 2023 08:21:14 +0300 Subject: [PATCH 06/11] add some quaternion operations --- .../space/kscience/kmath/ejml/_generated.kt | 10 +++++-- .../kmath/geometry/quaternionOperations.kt | 29 +++++++++++-------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/kmath-ejml/src/main/kotlin/space/kscience/kmath/ejml/_generated.kt b/kmath-ejml/src/main/kotlin/space/kscience/kmath/ejml/_generated.kt index f48ab4c19..984f1619b 100644 --- a/kmath-ejml/src/main/kotlin/space/kscience/kmath/ejml/_generated.kt +++ b/kmath-ejml/src/main/kotlin/space/kscience/kmath/ejml/_generated.kt @@ -19,13 +19,19 @@ import org.ejml.sparse.csc.factory.DecompositionFactory_DSCC import org.ejml.sparse.csc.factory.DecompositionFactory_FSCC import org.ejml.sparse.csc.factory.LinearSolverFactory_DSCC import org.ejml.sparse.csc.factory.LinearSolverFactory_FSCC -import space.kscience.kmath.UnstableKMathAPI import space.kscience.kmath.linear.* import space.kscience.kmath.linear.Matrix +import space.kscience.kmath.UnstableKMathAPI import space.kscience.kmath.nd.StructureFeature -import space.kscience.kmath.operations.Float32Field +import space.kscience.kmath.structures.Float64 +import space.kscience.kmath.structures.Float32 import space.kscience.kmath.operations.Float64Field +import space.kscience.kmath.operations.Float32Field +import space.kscience.kmath.operations.DoubleField +import space.kscience.kmath.operations.FloatField import space.kscience.kmath.operations.invoke +import space.kscience.kmath.structures.Float64Buffer +import space.kscience.kmath.structures.Float32Buffer import space.kscience.kmath.structures.DoubleBuffer import space.kscience.kmath.structures.FloatBuffer import kotlin.reflect.KClass diff --git a/kmath-geometry/src/commonMain/kotlin/space/kscience/kmath/geometry/quaternionOperations.kt b/kmath-geometry/src/commonMain/kotlin/space/kscience/kmath/geometry/quaternionOperations.kt index 49ceda04c..b6ad5009e 100644 --- a/kmath-geometry/src/commonMain/kotlin/space/kscience/kmath/geometry/quaternionOperations.kt +++ b/kmath-geometry/src/commonMain/kotlin/space/kscience/kmath/geometry/quaternionOperations.kt @@ -28,22 +28,27 @@ public fun Quaternion.power(number: Number): Quaternion = QuaternionAlgebra.powe public fun QuaternionAlgebra.slerp(from: Quaternion, to: Quaternion, fraction: Double): Quaternion = (to / from).pow(fraction) * from +/** + * Scalar angle between two quaternions + */ public fun QuaternionAlgebra.angleBetween(q1: Quaternion, q2: Quaternion): Angle = (q1.conjugate * q2).theta -public val Quaternion.inclination: Radians get() = asin(2 * (w * y - x * z)).radians - -public val Quaternion.azimuth: Angle get() = atan2(2 * (w * z + x * y), 1 - 2 * (y.pow(2) + z.pow(2))).radians.normalized() - +/** + * Euclidean product of two quaternions + */ public infix fun Quaternion.dot(other: Quaternion): Double = w * other.w + x * other.x + y * other.y + z * other.z - -private fun Quaternion.normalizedToEuler(): Float32Vector3D { - val roll = atan2(2 * y * w + 2 * x * z, 1 - 2 * y * y - 2 * z * z); - val pitch = atan2(2 * x * w - 2 * y * z, 1 - 2 * x * x - 2 * z * z); - val yaw = asin(2 * x * y + 2 * z * w); - - return Float32Vector3D(roll, pitch, yaw) -} +// +///** +// * Convert a quaternion to XYZ Cardan angles assuming it is normalized. +// */ +//private fun Quaternion.normalizedToEuler(): Float32Vector3D { +// val roll = atan2(2 * y * w + 2 * x * z, 1 - 2 * y * y - 2 * z * z) +// val pitch = atan2(2 * x * w - 2 * y * z, 1 - 2 * x * x - 2 * z * z) +// val yaw = asin(2 * x * y + 2 * z * w) +// +// return Float32Vector3D(roll, pitch, yaw) +//} /** * Quaternion to XYZ Cardan angles From 56933ecff3d259a9ab1396ecae40fcca035571f7 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Fri, 22 Sep 2023 09:04:39 +0300 Subject: [PATCH 07/11] 1.9.20-Beta2 --- build.gradle.kts | 10 +-------- gradle.properties | 2 +- .../space/kscience/kmath/ejml/_generated.kt | 10 ++------- .../kmath/geometry/quaternionOperations.kt | 22 +++++++------------ 4 files changed, 12 insertions(+), 32 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index e2c5fc44f..3050699f0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,3 @@ -import space.kscience.gradle.isInDevelopment import space.kscience.gradle.useApache2Licence import space.kscience.gradle.useSPCTeam @@ -64,14 +63,7 @@ ksciencePublish { useApache2Licence() useSPCTeam() } - github("kmath", "SciProgCentre") - space( - if (isInDevelopment) { - "https://maven.pkg.jetbrains.space/spc/p/sci/dev" - } else { - "https://maven.pkg.jetbrains.space/spc/p/sci/maven" - } - ) + repository("spc","https://maven.sciprog.center/kscience") sonatype("https://oss.sonatype.org") } diff --git a/gradle.properties b/gradle.properties index fc9bb4ee7..b6bb24a6f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,6 +12,6 @@ org.gradle.jvmargs=-Xmx4096m org.gradle.parallel=true org.gradle.workers.max=4 -toolsVersion=0.15.0-kotlin-1.9.20-Beta +toolsVersion=0.15.0-kotlin-1.9.20-Beta2 #kotlin.experimental.tryK2=true #kscience.wasm.disabled=true \ No newline at end of file diff --git a/kmath-ejml/src/main/kotlin/space/kscience/kmath/ejml/_generated.kt b/kmath-ejml/src/main/kotlin/space/kscience/kmath/ejml/_generated.kt index 984f1619b..f48ab4c19 100644 --- a/kmath-ejml/src/main/kotlin/space/kscience/kmath/ejml/_generated.kt +++ b/kmath-ejml/src/main/kotlin/space/kscience/kmath/ejml/_generated.kt @@ -19,19 +19,13 @@ import org.ejml.sparse.csc.factory.DecompositionFactory_DSCC import org.ejml.sparse.csc.factory.DecompositionFactory_FSCC import org.ejml.sparse.csc.factory.LinearSolverFactory_DSCC import org.ejml.sparse.csc.factory.LinearSolverFactory_FSCC +import space.kscience.kmath.UnstableKMathAPI import space.kscience.kmath.linear.* import space.kscience.kmath.linear.Matrix -import space.kscience.kmath.UnstableKMathAPI import space.kscience.kmath.nd.StructureFeature -import space.kscience.kmath.structures.Float64 -import space.kscience.kmath.structures.Float32 -import space.kscience.kmath.operations.Float64Field import space.kscience.kmath.operations.Float32Field -import space.kscience.kmath.operations.DoubleField -import space.kscience.kmath.operations.FloatField +import space.kscience.kmath.operations.Float64Field import space.kscience.kmath.operations.invoke -import space.kscience.kmath.structures.Float64Buffer -import space.kscience.kmath.structures.Float32Buffer import space.kscience.kmath.structures.DoubleBuffer import space.kscience.kmath.structures.FloatBuffer import kotlin.reflect.KClass diff --git a/kmath-geometry/src/commonMain/kotlin/space/kscience/kmath/geometry/quaternionOperations.kt b/kmath-geometry/src/commonMain/kotlin/space/kscience/kmath/geometry/quaternionOperations.kt index b6ad5009e..859255004 100644 --- a/kmath-geometry/src/commonMain/kotlin/space/kscience/kmath/geometry/quaternionOperations.kt +++ b/kmath-geometry/src/commonMain/kotlin/space/kscience/kmath/geometry/quaternionOperations.kt @@ -8,13 +8,7 @@ package space.kscience.kmath.geometry import space.kscience.kmath.complex.Quaternion import space.kscience.kmath.complex.QuaternionAlgebra import space.kscience.kmath.complex.conjugate -import space.kscience.kmath.complex.normalized -import space.kscience.kmath.geometry.euclidean3d.Float32Space3D -import space.kscience.kmath.geometry.euclidean3d.Float32Vector3D import space.kscience.kmath.geometry.euclidean3d.theta -import kotlin.math.asin -import kotlin.math.atan2 -import kotlin.math.pow public operator fun Quaternion.times(other: Quaternion): Quaternion = QuaternionAlgebra.multiply(this, other) @@ -50,11 +44,11 @@ public infix fun Quaternion.dot(other: Quaternion): Double = w * other.w + x * o // return Float32Vector3D(roll, pitch, yaw) //} -/** - * Quaternion to XYZ Cardan angles - */ -public fun Quaternion.toEuler(): Float32Vector3D = if (QuaternionAlgebra.norm(this) == 0.0) { - Float32Space3D.zero -} else { - normalized().normalizedToEuler() -} \ No newline at end of file +///** +// * Quaternion to XYZ Cardan angles +// */ +//public fun Quaternion.toEuler(): Float32Vector3D = if (QuaternionAlgebra.norm(this) == 0.0) { +// Float32Space3D.zero +//} else { +// normalized().normalizedToEuler() +//} \ No newline at end of file From 5129f29084ed810871a93d0d816205e0f638fa71 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Fri, 22 Sep 2023 09:53:44 +0300 Subject: [PATCH 08/11] update geometry --- build.gradle.kts | 2 +- .../space/kscience/kmath/ejml/_generated.kt | 10 ++------- .../kmath/geometry/euclidean2d/Circle2D.kt | 20 ++++++++++++----- .../geometry/euclidean2d/Float32Space2D.kt | 6 ++--- .../geometry/euclidean2d/Float64Space2D.kt | 8 +++---- .../kmath/geometry/quaternionOperations.kt | 22 +++++++------------ 6 files changed, 31 insertions(+), 37 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index e2c5fc44f..a7487f916 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -77,4 +77,4 @@ ksciencePublish { apiValidation.nonPublicMarkers.add("space.kscience.kmath.UnstableKMathAPI") -val multikVersion by extra("0.2.0") +val multikVersion by extra("0.2.2") diff --git a/kmath-ejml/src/main/kotlin/space/kscience/kmath/ejml/_generated.kt b/kmath-ejml/src/main/kotlin/space/kscience/kmath/ejml/_generated.kt index 984f1619b..f48ab4c19 100644 --- a/kmath-ejml/src/main/kotlin/space/kscience/kmath/ejml/_generated.kt +++ b/kmath-ejml/src/main/kotlin/space/kscience/kmath/ejml/_generated.kt @@ -19,19 +19,13 @@ import org.ejml.sparse.csc.factory.DecompositionFactory_DSCC import org.ejml.sparse.csc.factory.DecompositionFactory_FSCC import org.ejml.sparse.csc.factory.LinearSolverFactory_DSCC import org.ejml.sparse.csc.factory.LinearSolverFactory_FSCC +import space.kscience.kmath.UnstableKMathAPI import space.kscience.kmath.linear.* import space.kscience.kmath.linear.Matrix -import space.kscience.kmath.UnstableKMathAPI import space.kscience.kmath.nd.StructureFeature -import space.kscience.kmath.structures.Float64 -import space.kscience.kmath.structures.Float32 -import space.kscience.kmath.operations.Float64Field import space.kscience.kmath.operations.Float32Field -import space.kscience.kmath.operations.DoubleField -import space.kscience.kmath.operations.FloatField +import space.kscience.kmath.operations.Float64Field import space.kscience.kmath.operations.invoke -import space.kscience.kmath.structures.Float64Buffer -import space.kscience.kmath.structures.Float32Buffer import space.kscience.kmath.structures.DoubleBuffer import space.kscience.kmath.structures.FloatBuffer import kotlin.reflect.KClass diff --git a/kmath-geometry/src/commonMain/kotlin/space/kscience/kmath/geometry/euclidean2d/Circle2D.kt b/kmath-geometry/src/commonMain/kotlin/space/kscience/kmath/geometry/euclidean2d/Circle2D.kt index 7841be8ff..1cf8d5dc2 100644 --- a/kmath-geometry/src/commonMain/kotlin/space/kscience/kmath/geometry/euclidean2d/Circle2D.kt +++ b/kmath-geometry/src/commonMain/kotlin/space/kscience/kmath/geometry/euclidean2d/Circle2D.kt @@ -6,16 +6,26 @@ package space.kscience.kmath.geometry.euclidean2d import kotlinx.serialization.Serializable +import space.kscience.kmath.geometry.Vector2D import kotlin.math.PI + +public interface Circle2D{ + public val center: Vector2D + public val radius: Double +} + +public val Circle2D<*>.circumference: Double get() = radius * 2 * PI + /** * A circle in 2D space */ @Serializable -public data class Circle2D( - @Serializable(Float64Space2D.VectorSerializer::class) public val center: DoubleVector2D, - public val radius: Double -) +public data class Float64Circle2D( + @Serializable(Float64Space2D.VectorSerializer::class) override val center: Float64Vector2D, + override val radius: Double +): Circle2D + +public fun Circle2D(center: Float64Vector2D, radius: Double): Circle2D = Float64Circle2D(center, radius) -public val Circle2D.circumference: Double get() = radius * 2 * PI diff --git a/kmath-geometry/src/commonMain/kotlin/space/kscience/kmath/geometry/euclidean2d/Float32Space2D.kt b/kmath-geometry/src/commonMain/kotlin/space/kscience/kmath/geometry/euclidean2d/Float32Space2D.kt index 89c3dc204..4dd188d49 100644 --- a/kmath-geometry/src/commonMain/kotlin/space/kscience/kmath/geometry/euclidean2d/Float32Space2D.kt +++ b/kmath-geometry/src/commonMain/kotlin/space/kscience/kmath/geometry/euclidean2d/Float32Space2D.kt @@ -19,12 +19,10 @@ import kotlin.math.pow import kotlin.math.sqrt @Serializable(Float32Space2D.VectorSerializer::class) -public interface Float32Vector2D: Vector2D +public interface Float32Vector2D : Vector2D -public object Float32Space2D : - GeometrySpace, - ScaleOperations { +public object Float32Space2D : GeometrySpace, ScaleOperations { @Serializable @SerialName("Float32Vector2D") diff --git a/kmath-geometry/src/commonMain/kotlin/space/kscience/kmath/geometry/euclidean2d/Float64Space2D.kt b/kmath-geometry/src/commonMain/kotlin/space/kscience/kmath/geometry/euclidean2d/Float64Space2D.kt index 030a46185..423e43c30 100644 --- a/kmath-geometry/src/commonMain/kotlin/space/kscience/kmath/geometry/euclidean2d/Float64Space2D.kt +++ b/kmath-geometry/src/commonMain/kotlin/space/kscience/kmath/geometry/euclidean2d/Float64Space2D.kt @@ -14,13 +14,11 @@ import kotlinx.serialization.encoding.Encoder import space.kscience.kmath.geometry.GeometrySpace import space.kscience.kmath.geometry.Vector2D import space.kscience.kmath.operations.Float64Field -import space.kscience.kmath.operations.Norm import space.kscience.kmath.operations.ScaleOperations import kotlin.math.pow import kotlin.math.sqrt - public typealias DoubleVector2D = Vector2D public typealias Float64Vector2D = Vector2D @@ -30,9 +28,7 @@ public val Vector2D.r: Double get() = Float64Space2D.norm(this) /** * 2D Euclidean space */ -public object Float64Space2D : GeometrySpace, - ScaleOperations, - Norm { +public object Float64Space2D : GeometrySpace, ScaleOperations { @Serializable @SerialName("Float64Vector2D") @@ -72,4 +68,6 @@ public object Float64Space2D : GeometrySpace, public val yAxis: DoubleVector2D = vector(0.0, 1.0) } +public fun Float64Vector2D(x: Number, y: Number): Float64Vector2D = Float64Space2D.vector(x, y) + public val Float64Field.euclidean2D: Float64Space2D get() = Float64Space2D \ No newline at end of file diff --git a/kmath-geometry/src/commonMain/kotlin/space/kscience/kmath/geometry/quaternionOperations.kt b/kmath-geometry/src/commonMain/kotlin/space/kscience/kmath/geometry/quaternionOperations.kt index b6ad5009e..859255004 100644 --- a/kmath-geometry/src/commonMain/kotlin/space/kscience/kmath/geometry/quaternionOperations.kt +++ b/kmath-geometry/src/commonMain/kotlin/space/kscience/kmath/geometry/quaternionOperations.kt @@ -8,13 +8,7 @@ package space.kscience.kmath.geometry import space.kscience.kmath.complex.Quaternion import space.kscience.kmath.complex.QuaternionAlgebra import space.kscience.kmath.complex.conjugate -import space.kscience.kmath.complex.normalized -import space.kscience.kmath.geometry.euclidean3d.Float32Space3D -import space.kscience.kmath.geometry.euclidean3d.Float32Vector3D import space.kscience.kmath.geometry.euclidean3d.theta -import kotlin.math.asin -import kotlin.math.atan2 -import kotlin.math.pow public operator fun Quaternion.times(other: Quaternion): Quaternion = QuaternionAlgebra.multiply(this, other) @@ -50,11 +44,11 @@ public infix fun Quaternion.dot(other: Quaternion): Double = w * other.w + x * o // return Float32Vector3D(roll, pitch, yaw) //} -/** - * Quaternion to XYZ Cardan angles - */ -public fun Quaternion.toEuler(): Float32Vector3D = if (QuaternionAlgebra.norm(this) == 0.0) { - Float32Space3D.zero -} else { - normalized().normalizedToEuler() -} \ No newline at end of file +///** +// * Quaternion to XYZ Cardan angles +// */ +//public fun Quaternion.toEuler(): Float32Vector3D = if (QuaternionAlgebra.norm(this) == 0.0) { +// Float32Space3D.zero +//} else { +// normalized().normalizedToEuler() +//} \ No newline at end of file From bfb556b013fc9ca654066e3a5a07717a29a77567 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Tue, 3 Oct 2023 19:33:39 +0300 Subject: [PATCH 09/11] remove webpack and node version fixture --- .../kotlin/space/kscience/kmath/operations/LogicAlgebra.kt | 5 ++--- kmath-memory/build.gradle.kts | 6 ++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/operations/LogicAlgebra.kt b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/operations/LogicAlgebra.kt index 7aa5aed80..d8bf0fb57 100644 --- a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/operations/LogicAlgebra.kt +++ b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/operations/LogicAlgebra.kt @@ -7,7 +7,6 @@ package space.kscience.kmath.operations import space.kscience.kmath.UnstableKMathAPI import space.kscience.kmath.expressions.Symbol -import space.kscience.kmath.expressions.symbol /** * An algebra for generic boolean logic @@ -61,8 +60,8 @@ public interface LogicAlgebra : Algebra { public companion object { - public val TRUE: Symbol by symbol - public val FALSE: Symbol by symbol + public val TRUE: Symbol = Symbol("TRUE")//by symbol + public val FALSE: Symbol = Symbol("FALSE")// by symbol } } diff --git a/kmath-memory/build.gradle.kts b/kmath-memory/build.gradle.kts index 63811d784..f1dff3b75 100644 --- a/kmath-memory/build.gradle.kts +++ b/kmath-memory/build.gradle.kts @@ -1,5 +1,3 @@ -import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension - plugins { id("space.kscience.gradle.mpp") } @@ -18,5 +16,5 @@ readme { """.trimIndent() } -rootProject.the().versions.webpack.version = "5.76.2" -rootProject.the().nodeVersion = "20.2.0" +//rootProject.the().versions.webpack.version = "5.76.2" +//rootProject.the().nodeVersion = "20.8.0" From 1765f8cf8c81a6f72d58f839af32bebdad29f474 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Wed, 25 Oct 2023 10:28:39 +0300 Subject: [PATCH 10/11] Remove `asPolynomial` --- CHANGELOG.md | 1 + build.gradle.kts | 2 +- buildSrc/settings.gradle.kts | 4 +++ gradle.properties | 2 +- .../kmath/internal/binaryen/index.binaryen.kt | 2 +- .../kscience/kmath/data/XYColumnarData.kt | 31 +++++++++++++++++-- .../kscience/kmath/streaming/RingBuffer.kt | 4 +-- .../kmath/functions/polynomialConstructors.kt | 7 +---- 8 files changed, 38 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27b67a4d8..3c6523a0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ ### Deprecated ### Removed +- `asPolynomial` function due to scope pollution ### Fixed - Median statistics diff --git a/build.gradle.kts b/build.gradle.kts index 3050699f0..f40cb88ee 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -69,4 +69,4 @@ ksciencePublish { apiValidation.nonPublicMarkers.add("space.kscience.kmath.UnstableKMathAPI") -val multikVersion by extra("0.2.0") +val multikVersion by extra("0.2.2") diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts index 02111ba37..c455f5ae9 100644 --- a/buildSrc/settings.gradle.kts +++ b/buildSrc/settings.gradle.kts @@ -5,6 +5,10 @@ enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") +plugins { + id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0" +} + dependencyResolutionManagement { val projectProperties = java.util.Properties() file("../gradle.properties").inputStream().use { diff --git a/gradle.properties b/gradle.properties index b6bb24a6f..0c2a6f455 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,6 +12,6 @@ org.gradle.jvmargs=-Xmx4096m org.gradle.parallel=true org.gradle.workers.max=4 -toolsVersion=0.15.0-kotlin-1.9.20-Beta2 +toolsVersion=0.15.0-kotlin-1.9.20-RC2 #kotlin.experimental.tryK2=true #kscience.wasm.disabled=true \ No newline at end of file diff --git a/kmath-ast/src/jsMain/kotlin/space/kscience/kmath/internal/binaryen/index.binaryen.kt b/kmath-ast/src/jsMain/kotlin/space/kscience/kmath/internal/binaryen/index.binaryen.kt index f2e1aae83..143ae7ad4 100644 --- a/kmath-ast/src/jsMain/kotlin/space/kscience/kmath/internal/binaryen/index.binaryen.kt +++ b/kmath-ast/src/jsMain/kotlin/space/kscience/kmath/internal/binaryen/index.binaryen.kt @@ -52,7 +52,7 @@ internal external fun createType(types: Array): Type internal external fun expandType(type: Type): Array -internal external enum class ExpressionIds { +internal external enum class ExpressionIds { Invalid, Block, If, diff --git a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/data/XYColumnarData.kt b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/data/XYColumnarData.kt index de7e6f79b..23cbcd0c7 100644 --- a/kmath-core/src/commonMain/kotlin/space/kscience/kmath/data/XYColumnarData.kt +++ b/kmath-core/src/commonMain/kotlin/space/kscience/kmath/data/XYColumnarData.kt @@ -10,6 +10,7 @@ import space.kscience.kmath.UnstableKMathAPI import space.kscience.kmath.expressions.Symbol import space.kscience.kmath.nd.Structure2D import space.kscience.kmath.structures.Buffer +import space.kscience.kmath.structures.VirtualBuffer import kotlin.math.max /** @@ -33,7 +34,10 @@ public interface XYColumnarData : ColumnarData { else -> null } - public companion object{ + public companion object { + /** + * Create data form two buffers (zero-copy) + */ @UnstableKMathAPI public fun of(x: Buffer, y: Buffer): XYColumnarData { require(x.size == y.size) { "Buffer size mismatch. x buffer size is ${x.size}, y buffer size is ${y.size}" } @@ -43,6 +47,26 @@ public interface XYColumnarData : ColumnarData { override val y: Buffer = y } } + + /** + * Create two-column data from a list of row-objects (zero-copy) + */ + @UnstableKMathAPI + public fun ofList( + list: List, + xConverter: (I) -> X, + yConverter: (I) -> Y, + ): XYColumnarData = object : XYColumnarData { + override val size: Int get() = list.size + + override val x: Buffer = VirtualBuffer(list.size) { + xConverter(list[it]) + } + + override val y: Buffer = VirtualBuffer(list.size) { + yConverter(list[it]) + } + } } } @@ -56,9 +80,10 @@ public fun ColumnarData.asXYData( ySymbol: Symbol, ): XYColumnarData = object : XYColumnarData { init { - requireNotNull(this@asXYData[xSymbol]){"The column with name $xSymbol is not present in $this"} - requireNotNull(this@asXYData[ySymbol]){"The column with name $ySymbol is not present in $this"} + requireNotNull(this@asXYData[xSymbol]) { "The column with name $xSymbol is not present in $this" } + requireNotNull(this@asXYData[ySymbol]) { "The column with name $ySymbol is not present in $this" } } + override val size: Int get() = this@asXYData.size override val x: Buffer get() = this@asXYData[xSymbol]!! override val y: Buffer get() = this@asXYData[ySymbol]!! diff --git a/kmath-coroutines/src/commonMain/kotlin/space/kscience/kmath/streaming/RingBuffer.kt b/kmath-coroutines/src/commonMain/kotlin/space/kscience/kmath/streaming/RingBuffer.kt index 2ac8c1eb4..bb07fede1 100644 --- a/kmath-coroutines/src/commonMain/kotlin/space/kscience/kmath/streaming/RingBuffer.kt +++ b/kmath-coroutines/src/commonMain/kotlin/space/kscience/kmath/streaming/RingBuffer.kt @@ -65,9 +65,7 @@ public class RingBuffer( } } - - @Suppress("NOTHING_TO_INLINE") - private inline fun Int.forward(n: Int): Int = (this + n) % (buffer.size) + private fun Int.forward(n: Int): Int = (this + n) % (buffer.size) override fun toString(): String = Buffer.toString(this) diff --git a/kmath-functions/src/commonMain/kotlin/space/kscience/kmath/functions/polynomialConstructors.kt b/kmath-functions/src/commonMain/kotlin/space/kscience/kmath/functions/polynomialConstructors.kt index 4e9791a87..e07ff764c 100644 --- a/kmath-functions/src/commonMain/kotlin/space/kscience/kmath/functions/polynomialConstructors.kt +++ b/kmath-functions/src/commonMain/kotlin/space/kscience/kmath/functions/polynomialConstructors.kt @@ -20,9 +20,4 @@ public fun Polynomial(coefficients: List, reverse: Boolean = false): Poly */ @Suppress("FunctionName") public fun Polynomial(vararg coefficients: C, reverse: Boolean = false): Polynomial = - Polynomial(with(coefficients) { if (reverse) reversed() else toList() }) - -/** - * Represents [this] constant as a [Polynomial]. - */ -public fun C.asPolynomial() : Polynomial = Polynomial(listOf(this)) \ No newline at end of file + Polynomial(with(coefficients) { if (reverse) reversed() else toList() }) \ No newline at end of file From 328d45444c061bb1cafeb856980e93355a5856ee Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Tue, 31 Oct 2023 14:05:17 +0300 Subject: [PATCH 11/11] 1.9.20 finalization --- buildSrc/build.gradle.kts | 2 +- .../benchmarks/addBenchmarkProperties.kt | 4 ++-- gradle.properties | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- .../kmath/internal/binaryen/index.binaryen.kt | 2 +- kmath-commons/build.gradle.kts | 21 +++++++++++-------- .../commons/expressions/CmDsExpression.kt | 0 .../integration/CMGaussRuleIntegrator.kt | 0 .../kmath/commons/integration/CMIntegrator.kt | 0 .../kscience/kmath/commons/linear/CMMatrix.kt | 0 .../kscience/kmath/commons/linear/CMSolver.kt | 0 .../kmath/commons/optimization/CMOptimizer.kt | 0 .../random/CMRandomGeneratorWrapper.kt | 0 .../commons/transform/Transformations.kt | 0 .../DerivativeStructureExpressionTest.kt | 0 .../commons/integration/IntegrationTest.kt | 0 .../commons/optimization/OptimizeTest.kt | 0 17 files changed, 18 insertions(+), 15 deletions(-) rename kmath-commons/src/{main => jvmMain}/kotlin/space/kscience/kmath/commons/expressions/CmDsExpression.kt (100%) rename kmath-commons/src/{main => jvmMain}/kotlin/space/kscience/kmath/commons/integration/CMGaussRuleIntegrator.kt (100%) rename kmath-commons/src/{main => jvmMain}/kotlin/space/kscience/kmath/commons/integration/CMIntegrator.kt (100%) rename kmath-commons/src/{main => jvmMain}/kotlin/space/kscience/kmath/commons/linear/CMMatrix.kt (100%) rename kmath-commons/src/{main => jvmMain}/kotlin/space/kscience/kmath/commons/linear/CMSolver.kt (100%) rename kmath-commons/src/{main => jvmMain}/kotlin/space/kscience/kmath/commons/optimization/CMOptimizer.kt (100%) rename kmath-commons/src/{main => jvmMain}/kotlin/space/kscience/kmath/commons/random/CMRandomGeneratorWrapper.kt (100%) rename kmath-commons/src/{main => jvmMain}/kotlin/space/kscience/kmath/commons/transform/Transformations.kt (100%) rename kmath-commons/src/{test => jvmTest}/kotlin/space/kscience/kmath/commons/expressions/DerivativeStructureExpressionTest.kt (100%) rename kmath-commons/src/{test => jvmTest}/kotlin/space/kscience/kmath/commons/integration/IntegrationTest.kt (100%) rename kmath-commons/src/{test => jvmTest}/kotlin/space/kscience/kmath/commons/optimization/OptimizeTest.kt (100%) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 734f60091..08db49244 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -17,7 +17,7 @@ val benchmarksVersion = spclibs.versions.kotlinx.benchmark.get() dependencies { api("space.kscience:gradle-tools:$toolsVersion") //plugins form benchmarks - api("org.jetbrains.kotlinx:kotlinx-benchmark-plugin:0.4.7") + api("org.jetbrains.kotlinx:kotlinx-benchmark-plugin:0.4.9") //api("org.jetbrains.kotlin:kotlin-allopen:$kotlinVersion") //to be used inside build-script only //implementation(spclibs.kotlinx.serialization.json) diff --git a/buildSrc/src/main/kotlin/space/kscience/kmath/benchmarks/addBenchmarkProperties.kt b/buildSrc/src/main/kotlin/space/kscience/kmath/benchmarks/addBenchmarkProperties.kt index a3a475885..83cb786e3 100644 --- a/buildSrc/src/main/kotlin/space/kscience/kmath/benchmarks/addBenchmarkProperties.kt +++ b/buildSrc/src/main/kotlin/space/kscience/kmath/benchmarks/addBenchmarkProperties.kt @@ -54,9 +54,9 @@ fun Project.addBenchmarkProperties() { p.extensions.findByType(KScienceReadmeExtension::class.java)?.run { benchmarksProject.extensions.findByType(BenchmarksExtension::class.java)?.configurations?.forEach { cfg -> property("benchmark${cfg.name.replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString() }}") { - val launches = benchmarksProject.buildDir.resolve("reports/benchmarks/${cfg.name}") + val launches = benchmarksProject.layout.buildDirectory.dir("reports/benchmarks/${cfg.name}").get() - val resDirectory = launches.listFiles()?.maxByOrNull { + val resDirectory = launches.files().maxByOrNull { LocalDateTime.parse(it.name, ISO_DATE_TIME).atZone(ZoneId.systemDefault()).toInstant() } diff --git a/gradle.properties b/gradle.properties index 0c2a6f455..5d62bf88e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,6 +12,6 @@ org.gradle.jvmargs=-Xmx4096m org.gradle.parallel=true org.gradle.workers.max=4 -toolsVersion=0.15.0-kotlin-1.9.20-RC2 +toolsVersion=0.15.0-kotlin-1.9.20 #kotlin.experimental.tryK2=true #kscience.wasm.disabled=true \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index db9a6b825..e411586a5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/kmath-ast/src/jsMain/kotlin/space/kscience/kmath/internal/binaryen/index.binaryen.kt b/kmath-ast/src/jsMain/kotlin/space/kscience/kmath/internal/binaryen/index.binaryen.kt index 143ae7ad4..59c9a40a6 100644 --- a/kmath-ast/src/jsMain/kotlin/space/kscience/kmath/internal/binaryen/index.binaryen.kt +++ b/kmath-ast/src/jsMain/kotlin/space/kscience/kmath/internal/binaryen/index.binaryen.kt @@ -9,7 +9,7 @@ "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS", "PropertyName", - "ClassName", + "ClassName", "ENUM_CLASS_IN_EXTERNAL_DECLARATION_WARNING", ) @file:JsModule("binaryen") diff --git a/kmath-commons/build.gradle.kts b/kmath-commons/build.gradle.kts index 50fef7ac8..5c2c4a304 100644 --- a/kmath-commons/build.gradle.kts +++ b/kmath-commons/build.gradle.kts @@ -1,17 +1,20 @@ plugins { - id("space.kscience.gradle.jvm") + id("space.kscience.gradle.mpp") } description = "Commons math binding for kmath" -dependencies { - api(project(":kmath-core")) - api(project(":kmath-complex")) - api(project(":kmath-coroutines")) - api(project(":kmath-optimization")) - api(project(":kmath-stat")) - api(project(":kmath-functions")) - api("org.apache.commons:commons-math3:3.6.1") +kscience { + jvm() + jvmMain { + api(projects.kmathCore) + api(projects.kmathComplex) + api(projects.kmathCoroutines) + api(projects.kmathOptimization) + api(projects.kmathStat) + api(projects.kmathFunctions) + api("org.apache.commons:commons-math3:3.6.1") + } } readme { diff --git a/kmath-commons/src/main/kotlin/space/kscience/kmath/commons/expressions/CmDsExpression.kt b/kmath-commons/src/jvmMain/kotlin/space/kscience/kmath/commons/expressions/CmDsExpression.kt similarity index 100% rename from kmath-commons/src/main/kotlin/space/kscience/kmath/commons/expressions/CmDsExpression.kt rename to kmath-commons/src/jvmMain/kotlin/space/kscience/kmath/commons/expressions/CmDsExpression.kt diff --git a/kmath-commons/src/main/kotlin/space/kscience/kmath/commons/integration/CMGaussRuleIntegrator.kt b/kmath-commons/src/jvmMain/kotlin/space/kscience/kmath/commons/integration/CMGaussRuleIntegrator.kt similarity index 100% rename from kmath-commons/src/main/kotlin/space/kscience/kmath/commons/integration/CMGaussRuleIntegrator.kt rename to kmath-commons/src/jvmMain/kotlin/space/kscience/kmath/commons/integration/CMGaussRuleIntegrator.kt diff --git a/kmath-commons/src/main/kotlin/space/kscience/kmath/commons/integration/CMIntegrator.kt b/kmath-commons/src/jvmMain/kotlin/space/kscience/kmath/commons/integration/CMIntegrator.kt similarity index 100% rename from kmath-commons/src/main/kotlin/space/kscience/kmath/commons/integration/CMIntegrator.kt rename to kmath-commons/src/jvmMain/kotlin/space/kscience/kmath/commons/integration/CMIntegrator.kt diff --git a/kmath-commons/src/main/kotlin/space/kscience/kmath/commons/linear/CMMatrix.kt b/kmath-commons/src/jvmMain/kotlin/space/kscience/kmath/commons/linear/CMMatrix.kt similarity index 100% rename from kmath-commons/src/main/kotlin/space/kscience/kmath/commons/linear/CMMatrix.kt rename to kmath-commons/src/jvmMain/kotlin/space/kscience/kmath/commons/linear/CMMatrix.kt diff --git a/kmath-commons/src/main/kotlin/space/kscience/kmath/commons/linear/CMSolver.kt b/kmath-commons/src/jvmMain/kotlin/space/kscience/kmath/commons/linear/CMSolver.kt similarity index 100% rename from kmath-commons/src/main/kotlin/space/kscience/kmath/commons/linear/CMSolver.kt rename to kmath-commons/src/jvmMain/kotlin/space/kscience/kmath/commons/linear/CMSolver.kt diff --git a/kmath-commons/src/main/kotlin/space/kscience/kmath/commons/optimization/CMOptimizer.kt b/kmath-commons/src/jvmMain/kotlin/space/kscience/kmath/commons/optimization/CMOptimizer.kt similarity index 100% rename from kmath-commons/src/main/kotlin/space/kscience/kmath/commons/optimization/CMOptimizer.kt rename to kmath-commons/src/jvmMain/kotlin/space/kscience/kmath/commons/optimization/CMOptimizer.kt diff --git a/kmath-commons/src/main/kotlin/space/kscience/kmath/commons/random/CMRandomGeneratorWrapper.kt b/kmath-commons/src/jvmMain/kotlin/space/kscience/kmath/commons/random/CMRandomGeneratorWrapper.kt similarity index 100% rename from kmath-commons/src/main/kotlin/space/kscience/kmath/commons/random/CMRandomGeneratorWrapper.kt rename to kmath-commons/src/jvmMain/kotlin/space/kscience/kmath/commons/random/CMRandomGeneratorWrapper.kt diff --git a/kmath-commons/src/main/kotlin/space/kscience/kmath/commons/transform/Transformations.kt b/kmath-commons/src/jvmMain/kotlin/space/kscience/kmath/commons/transform/Transformations.kt similarity index 100% rename from kmath-commons/src/main/kotlin/space/kscience/kmath/commons/transform/Transformations.kt rename to kmath-commons/src/jvmMain/kotlin/space/kscience/kmath/commons/transform/Transformations.kt diff --git a/kmath-commons/src/test/kotlin/space/kscience/kmath/commons/expressions/DerivativeStructureExpressionTest.kt b/kmath-commons/src/jvmTest/kotlin/space/kscience/kmath/commons/expressions/DerivativeStructureExpressionTest.kt similarity index 100% rename from kmath-commons/src/test/kotlin/space/kscience/kmath/commons/expressions/DerivativeStructureExpressionTest.kt rename to kmath-commons/src/jvmTest/kotlin/space/kscience/kmath/commons/expressions/DerivativeStructureExpressionTest.kt diff --git a/kmath-commons/src/test/kotlin/space/kscience/kmath/commons/integration/IntegrationTest.kt b/kmath-commons/src/jvmTest/kotlin/space/kscience/kmath/commons/integration/IntegrationTest.kt similarity index 100% rename from kmath-commons/src/test/kotlin/space/kscience/kmath/commons/integration/IntegrationTest.kt rename to kmath-commons/src/jvmTest/kotlin/space/kscience/kmath/commons/integration/IntegrationTest.kt diff --git a/kmath-commons/src/test/kotlin/space/kscience/kmath/commons/optimization/OptimizeTest.kt b/kmath-commons/src/jvmTest/kotlin/space/kscience/kmath/commons/optimization/OptimizeTest.kt similarity index 100% rename from kmath-commons/src/test/kotlin/space/kscience/kmath/commons/optimization/OptimizeTest.kt rename to kmath-commons/src/jvmTest/kotlin/space/kscience/kmath/commons/optimization/OptimizeTest.kt