diff --git a/kmath-commons/build.gradle.kts b/kmath-commons/build.gradle.kts index ad8b3912a..a340a1e78 100644 --- a/kmath-commons/build.gradle.kts +++ b/kmath-commons/build.gradle.kts @@ -7,7 +7,7 @@ description = "Commons math binding for kmath" dependencies { api(project(":kmath-core")) - api(project(":kmath-sequential")) + api(project(":kmath-streaming")) api("org.apache.commons:commons-math3:3.6.1") testImplementation("org.jetbrains.kotlin:kotlin-test") testImplementation("org.jetbrains.kotlin:kotlin-test-junit") diff --git a/kmath-commons/src/main/kotlin/scientifik/kmath/transform/Transformations.kt b/kmath-commons/src/main/kotlin/scientifik/kmath/transform/Transformations.kt index 17907adbe..89ecf5f9f 100644 --- a/kmath-commons/src/main/kotlin/scientifik/kmath/transform/Transformations.kt +++ b/kmath-commons/src/main/kotlin/scientifik/kmath/transform/Transformations.kt @@ -2,9 +2,9 @@ package scientifik.kmath.transform import org.apache.commons.math3.transform.* import scientifik.kmath.operations.Complex -import scientifik.kmath.sequential.Processor -import scientifik.kmath.sequential.Producer -import scientifik.kmath.sequential.map +import scientifik.kmath.streaming.Processor +import scientifik.kmath.streaming.Producer +import scientifik.kmath.streaming.map import scientifik.kmath.structures.* diff --git a/kmath-sequential/build.gradle.kts b/kmath-prob/build.gradle.kts similarity index 100% rename from kmath-sequential/build.gradle.kts rename to kmath-prob/build.gradle.kts diff --git a/kmath-streaming/build.gradle.kts b/kmath-streaming/build.gradle.kts new file mode 100644 index 000000000..45979c89f --- /dev/null +++ b/kmath-streaming/build.gradle.kts @@ -0,0 +1,36 @@ +plugins { + kotlin("multiplatform") + id("kotlinx-atomicfu") +} + +val atomicfuVersion: String by rootProject.extra + +kotlin { + jvm () + js() + + sourceSets { + val commonMain by getting { + dependencies { + api(project(":kmath-core")) + api(project(":kmath-coroutines")) + compileOnly("org.jetbrains.kotlinx:atomicfu-common:${Ver.atomicfuVersion}") + } + } + val jvmMain by getting { + dependencies { + compileOnly("org.jetbrains.kotlinx:atomicfu:${Ver.atomicfuVersion}") + } + } + val jsMain by getting { + dependencies { + compileOnly("org.jetbrains.kotlinx:atomicfu-js:${Ver.atomicfuVersion}") + } + } + + } +} + +atomicfu { + variant = "VH" +} \ No newline at end of file diff --git a/kmath-sequential/src/commonMain/kotlin/scientifik/kmath/sequential/BufferStreaming.kt b/kmath-streaming/src/commonMain/kotlin/scientifik/kmath/streaming/BufferStreaming.kt similarity index 98% rename from kmath-sequential/src/commonMain/kotlin/scientifik/kmath/sequential/BufferStreaming.kt rename to kmath-streaming/src/commonMain/kotlin/scientifik/kmath/streaming/BufferStreaming.kt index b98f48186..023199452 100644 --- a/kmath-sequential/src/commonMain/kotlin/scientifik/kmath/sequential/BufferStreaming.kt +++ b/kmath-streaming/src/commonMain/kotlin/scientifik/kmath/streaming/BufferStreaming.kt @@ -1,4 +1,4 @@ -package scientifik.kmath.sequential +package scientifik.kmath.streaming import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.ExperimentalCoroutinesApi diff --git a/kmath-sequential/src/commonMain/kotlin/scientifik/kmath/sequential/Chain.kt b/kmath-streaming/src/commonMain/kotlin/scientifik/kmath/streaming/Chain.kt similarity index 99% rename from kmath-sequential/src/commonMain/kotlin/scientifik/kmath/sequential/Chain.kt rename to kmath-streaming/src/commonMain/kotlin/scientifik/kmath/streaming/Chain.kt index 7633b2223..3f81e4365 100644 --- a/kmath-sequential/src/commonMain/kotlin/scientifik/kmath/sequential/Chain.kt +++ b/kmath-streaming/src/commonMain/kotlin/scientifik/kmath/streaming/Chain.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package scientifik.kmath.sequential +package scientifik.kmath.streaming import kotlinx.atomicfu.atomic import kotlinx.coroutines.CoroutineScope diff --git a/kmath-sequential/src/commonMain/kotlin/scientifik/kmath/sequential/Cumulative.kt b/kmath-streaming/src/commonMain/kotlin/scientifik/kmath/streaming/Cumulative.kt similarity index 97% rename from kmath-sequential/src/commonMain/kotlin/scientifik/kmath/sequential/Cumulative.kt rename to kmath-streaming/src/commonMain/kotlin/scientifik/kmath/streaming/Cumulative.kt index b0e1e9ac5..942ed7b50 100644 --- a/kmath-sequential/src/commonMain/kotlin/scientifik/kmath/sequential/Cumulative.kt +++ b/kmath-streaming/src/commonMain/kotlin/scientifik/kmath/streaming/Cumulative.kt @@ -1,4 +1,4 @@ -package scientifik.kmath.sequential +package scientifik.kmath.streaming import scientifik.kmath.operations.Space import kotlin.jvm.JvmName diff --git a/kmath-sequential/src/commonMain/kotlin/scientifik/kmath/sequential/RingBuffer.kt b/kmath-streaming/src/commonMain/kotlin/scientifik/kmath/streaming/RingBuffer.kt similarity index 98% rename from kmath-sequential/src/commonMain/kotlin/scientifik/kmath/sequential/RingBuffer.kt rename to kmath-streaming/src/commonMain/kotlin/scientifik/kmath/streaming/RingBuffer.kt index 108b7f828..ac64f921f 100644 --- a/kmath-sequential/src/commonMain/kotlin/scientifik/kmath/sequential/RingBuffer.kt +++ b/kmath-streaming/src/commonMain/kotlin/scientifik/kmath/streaming/RingBuffer.kt @@ -1,4 +1,4 @@ -package scientifik.kmath.sequential +package scientifik.kmath.streaming import kotlinx.coroutines.sync.Mutex import kotlinx.coroutines.sync.withLock diff --git a/kmath-sequential/src/commonMain/kotlin/scientifik/kmath/sequential/Streaming.kt b/kmath-streaming/src/commonMain/kotlin/scientifik/kmath/streaming/Streaming.kt similarity index 99% rename from kmath-sequential/src/commonMain/kotlin/scientifik/kmath/sequential/Streaming.kt rename to kmath-streaming/src/commonMain/kotlin/scientifik/kmath/streaming/Streaming.kt index c0332d639..3cb3bcfdd 100644 --- a/kmath-sequential/src/commonMain/kotlin/scientifik/kmath/sequential/Streaming.kt +++ b/kmath-streaming/src/commonMain/kotlin/scientifik/kmath/streaming/Streaming.kt @@ -1,4 +1,4 @@ -package scientifik.kmath.sequential +package scientifik.kmath.streaming import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.GlobalScope diff --git a/kmath-sequential/src/commonTest/kotlin/scientifik/kmath/sequential/CumulativeKtTest.kt b/kmath-streaming/src/commonTest/kotlin/scientifik/kmath/streaming/CumulativeKtTest.kt similarity index 71% rename from kmath-sequential/src/commonTest/kotlin/scientifik/kmath/sequential/CumulativeKtTest.kt rename to kmath-streaming/src/commonTest/kotlin/scientifik/kmath/streaming/CumulativeKtTest.kt index cafa0526f..75a08274d 100644 --- a/kmath-sequential/src/commonTest/kotlin/scientifik/kmath/sequential/CumulativeKtTest.kt +++ b/kmath-streaming/src/commonTest/kotlin/scientifik/kmath/streaming/CumulativeKtTest.kt @@ -1,8 +1,6 @@ package scientifik.kmath.misc -import scientifik.kmath.sequential.cumulativeSum -import kotlin.test.Test -import kotlin.test.assertEquals +import scientifik.kmath.streaming.cumulativeSum class CumulativeKtTest { @Test diff --git a/kmath-sequential/src/jvmMain/kotlin/scientifik/kmath/sequential/ChainExt.kt b/kmath-streaming/src/jvmMain/kotlin/scientifik/kmath/streaming/ChainExt.kt similarity index 96% rename from kmath-sequential/src/jvmMain/kotlin/scientifik/kmath/sequential/ChainExt.kt rename to kmath-streaming/src/jvmMain/kotlin/scientifik/kmath/streaming/ChainExt.kt index 74cb6bc6d..b273d9fa0 100644 --- a/kmath-sequential/src/jvmMain/kotlin/scientifik/kmath/sequential/ChainExt.kt +++ b/kmath-streaming/src/jvmMain/kotlin/scientifik/kmath/streaming/ChainExt.kt @@ -1,4 +1,4 @@ -package scientifik.kmath.sequential +package scientifik.kmath.streaming import kotlinx.coroutines.runBlocking import kotlin.sequences.Sequence diff --git a/kmath-sequential/src/jvmTest/kotlin/scientifik.kmath.sequential/RingBufferTest.kt b/kmath-streaming/src/jvmTest/kotlin/streaming/RingBufferTest.kt similarity index 80% rename from kmath-sequential/src/jvmTest/kotlin/scientifik.kmath.sequential/RingBufferTest.kt rename to kmath-streaming/src/jvmTest/kotlin/streaming/RingBufferTest.kt index c8f84e7d8..48d12755b 100644 --- a/kmath-sequential/src/jvmTest/kotlin/scientifik.kmath.sequential/RingBufferTest.kt +++ b/kmath-streaming/src/jvmTest/kotlin/streaming/RingBufferTest.kt @@ -1,9 +1,7 @@ -package scientifik.kmath.sequential +package scientifik.kmath.streaming import kotlinx.coroutines.runBlocking import scientifik.kmath.structures.asSequence -import kotlin.test.Test -import kotlin.test.assertEquals class RingBufferTest { @Test