Merge remote-tracking branch 'origin/dev' into ejml

This commit is contained in:
Iaroslav 2020-09-20 16:39:23 +07:00
commit a4eb54228d
No known key found for this signature in database
GPG Key ID: 46E15E4A31B3BCD7
35 changed files with 41 additions and 70 deletions

View File

@ -1,10 +1,12 @@
import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension
import scientifik.ScientifikPublishPlugin
plugins {
id("scientifik.publish") apply false
id("org.jetbrains.changelog") version "0.4.0"
}
val kmathVersion by extra("0.1.4")
val bintrayRepo by extra("scientifik")
val githubProject by extra("kmath")
@ -19,18 +21,15 @@ allprojects {
version = kmathVersion
afterEvaluate {
extensions.findByType<org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension>()?.run {
targets.all {
sourceSets.all {
languageSettings.useExperimentalAnnotation("kotlin.contracts.ExperimentalContracts")
}
extensions.findByType<KotlinProjectExtension>()?.run {
sourceSets.all {
languageSettings.useExperimentalAnnotation("kotlin.contracts.ExperimentalContracts")
}
}
}
}
subprojects {
if (name.startsWith("kmath")) {
apply(plugin = "scientifik.publish")
}
if (name.startsWith("kmath"))
apply<ScientifikPublishPlugin>()
}

View File

@ -8,11 +8,9 @@ import scientifik.kmath.ejml.inverse
import scientifik.kmath.operations.RealField
import scientifik.kmath.operations.invoke
import scientifik.kmath.structures.Matrix
import kotlin.contracts.ExperimentalContracts
import kotlin.random.Random
import kotlin.system.measureTimeMillis
@ExperimentalContracts
fun main() {
val random = Random(1224)
val dim = 100

View File

@ -3,7 +3,6 @@ package scientifik.kmath.structures
import kotlinx.coroutines.GlobalScope
import scientifik.kmath.operations.RealField
import scientifik.kmath.operations.invoke
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract
import kotlin.system.measureTimeMillis

View File

@ -1,8 +1,8 @@
plugins { id("scientifik.mpp") }
plugins {
id("scientifik.mpp")
}
kotlin.sourceSets {
all { languageSettings.useExperimentalAnnotation("kotlin.contracts.ExperimentalContracts") }
commonMain {
dependencies {
api(project(":kmath-core"))

View File

@ -2,7 +2,6 @@ package scientifik.kmath.ast
import scientifik.kmath.expressions.*
import scientifik.kmath.operations.*
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract

View File

@ -7,7 +7,6 @@ import scientifik.kmath.ast.MST
import scientifik.kmath.expressions.Expression
import scientifik.kmath.operations.Algebra
import java.lang.reflect.Method
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract
import kotlin.reflect.KClass

View File

@ -1,4 +1,7 @@
plugins { id("scientifik.jvm") }
plugins {
id("scientifik.jvm")
}
description = "Commons math binding for kmath"
dependencies {
@ -8,5 +11,3 @@ dependencies {
api(project(":kmath-functions"))
api("org.apache.commons:commons-math3:3.6.1")
}
kotlin.sourceSets.all { languageSettings.useExperimentalAnnotation("kotlin.contracts.ExperimentalContracts") }

View File

@ -2,10 +2,8 @@ plugins {
id("scientifik.mpp")
}
kotlin.sourceSets {
commonMain {
dependencies {
api(project(":kmath-memory"))
}
kotlin.sourceSets.commonMain {
dependencies {
api(project(":kmath-memory"))
}
}

View File

@ -4,7 +4,6 @@ import scientifik.kmath.operations.ExtendedField
import scientifik.kmath.operations.Field
import scientifik.kmath.operations.Ring
import scientifik.kmath.operations.Space
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract

View File

@ -4,7 +4,6 @@ import scientifik.kmath.operations.Ring
import scientifik.kmath.structures.Matrix
import scientifik.kmath.structures.Structure2D
import scientifik.kmath.structures.asBuffer
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.contract
import kotlin.math.sqrt

View File

@ -6,7 +6,6 @@ import scientifik.kmath.operations.Field
import scientifik.kmath.operations.invoke
import scientifik.kmath.operations.sum
import scientifik.kmath.structures.asBuffer
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract

View File

@ -2,7 +2,6 @@ package scientifik.kmath.misc
import scientifik.kmath.operations.Space
import scientifik.kmath.operations.invoke
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.contract
import kotlin.jvm.JvmName

View File

@ -3,7 +3,6 @@ package scientifik.kmath.operations
import scientifik.kmath.operations.BigInt.Companion.BASE
import scientifik.kmath.operations.BigInt.Companion.BASE_SIZE
import scientifik.kmath.structures.*
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.contract
import kotlin.math.log2
import kotlin.math.max

View File

@ -6,7 +6,6 @@ import scientifik.kmath.structures.MutableBuffer
import scientifik.memory.MemoryReader
import scientifik.memory.MemorySpec
import scientifik.memory.MemoryWriter
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.contract
import kotlin.math.*

View File

@ -2,7 +2,6 @@ package scientifik.kmath.structures
import scientifik.kmath.operations.Complex
import scientifik.kmath.operations.complex
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.contract
import kotlin.reflect.KClass

View File

@ -4,7 +4,6 @@ import scientifik.kmath.operations.Complex
import scientifik.kmath.operations.ComplexField
import scientifik.kmath.operations.FieldElement
import scientifik.kmath.operations.complex
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract

View File

@ -1,6 +1,5 @@
package scientifik.kmath.structures
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.contract
import kotlin.experimental.and

View File

@ -1,6 +1,5 @@
package scientifik.kmath.structures
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.contract
/**

View File

@ -1,7 +1,5 @@
package scientifik.kmath.structures
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract
/**
@ -31,10 +29,7 @@ inline class IntBuffer(val array: IntArray) : MutableBuffer<Int> {
* The function [init] is called for each array element sequentially starting from the first one.
* It should return the value for an buffer element given its index.
*/
inline fun IntBuffer(size: Int, init: (Int) -> Int): IntBuffer {
contract { callsInPlace(init) }
return IntBuffer(IntArray(size) { init(it) })
}
inline fun IntBuffer(size: Int, init: (Int) -> Int): IntBuffer = IntBuffer(IntArray(size) { init(it) })
/**
* Returns a new [IntBuffer] of given elements.

View File

@ -1,6 +1,5 @@
package scientifik.kmath.structures
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.contract
/**

View File

@ -1,6 +1,5 @@
package scientifik.kmath.structures
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.contract
import kotlin.jvm.JvmName
import kotlin.reflect.KClass

View File

@ -1,6 +1,5 @@
package scientifik.kmath.structures
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.contract
/**

View File

@ -1,6 +1,5 @@
package scientifik.kmath.structures
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.contract
/**

View File

@ -1,11 +1,9 @@
package scientifik.kmath.linear
import scientifik.kmath.structures.Matrix
import kotlin.contracts.ExperimentalContracts
import kotlin.test.Test
import kotlin.test.assertEquals
@ExperimentalContracts
class RealLUSolverTest {
@Test

View File

@ -6,7 +6,6 @@ plugins {
kotlin.sourceSets {
all {
with(languageSettings) {
useExperimentalAnnotation("kotlin.contracts.ExperimentalContracts")
useExperimentalAnnotation("kotlinx.coroutines.InternalCoroutinesApi")
useExperimentalAnnotation("kotlinx.coroutines.ExperimentalCoroutinesApi")
useExperimentalAnnotation("kotlinx.coroutines.FlowPreview")

View File

@ -11,9 +11,9 @@ kotlin.sourceSets {
}
}
jvmMain{
dependencies{
jvmMain {
dependencies {
api(kotlin("reflect"))
}
}
}
}

View File

@ -1,6 +1,9 @@
plugins { id("scientifik.mpp") }
kotlin.sourceSets {
all { languageSettings.useExperimentalAnnotation("kotlin.contracts.ExperimentalContracts") }
commonMain { dependencies { api(project(":kmath-core")) } }
plugins {
id("scientifik.mpp")
}
kotlin.sourceSets.commonMain {
dependencies {
api(project(":kmath-core"))
}
}

View File

@ -9,7 +9,6 @@ import scientifik.kmath.structures.Buffer
import scientifik.kmath.structures.Matrix
import scientifik.kmath.structures.RealBuffer
import scientifik.kmath.structures.asIterable
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.contract
import kotlin.math.pow

View File

@ -1,6 +1,9 @@
plugins { id("scientifik.mpp") }
kotlin.sourceSets {
all { languageSettings.useExperimentalAnnotation("kotlin.contracts.ExperimentalContracts") }
commonMain { dependencies { api(project(":kmath-core")) } }
plugins {
id("scientifik.mpp")
}
kotlin.sourceSets.commonMain {
dependencies {
api(project(":kmath-core"))
}
}

View File

@ -3,7 +3,6 @@ package scientifik.kmath.functions
import scientifik.kmath.operations.Ring
import scientifik.kmath.operations.Space
import scientifik.kmath.operations.invoke
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract
import kotlin.math.max

View File

@ -4,9 +4,6 @@ import scientifik.kmath.domains.Domain
import scientifik.kmath.linear.Point
import scientifik.kmath.structures.ArrayBuffer
import scientifik.kmath.structures.RealBuffer
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract
/**
* The bin in the histogram. The histogram is by definition always done in the real space

View File

@ -1,3 +1,3 @@
plugins {
id("scientifik.mpp")
}
}

View File

@ -6,7 +6,6 @@ import java.nio.channels.FileChannel
import java.nio.file.Files
import java.nio.file.Path
import java.nio.file.StandardOpenOption
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract

View File

@ -14,4 +14,4 @@ kotlin.sourceSets {
api("org.apache.commons:commons-rng-simple:1.3")
}
}
}
}

View File

@ -7,4 +7,4 @@ description = "Binding for https://github.com/JetBrains-Research/viktor"
dependencies {
api(project(":kmath-core"))
api("org.jetbrains.bio:viktor:1.0.1")
}
}