Build migrated to gradle-tools 1.4

This commit is contained in:
Alexander Nozik 2019-08-24 09:00:04 +03:00
parent 5a08faf0b6
commit 645d81abf0
9 changed files with 50 additions and 79 deletions

View File

@ -1,6 +1,6 @@
plugins { plugins {
id("scientifik.mpp") version "0.1.3" apply false id("scientifik.mpp") version "0.1.4" apply false
id("scientifik.publish") version "0.1.3" apply false id("scientifik.publish") version "0.1.4" apply false
id("kotlinx-atomicfu") version "0.12.9" apply false id("kotlinx-atomicfu") version "0.12.9" apply false
} }

View File

@ -1,6 +1,5 @@
plugins { plugins {
kotlin("jvm") id("scientifik.jvm")
`maven-publish`
} }
description = "Commons math binding for kmath" description = "Commons math binding for kmath"
@ -13,18 +12,3 @@ dependencies {
testImplementation("org.jetbrains.kotlin:kotlin-test") testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit") testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
} }
val sourcesJar by tasks.registering(Jar::class) {
classifier = "sources"
from(sourceSets.main.get().allSource)
}
publishing {
publications {
register("jvm", MavenPublication::class) {
from(components["java"])
artifact(sourcesJar.get())
}
}
}

View File

@ -11,7 +11,7 @@ import scientifik.kmath.structures.*
/** /**
* * Streaming and buffer transformations
*/ */
object Transformations { object Transformations {

View File

@ -8,6 +8,4 @@ kotlin.sourceSets {
api(project(":kmath-memory")) api(project(":kmath-memory"))
} }
} }
//mingwMain {}
//mingwTest {}
} }

View File

@ -1,7 +1,14 @@
package scientifik.kmath.operations package scientifik.kmath.operations
/**
* Marker interface for any algebra
*/
interface Algebra
interface SpaceOperations<T> { /**
* Space-like operations without neutral element
*/
interface SpaceOperations<T> : Algebra {
/** /**
* Addition operation for two context elements * Addition operation for two context elements
*/ */
@ -38,6 +45,9 @@ interface Space<T> : SpaceOperations<T> {
val zero: T val zero: T
} }
/**
* Operations on ring without multiplication neutral element
*/
interface RingOperations<T> : SpaceOperations<T> { interface RingOperations<T> : SpaceOperations<T> {
/** /**
* Multiplication for two field elements * Multiplication for two field elements

View File

@ -0,0 +1,34 @@
package scientifik.kmath.operations
import kotlin.jvm.JvmName
import kotlin.reflect.KClass
/**
* A suspendable univariate function defined in algebraic context
*/
interface UFunction<T, C : SpaceOperations<T>> {
suspend operator fun C.invoke(arg: T): T
}
suspend fun UFunction<Double, RealField>.invoke(arg: Double) = RealField.invoke(arg)
/**
* A suspendable multivariate (N->1) function defined on algebraic context
*/
interface MFunction<T, C : SpaceOperations<T>> {
/**
* The input dimension of the function
*/
val dimension: UInt
suspend operator fun C.invoke(vararg args: T): T
}
suspend fun MFunction<Double, RealField>.invoke(args: DoubleArray) = RealField.invoke(*args.toTypedArray())
@JvmName("varargInvoke")
suspend fun MFunction<Double, RealField>.invoke(vararg args: Double) = RealField.invoke(*args.toTypedArray())
interface ParametricUFunction<T, P, C : SpaceOperations<T>> {
suspend operator fun C.invoke(arg: T, parameter: P): T
}

View File

@ -1,6 +1,5 @@
plugins { plugins {
id("scientifik.mpp") id("scientifik.mpp")
id("kotlinx-atomicfu")
} }
kotlin.sourceSets { kotlin.sourceSets {

View File

@ -1,55 +0,0 @@
plugins {
id "org.jetbrains.kotlin.multiplatform"
}
kotlin {
targets {
fromPreset(presets.jvm, 'jvm')
fromPreset(presets.js, 'js')
// For ARM, preset should be changed to presets.iosArm32 or presets.iosArm64
// For Linux, preset should be changed to e.g. presets.linuxX64
// For MacOS, preset should be changed to e.g. presets.macosX64
//fromPreset(presets.mingwX64, 'mingw')
}
sourceSets {
commonMain {
dependencies {
api project(":kmath-core")
implementation 'org.jetbrains.kotlin:kotlin-stdlib-common'
api "org.jetbrains.kotlinx:kotlinx-io:$ioVersion"
}
}
commonTest {
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-test-common'
implementation 'org.jetbrains.kotlin:kotlin-test-annotations-common'
}
}
jvmMain {
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
api "org.jetbrains.kotlinx:kotlinx-io-jvm:$ioVersion"
}
}
jvmTest {
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-test'
implementation 'org.jetbrains.kotlin:kotlin-test-junit'
}
}
jsMain {
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib-js'
}
}
jsTest {
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-test-js'
}
}
// mingwMain {
// }
// mingwTest {
// }
}
}

View File

@ -32,5 +32,6 @@ include(
":kmath-commons", ":kmath-commons",
":kmath-koma", ":kmath-koma",
":kmath-prob", ":kmath-prob",
":kmath-io",
":examples" ":examples"
) )