pre-0.0.3 #46
@ -1,14 +1,10 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
extra["kotlinVersion"] = "1.3.20-eap-100"
|
val kotlinVersion: String by rootProject.extra("1.3.20")
|
||||||
extra["ioVersion"] = "0.1.2"
|
val ioVersion: String by rootProject.extra("0.1.2")
|
||||||
extra["coroutinesVersion"] = "1.1.0"
|
val coroutinesVersion: String by rootProject.extra("1.1.1")
|
||||||
|
|
||||||
val kotlinVersion: String by extra
|
|
||||||
val ioVersion: String by extra
|
|
||||||
val coroutinesVersion: String by extra
|
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven("https://dl.bintray.com/kotlin/kotlin-eap")
|
//maven("https://dl.bintray.com/kotlin/kotlin-eap")
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,7 +24,7 @@ allprojects {
|
|||||||
apply(plugin = "com.jfrog.artifactory")
|
apply(plugin = "com.jfrog.artifactory")
|
||||||
|
|
||||||
group = "scientifik"
|
group = "scientifik"
|
||||||
version = "0.0.3-dev-3"
|
version = "0.0.3-dev-4"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven("https://dl.bintray.com/kotlin/kotlin-eap")
|
maven("https://dl.bintray.com/kotlin/kotlin-eap")
|
||||||
|
@ -1,50 +0,0 @@
|
|||||||
plugins {
|
|
||||||
id "org.jetbrains.kotlin.multiplatform"
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
|
||||||
jvm {
|
|
||||||
compilations["main"].kotlinOptions.jvmTarget = "1.8"
|
|
||||||
compilations["test"].kotlinOptions.jvmTarget = "1.8"
|
|
||||||
}
|
|
||||||
js()
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
commonMain {
|
|
||||||
dependencies {
|
|
||||||
api 'org.jetbrains.kotlin:kotlin-stdlib-common'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
commonTest {
|
|
||||||
dependencies {
|
|
||||||
implementation 'org.jetbrains.kotlin:kotlin-test-common'
|
|
||||||
implementation 'org.jetbrains.kotlin:kotlin-test-annotations-common'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
jvmMain {
|
|
||||||
dependencies {
|
|
||||||
api 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
jvmTest {
|
|
||||||
dependencies {
|
|
||||||
implementation 'org.jetbrains.kotlin:kotlin-test'
|
|
||||||
implementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
jsMain {
|
|
||||||
dependencies {
|
|
||||||
api 'org.jetbrains.kotlin:kotlin-stdlib-js'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
jsTest {
|
|
||||||
dependencies {
|
|
||||||
implementation 'org.jetbrains.kotlin:kotlin-test-js'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// mingwMain {
|
|
||||||
// }
|
|
||||||
// mingwTest {
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
55
kmath-core/build.gradle.kts
Normal file
55
kmath-core/build.gradle.kts
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
plugins {
|
||||||
|
kotlin("multiplatform")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
jvm {
|
||||||
|
compilations.all {
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = "1.8"
|
||||||
|
freeCompilerArgs += "-progressive"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
js()
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
val commonMain by getting {
|
||||||
|
dependencies {
|
||||||
|
api(kotlin("stdlib"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val commonTest by getting {
|
||||||
|
dependencies {
|
||||||
|
implementation(kotlin("test-common"))
|
||||||
|
implementation(kotlin("test-annotations-common"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val jvmMain by getting {
|
||||||
|
dependencies {
|
||||||
|
api(kotlin("stdlib-jdk8"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val jvmTest by getting {
|
||||||
|
dependencies {
|
||||||
|
implementation(kotlin("test"))
|
||||||
|
implementation(kotlin("test-junit"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val jsMain by getting {
|
||||||
|
dependencies {
|
||||||
|
api(kotlin("stdlib-js"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val jsTest by getting {
|
||||||
|
dependencies {
|
||||||
|
implementation(kotlin("test-js"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// mingwMain {
|
||||||
|
// }
|
||||||
|
// mingwTest {
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
@ -167,7 +167,7 @@ interface Matrix<T : Any> : NDStructure<T> {
|
|||||||
/**
|
/**
|
||||||
* Build a square matrix from given elements.
|
* Build a square matrix from given elements.
|
||||||
*/
|
*/
|
||||||
fun <T : Any> build(vararg elements: T): Matrix<T> {
|
fun <T : Any> square(vararg elements: T): Matrix<T> {
|
||||||
val size: Int = sqrt(elements.size.toDouble()).toInt()
|
val size: Int = sqrt(elements.size.toDouble()).toInt()
|
||||||
if (size * size != elements.size) error("The number of elements ${elements.size} is not a full square")
|
if (size * size != elements.size) error("The number of elements ${elements.size} is not a full square")
|
||||||
val buffer = elements.asBuffer()
|
val buffer = elements.asBuffer()
|
||||||
|
@ -13,7 +13,7 @@ class RealLUSolverTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testInvert() {
|
fun testInvert() {
|
||||||
val matrix = Matrix.build(
|
val matrix = Matrix.square(
|
||||||
3.0, 1.0,
|
3.0, 1.0,
|
||||||
1.0, 3.0
|
1.0, 3.0
|
||||||
)
|
)
|
||||||
@ -31,7 +31,7 @@ class RealLUSolverTest {
|
|||||||
|
|
||||||
val inverted = LUSolver.real.inverse(decomposed)
|
val inverted = LUSolver.real.inverse(decomposed)
|
||||||
|
|
||||||
val expected = Matrix.build(
|
val expected = Matrix.square(
|
||||||
0.375, -0.125,
|
0.375, -0.125,
|
||||||
-0.125, 0.375
|
-0.125, 0.375
|
||||||
)
|
)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("kotlin-multiplatform")
|
kotlin("multiplatform")
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
@ -2,7 +2,7 @@ pluginManagement {
|
|||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven("https://plugins.gradle.org/m2/")
|
maven("https://plugins.gradle.org/m2/")
|
||||||
maven ("https://dl.bintray.com/kotlin/kotlin-eap")
|
//maven ("https://dl.bintray.com/kotlin/kotlin-eap")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user