diff --git a/kmath-ast/index.html b/kmath-ast/index.html index fb57865c8..97ae98bcd 100644 --- a/kmath-ast/index.html +++ b/kmath-ast/index.html @@ -24,7 +24,7 @@

kmath-ast

-

Performance and visualization extensions to MST API.

  • src/commonMain/kotlin/space/kscience/kmath/ast/parser.kt : Expression language and its parser

  • src/jvmMain/kotlin/space/kscience/kmath/asm/asm.kt : Dynamic MST to JVM bytecode compiler

  • src/jsMain/kotlin/space/kscience/kmath/estree/estree.kt : Dynamic MST to JS compiler

  • src/commonMain/kotlin/space/kscience/kmath/ast/rendering/MathRenderer.kt : Extendable MST rendering

Artifact:

The Maven coordinates of this project are space.kscience:kmath-ast:0.3.0-dev-16.

Gradle:

repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}

dependencies {
implementation 'space.kscience:kmath-ast:0.3.0-dev-16'
}

Gradle Kotlin DSL:

repositories {
maven("https://repo.kotlin.link")
mavenCentral()
}

dependencies {
implementation("space.kscience:kmath-ast:0.3.0-dev-16")
}

Dynamic expression code generation

On JVM

kmath-ast JVM module supports runtime code generation to eliminate overhead of tree traversal. Code generator builds a special implementation of Expression<T> with implemented invoke function.

For example, the following builder:

import space.kscience.kmath.expressions.Symbol.Companion.x
import space.kscience.kmath.expressions.*
import space.kscience.kmath.operations.*
import space.kscience.kmath.asm.*

MstField { x + 2 }.compileToExpression(DoubleField)

... leads to generation of bytecode, which can be decompiled to the following Java class:

package space.kscience.kmath.asm.generated;

import java.util.Map;

import kotlin.jvm.functions.Function2;
import space.kscience.kmath.asm.internal.MapIntrinsics;
import space.kscience.kmath.expressions.Expression;
import space.kscience.kmath.expressions.Symbol;

public final class AsmCompiledExpression_45045_0 implements Expression<Double> {
private final Object[] constants;

public final Double invoke(Map<Symbol, ? extends Double> arguments) {
return (Double) ((Function2) this.constants[0]).invoke((Double) MapIntrinsics.getOrFail(arguments, "x"), 2);
}

public AsmCompiledExpression_45045_0(Object[] constants) {
this.constants = constants;
}
}

Known issues

  • The same classes may be generated and loaded twice, so it is recommended to cache compiled expressions to avoid class loading overhead.

  • This API is not supported by non-dynamic JVM implementations (like TeaVM and GraalVM) because of using class loaders.

On JS

A similar feature is also available on JS.

import space.kscience.kmath.expressions.Symbol.Companion.x
import space.kscience.kmath.expressions.*
import space.kscience.kmath.operations.*
import space.kscience.kmath.estree.*

MstField { x + 2 }.compileToExpression(DoubleField)

The code above returns expression implemented with such a JS function:

var executable = function (constants, arguments) {
return constants[1](constants[0](arguments, "x"), 2);
};

JS also supports experimental expression optimization with WebAssembly IR generation. Currently, only expressions inside DoubleField and IntRing are supported.

import space.kscience.kmath.expressions.Symbol.Companion.x
import space.kscience.kmath.expressions.*
import space.kscience.kmath.operations.*
import space.kscience.kmath.wasm.*

MstField { x + 2 }.compileToExpression(DoubleField)

An example of emitted Wasm IR in the form of WAT:

(func $executable (param $0 f64) (result f64)
(f64.add
(local.get $0)
(f64.const 2)
)
)

Known issues

  • ESTree expression compilation uses eval which can be unavailable in several environments.

  • WebAssembly isn't supported by old versions of browsers (see https://webassembly.org/roadmap/).

Rendering expressions

kmath-ast also includes an extensible engine to display expressions in LaTeX or MathML syntax.

Example usage:

import space.kscience.kmath.ast.*
import space.kscience.kmath.ast.rendering.*
import space.kscience.kmath.misc.*
+

Performance and visualization extensions to MST API.

  • src/commonMain/kotlin/space/kscience/kmath/ast/parser.kt : Expression language and its parser

  • src/jvmMain/kotlin/space/kscience/kmath/asm/asm.kt : Dynamic MST to JVM bytecode compiler

  • src/jsMain/kotlin/space/kscience/kmath/estree/estree.kt : Dynamic MST to JS compiler

  • src/commonMain/kotlin/space/kscience/kmath/ast/rendering/MathRenderer.kt : Extendable MST rendering

Artifact:

The Maven coordinates of this project are space.kscience:kmath-ast:0.3.0-dev-17.

Gradle:

repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}

dependencies {
implementation 'space.kscience:kmath-ast:0.3.0-dev-17'
}

Gradle Kotlin DSL:

repositories {
maven("https://repo.kotlin.link")
mavenCentral()
}

dependencies {
implementation("space.kscience:kmath-ast:0.3.0-dev-17")
}

Dynamic expression code generation

On JVM

kmath-ast JVM module supports runtime code generation to eliminate overhead of tree traversal. Code generator builds a special implementation of Expression<T> with implemented invoke function.

For example, the following builder:

import space.kscience.kmath.expressions.Symbol.Companion.x
import space.kscience.kmath.expressions.*
import space.kscience.kmath.operations.*
import space.kscience.kmath.asm.*

MstField { x + 2 }.compileToExpression(DoubleField)

... leads to generation of bytecode, which can be decompiled to the following Java class:

package space.kscience.kmath.asm.generated;

import java.util.Map;

import kotlin.jvm.functions.Function2;
import space.kscience.kmath.asm.internal.MapIntrinsics;
import space.kscience.kmath.expressions.Expression;
import space.kscience.kmath.expressions.Symbol;

public final class AsmCompiledExpression_45045_0 implements Expression<Double> {
private final Object[] constants;

public final Double invoke(Map<Symbol, ? extends Double> arguments) {
return (Double) ((Function2) this.constants[0]).invoke((Double) MapIntrinsics.getOrFail(arguments, "x"), 2);
}

public AsmCompiledExpression_45045_0(Object[] constants) {
this.constants = constants;
}
}

Known issues

  • The same classes may be generated and loaded twice, so it is recommended to cache compiled expressions to avoid class loading overhead.

  • This API is not supported by non-dynamic JVM implementations (like TeaVM and GraalVM) because of using class loaders.

On JS

A similar feature is also available on JS.

import space.kscience.kmath.expressions.Symbol.Companion.x
import space.kscience.kmath.expressions.*
import space.kscience.kmath.operations.*
import space.kscience.kmath.estree.*

MstField { x + 2 }.compileToExpression(DoubleField)

The code above returns expression implemented with such a JS function:

var executable = function (constants, arguments) {
return constants[1](constants[0](arguments, "x"), 2);
};

JS also supports experimental expression optimization with WebAssembly IR generation. Currently, only expressions inside DoubleField and IntRing are supported.

import space.kscience.kmath.expressions.Symbol.Companion.x
import space.kscience.kmath.expressions.*
import space.kscience.kmath.operations.*
import space.kscience.kmath.wasm.*

MstField { x + 2 }.compileToExpression(DoubleField)

An example of emitted Wasm IR in the form of WAT:

(func $executable (param $0 f64) (result f64)
(f64.add
(local.get $0)
(f64.const 2)
)
)

Known issues

  • ESTree expression compilation uses eval which can be unavailable in several environments.

  • WebAssembly isn't supported by old versions of browsers (see https://webassembly.org/roadmap/).

Rendering expressions

kmath-ast also includes an extensible engine to display expressions in LaTeX or MathML syntax.

Example usage:

import space.kscience.kmath.ast.*
import space.kscience.kmath.ast.rendering.*
import space.kscience.kmath.misc.*

Packages

diff --git a/kmath-complex/index.html b/kmath-complex/index.html index c8336e44e..f8b165d1a 100644 --- a/kmath-complex/index.html +++ b/kmath-complex/index.html @@ -23,7 +23,7 @@

kmath-complex

-

Complex and hypercomplex number systems in KMath.

  • src/commonMain/kotlin/space/kscience/kmath/complex/Complex.kt : Complex Numbers

  • src/commonMain/kotlin/space/kscience/kmath/complex/Quaternion.kt : Quaternions

Artifact:

The Maven coordinates of this project are space.kscience:kmath-complex:0.3.0-dev-16.

Gradle:

repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}

dependencies {
implementation 'space.kscience:kmath-complex:0.3.0-dev-16'
}

Gradle Kotlin DSL:

repositories {
maven("https://repo.kotlin.link")
mavenCentral()
}

dependencies {
implementation("space.kscience:kmath-complex:0.3.0-dev-16")
}
+

Complex and hypercomplex number systems in KMath.

  • src/commonMain/kotlin/space/kscience/kmath/complex/Complex.kt : Complex Numbers

  • src/commonMain/kotlin/space/kscience/kmath/complex/Quaternion.kt : Quaternions

Artifact:

The Maven coordinates of this project are space.kscience:kmath-complex:0.3.0-dev-17.

Gradle:

repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}

dependencies {
implementation 'space.kscience:kmath-complex:0.3.0-dev-17'
}

Gradle Kotlin DSL:

repositories {
maven("https://repo.kotlin.link")
mavenCentral()
}

dependencies {
implementation("space.kscience:kmath-complex:0.3.0-dev-17")
}

Packages

diff --git a/kmath-complex/space.kscience.kmath.complex/-complex/index.html b/kmath-complex/space.kscience.kmath.complex/-complex/index.html index 3124f12eb..ec90ad637 100644 --- a/kmath-complex/space.kscience.kmath.complex/-complex/index.html +++ b/kmath-complex/space.kscience.kmath.complex/-complex/index.html @@ -163,7 +163,7 @@
-
open operator override fun Complex.div(k: Number): Complex
open operator fun Complex.div(arg: StructureND<Complex>): StructureND<Complex>
open operator fun Complex.div(other: Complex): Complex
+
open operator override fun Complex.div(k: Number): Complex
open operator fun Complex.div(other: Complex): Complex
open operator fun Complex.div(arg: StructureND<Complex>): StructureND<Complex>
diff --git a/kmath-core/index.html b/kmath-core/index.html index b8f0f3fd7..366218893 100644 --- a/kmath-core/index.html +++ b/kmath-core/index.html @@ -24,7 +24,7 @@

kmath-core

-

The core interfaces of KMath.

  • src/commonMain/kotlin/space/kscience/kmath/operations/Algebra.kt : Algebraic structures like rings, spaces and fields.

  • src/commonMain/kotlin/space/kscience/kmath/structures/StructureND.kt : Many-dimensional structures and operations on them.

  • src/commonMain/kotlin/space/kscience/kmath/operations/Algebra.kt : Basic linear algebra operations (sums, products, etc.), backed by the Space API. Advanced linear algebra operations like matrix inversion and LU decomposition.

  • src/commonMain/kotlin/space/kscience/kmath/structures/Buffers.kt : One-dimensional structure

  • src/commonMain/kotlin/space/kscience/kmath/expressions : By writing a single mathematical expression once, users will be able to apply different types of objects to the expression by providing a context. Expressions can be used for a wide variety of purposes from high performance calculations to code generation.

  • src/commonMain/kotlin/space/kscience/kmath/domains : Domains

  • src/commonMain/kotlin/space/kscience/kmath/expressions/SimpleAutoDiff.kt : Automatic differentiation

Artifact:

The Maven coordinates of this project are space.kscience:kmath-core:0.3.0-dev-16.

Gradle:

repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}

dependencies {
implementation 'space.kscience:kmath-core:0.3.0-dev-16'
}

Gradle Kotlin DSL:

repositories {
maven("https://repo.kotlin.link")
mavenCentral()
}

dependencies {
implementation("space.kscience:kmath-core:0.3.0-dev-16")
}
+

The core interfaces of KMath.

  • src/commonMain/kotlin/space/kscience/kmath/operations/Algebra.kt : Algebraic structures like rings, spaces and fields.

  • src/commonMain/kotlin/space/kscience/kmath/structures/StructureND.kt : Many-dimensional structures and operations on them.

  • src/commonMain/kotlin/space/kscience/kmath/operations/Algebra.kt : Basic linear algebra operations (sums, products, etc.), backed by the Space API. Advanced linear algebra operations like matrix inversion and LU decomposition.

  • src/commonMain/kotlin/space/kscience/kmath/structures/Buffers.kt : One-dimensional structure

  • src/commonMain/kotlin/space/kscience/kmath/expressions : By writing a single mathematical expression once, users will be able to apply different types of objects to the expression by providing a context. Expressions can be used for a wide variety of purposes from high performance calculations to code generation.

  • src/commonMain/kotlin/space/kscience/kmath/domains : Domains

  • src/commonMain/kotlin/space/kscience/kmath/expressions/SimpleAutoDiff.kt : Automatic differentiation

Artifact:

The Maven coordinates of this project are space.kscience:kmath-core:0.3.0-dev-17.

Gradle:

repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}

dependencies {
implementation 'space.kscience:kmath-core:0.3.0-dev-17'
}

Gradle Kotlin DSL:

repositories {
maven("https://repo.kotlin.link")
mavenCentral()
}

dependencies {
implementation("space.kscience:kmath-core:0.3.0-dev-17")
}

Packages

diff --git a/kmath-core/space.kscience.kmath.expressions/-m-s-t/index.html b/kmath-core/space.kscience.kmath.expressions/-m-s-t/index.html index bac19a494..f6f426cfe 100644 --- a/kmath-core/space.kscience.kmath.expressions/-m-s-t/index.html +++ b/kmath-core/space.kscience.kmath.expressions/-m-s-t/index.html @@ -153,7 +153,7 @@
-
div +
div
Link copied to clipboard
@@ -162,16 +162,16 @@
-
-
open operator fun MST.div(k: Number): MST
open operator fun MST.div(k: Number): MST
open operator fun MST.div(k: Number): MST
open operator fun MST.div(k: Number): MST
-
-
Division of this element by scalar.
-
-
open operator fun MST.div(other: MST): MST
open operator fun MST.div(other: MST): MST
Division of two elements.
+
+ +
+
open operator fun MST.div(k: Number): MST
open operator fun MST.div(k: Number): MST
open operator fun MST.div(k: Number): MST
open operator fun MST.div(k: Number): MST
+
+
Division of this element by scalar.
@@ -224,18 +224,18 @@
open operator override fun MST.minus(other: MST): MST.Binary
Subtraction of two elements.
-
- -
-
open operator fun MST.minus(other: Number): MST
open operator fun MST.minus(other: Number): MST
-
-
Subtraction of element from number.
open operator override fun MST.minus(other: MST): MST.Binary
Subtraction of two elements.
+
+ +
+
open operator fun MST.minus(other: Number): MST
open operator fun MST.minus(other: Number): MST
+
+
Subtraction of element from number.
@@ -335,7 +335,7 @@
-
times +
times
Link copied to clipboard
@@ -344,16 +344,16 @@
-
-
open operator fun MST.times(k: Number): MST
open operator fun MST.times(k: Number): MST
open operator fun MST.times(k: Number): MST
open operator fun MST.times(k: Number): MST
-
-
Multiplication of this element by a scalar.
-
-
open operator fun MST.times(other: MST): MST
open operator fun MST.times(other: MST): MST
open operator fun MST.times(other: MST): MST
Multiplies this element by scalar.
+
+ +
+
open operator fun MST.times(k: Number): MST
open operator fun MST.times(k: Number): MST
open operator fun MST.times(k: Number): MST
open operator fun MST.times(k: Number): MST
+
+
Multiplication of this element by a scalar.
diff --git a/kmath-core/space.kscience.kmath.nd/-structure-n-d/index.html b/kmath-core/space.kscience.kmath.nd/-structure-n-d/index.html index 59e722399..e230af0f6 100644 --- a/kmath-core/space.kscience.kmath.nd/-structure-n-d/index.html +++ b/kmath-core/space.kscience.kmath.nd/-structure-n-d/index.html @@ -311,7 +311,7 @@
-
mapIndexed +
mapIndexed
Link copied to clipboard
@@ -320,16 +320,16 @@
-
-
abstract fun StructureND<Double>.mapIndexed(transform: DoubleField.(index: IntArray, Double) -> Double): StructureND<Double>
-
-
Maps elements from one structure to another one by applying transform to them alongside with their indices.
-
-
abstract fun StructureND<Short>.mapIndexed(transform: ShortRing.(index: IntArray, Short) -> Short): StructureND<Short>
Maps elements from one structure to another one by applying transform to them alongside with their indices.
+
+ +
+
abstract fun StructureND<Double>.mapIndexed(transform: DoubleField.(index: IntArray, Double) -> Double): StructureND<Double>
+
+
Maps elements from one structure to another one by applying transform to them alongside with their indices.
@@ -395,7 +395,7 @@
-
plus +
plus
Link copied to clipboard
@@ -404,6 +404,12 @@
+
+
open operator fun StructureND<Short>.plus(arg: Short): StructureND<Short>
+
+
Adds an ND structure to an element of it.
+
+
open operator override fun StructureND<Double>.plus(other: StructureND<Double>): DoubleBufferND
@@ -414,12 +420,6 @@
open operator override fun StructureND<Double>.plus(arg: Double): DoubleBufferND
Adds an ND structure to an element of it.
-
- -
-
open operator fun StructureND<Short>.plus(arg: Short): StructureND<Short>
-
-
Adds an ND structure to an element of it.
@@ -472,18 +472,18 @@
open operator override fun StructureND<Double>.times(k: Number): DoubleBufferND
Multiplication of this element by a scalar.
-
- -
-
open operator fun StructureND<Double>.times(arg: Double): StructureND<Double>
-
-
Multiplies an ND structure by an element of it.
open operator fun StructureND<Short>.times(arg: Short): StructureND<Short>
Multiplies an ND structure by an element of it.
+
+ +
+
open operator fun StructureND<Double>.times(arg: Double): StructureND<Double>
+
+
Multiplies an ND structure by an element of it.
@@ -517,7 +517,7 @@
-
unaryMinus +
unaryMinus
Link copied to clipboard
@@ -526,16 +526,16 @@
-
-
open operator override fun StructureND<Double>.unaryMinus(): DoubleBufferND
-
-
The negation of this element.
-
-
open operator override fun StructureND<Short>.unaryMinus(): StructureND<Short>
The negation of this element.
+
+ +
+
open operator override fun StructureND<Double>.unaryMinus(): DoubleBufferND
+
+
The negation of this element.
diff --git a/kmath-ejml/index.html b/kmath-ejml/index.html index 2134034e6..357ee8faa 100644 --- a/kmath-ejml/index.html +++ b/kmath-ejml/index.html @@ -23,7 +23,7 @@

kmath-ejml

-

EJML based linear algebra implementation.

  • src/main/kotlin/space/kscience/kmath/ejml/EjmlVector.kt : Point implementations.

  • src/main/kotlin/space/kscience/kmath/ejml/EjmlMatrix.kt : Matrix implementation.

  • src/main/kotlin/space/kscience/kmath/ejml/EjmlLinearSpace.kt : LinearSpace implementations.

Artifact:

The Maven coordinates of this project are space.kscience:kmath-ejml:0.3.0-dev-16.

Gradle:

repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}

dependencies {
implementation 'space.kscience:kmath-ejml:0.3.0-dev-16'
}

Gradle Kotlin DSL:

repositories {
maven("https://repo.kotlin.link")
mavenCentral()
}

dependencies {
implementation("space.kscience:kmath-ejml:0.3.0-dev-16")
}
+

EJML based linear algebra implementation.

  • src/main/kotlin/space/kscience/kmath/ejml/EjmlVector.kt : Point implementations.

  • src/main/kotlin/space/kscience/kmath/ejml/EjmlMatrix.kt : Matrix implementation.

  • src/main/kotlin/space/kscience/kmath/ejml/EjmlLinearSpace.kt : LinearSpace implementations.

Artifact:

The Maven coordinates of this project are space.kscience:kmath-ejml:0.3.0-dev-17.

Gradle:

repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}

dependencies {
implementation 'space.kscience:kmath-ejml:0.3.0-dev-17'
}

Gradle Kotlin DSL:

repositories {
maven("https://repo.kotlin.link")
mavenCentral()
}

dependencies {
implementation("space.kscience:kmath-ejml:0.3.0-dev-17")
}

Packages

diff --git a/kmath-for-real/index.html b/kmath-for-real/index.html index 062da1eaf..fabe04fc5 100644 --- a/kmath-for-real/index.html +++ b/kmath-for-real/index.html @@ -23,7 +23,7 @@

kmath-for-real

-

Specialization of KMath APIs for Double numbers.

  • src/commonMain/kotlin/space/kscience/kmath/real/DoubleVector.kt : Numpy-like operations for Buffers/Points

  • src/commonMain/kotlin/space/kscience/kmath/real/DoubleMatrix.kt : Numpy-like operations for 2d real structures

  • src/commonMain/kotlin/space/kscience/kmath/structures/grids.kt : Uniform grid generators

Artifact:

The Maven coordinates of this project are space.kscience:kmath-for-real:0.3.0-dev-16.

Gradle:

repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}

dependencies {
implementation 'space.kscience:kmath-for-real:0.3.0-dev-16'
}

Gradle Kotlin DSL:

repositories {
maven("https://repo.kotlin.link")
mavenCentral()
}

dependencies {
implementation("space.kscience:kmath-for-real:0.3.0-dev-16")
}
+

Specialization of KMath APIs for Double numbers.

  • src/commonMain/kotlin/space/kscience/kmath/real/DoubleVector.kt : Numpy-like operations for Buffers/Points

  • src/commonMain/kotlin/space/kscience/kmath/real/DoubleMatrix.kt : Numpy-like operations for 2d real structures

  • src/commonMain/kotlin/space/kscience/kmath/structures/grids.kt : Uniform grid generators

Artifact:

The Maven coordinates of this project are space.kscience:kmath-for-real:0.3.0-dev-17.

Gradle:

repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}

dependencies {
implementation 'space.kscience:kmath-for-real:0.3.0-dev-17'
}

Gradle Kotlin DSL:

repositories {
maven("https://repo.kotlin.link")
mavenCentral()
}

dependencies {
implementation("space.kscience:kmath-for-real:0.3.0-dev-17")
}

Packages

diff --git a/kmath-functions/index.html b/kmath-functions/index.html index c01a3fd86..5854a35fd 100644 --- a/kmath-functions/index.html +++ b/kmath-functions/index.html @@ -23,7 +23,7 @@

kmath-functions

-

Functions and interpolations.

  • src/commonMain/kotlin/space/kscience/kmath/functions/Piecewise.kt : Piecewise functions.

  • src/commonMain/kotlin/space/kscience/kmath/functions/Polynomial.kt : Polynomial functions.

  • src/commonMain/kotlin/space/kscience/kmath/interpolation/LinearInterpolator.kt : Linear XY interpolator.

  • src/commonMain/kotlin/space/kscience/kmath/interpolation/SplineInterpolator.kt : Cubic spline XY interpolator.

  • # : Univariate and multivariate quadratures

Artifact:

The Maven coordinates of this project are space.kscience:kmath-functions:0.3.0-dev-16.

Gradle:

repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}

dependencies {
implementation 'space.kscience:kmath-functions:0.3.0-dev-16'
}

Gradle Kotlin DSL:

repositories {
maven("https://repo.kotlin.link")
mavenCentral()
}

dependencies {
implementation("space.kscience:kmath-functions:0.3.0-dev-16")
}
+

Functions and interpolations.

  • src/commonMain/kotlin/space/kscience/kmath/functions/Piecewise.kt : Piecewise functions.

  • src/commonMain/kotlin/space/kscience/kmath/functions/Polynomial.kt : Polynomial functions.

  • src/commonMain/kotlin/space/kscience/kmath/interpolation/LinearInterpolator.kt : Linear XY interpolator.

  • src/commonMain/kotlin/space/kscience/kmath/interpolation/SplineInterpolator.kt : Cubic spline XY interpolator.

  • # : Univariate and multivariate quadratures

Artifact:

The Maven coordinates of this project are space.kscience:kmath-functions:0.3.0-dev-17.

Gradle:

repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}

dependencies {
implementation 'space.kscience:kmath-functions:0.3.0-dev-17'
}

Gradle Kotlin DSL:

repositories {
maven("https://repo.kotlin.link")
mavenCentral()
}

dependencies {
implementation("space.kscience:kmath-functions:0.3.0-dev-17")
}

Packages

diff --git a/kmath-jafama/index.html b/kmath-jafama/index.html index 7ffd7505a..29f69654e 100644 --- a/kmath-jafama/index.html +++ b/kmath-jafama/index.html @@ -23,7 +23,7 @@

kmath-jafama

-

Integration with Jafama.

  • src/main/kotlin/space/kscience/kmath/jafama/ : Double ExtendedField implementations based on Jafama

Artifact:

The Maven coordinates of this project are space.kscience:kmath-jafama:0.3.0-dev-16.

Gradle:

repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}

dependencies {
implementation 'space.kscience:kmath-jafama:0.3.0-dev-16'
}

Gradle Kotlin DSL:

repositories {
maven("https://repo.kotlin.link")
mavenCentral()
}

dependencies {
implementation("space.kscience:kmath-jafama:0.3.0-dev-16")
}

Example usage

All the DoubleField uses can be replaced with JafamaDoubleField or StrictJafamaDoubleField.

import space.kscience.kmath.jafama.*
import space.kscience.kmath.operations.*

fun main() {
val a = 2.0
val b = StrictJafamaDoubleField { exp(a) }
println(JafamaDoubleField { b + a })
println(StrictJafamaDoubleField { ln(b) })
}

Performance

According to KMath benchmarks on GraalVM, Jafama functions are slower than JDK math; however, there are indications that on Hotspot Jafama is a bit faster.

Can't find appropriate benchmark data. Try generating readme files after running benchmarks.

+

Integration with Jafama.

  • src/main/kotlin/space/kscience/kmath/jafama/ : Double ExtendedField implementations based on Jafama

Artifact:

The Maven coordinates of this project are space.kscience:kmath-jafama:0.3.0-dev-17.

Gradle:

repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}

dependencies {
implementation 'space.kscience:kmath-jafama:0.3.0-dev-17'
}

Gradle Kotlin DSL:

repositories {
maven("https://repo.kotlin.link")
mavenCentral()
}

dependencies {
implementation("space.kscience:kmath-jafama:0.3.0-dev-17")
}

Example usage

All the DoubleField uses can be replaced with JafamaDoubleField or StrictJafamaDoubleField.

import space.kscience.kmath.jafama.*
import space.kscience.kmath.operations.*

fun main() {
val a = 2.0
val b = StrictJafamaDoubleField { exp(a) }
println(JafamaDoubleField { b + a })
println(StrictJafamaDoubleField { ln(b) })
}

Performance

According to KMath benchmarks on GraalVM, Jafama functions are slower than JDK math; however, there are indications that on Hotspot Jafama is a bit faster.

Can't find appropriate benchmark data. Try generating readme files after running benchmarks.

Packages

diff --git a/kmath-kotlingrad/index.html b/kmath-kotlingrad/index.html index 57c6a628b..7c66a2939 100644 --- a/kmath-kotlingrad/index.html +++ b/kmath-kotlingrad/index.html @@ -23,7 +23,7 @@

kmath-kotlingrad

-

Kotlin∇ integration module.

  • src/main/kotlin/space/kscience/kmath/kotlingrad/KotlingradExpression.kt : MST based DifferentiableExpression.

  • src/main/kotlin/space/kscience/kmath/kotlingrad/scalarsAdapters.kt : Conversions between Kotlin∇'s SFun and MST

Artifact:

The Maven coordinates of this project are space.kscience:kmath-kotlingrad:0.3.0-dev-16.

Gradle:

repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}

dependencies {
implementation 'space.kscience:kmath-kotlingrad:0.3.0-dev-16'
}

Gradle Kotlin DSL:

repositories {
maven("https://repo.kotlin.link")
mavenCentral()
}

dependencies {
implementation("space.kscience:kmath-kotlingrad:0.3.0-dev-16")
}
+

Kotlin∇ integration module.

  • src/main/kotlin/space/kscience/kmath/kotlingrad/KotlingradExpression.kt : MST based DifferentiableExpression.

  • src/main/kotlin/space/kscience/kmath/kotlingrad/scalarsAdapters.kt : Conversions between Kotlin∇'s SFun and MST

Artifact:

The Maven coordinates of this project are space.kscience:kmath-kotlingrad:0.3.0-dev-17.

Gradle:

repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}

dependencies {
implementation 'space.kscience:kmath-kotlingrad:0.3.0-dev-17'
}

Gradle Kotlin DSL:

repositories {
maven("https://repo.kotlin.link")
mavenCentral()
}

dependencies {
implementation("space.kscience:kmath-kotlingrad:0.3.0-dev-17")
}

Packages

diff --git a/kmath-nd4j/index.html b/kmath-nd4j/index.html index 026230c8e..ce7398e40 100644 --- a/kmath-nd4j/index.html +++ b/kmath-nd4j/index.html @@ -23,7 +23,7 @@

kmath-nd4j

-

ND4J based implementations of KMath abstractions.

  • # : NDStructure wrapper for INDArray

  • # : Rings over Nd4jArrayStructure of Int and Long

  • # : Fields over Nd4jArrayStructure of Float and Double

Artifact:

The Maven coordinates of this project are space.kscience:kmath-nd4j:0.3.0-dev-16.

Gradle:

repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}

dependencies {
implementation 'space.kscience:kmath-nd4j:0.3.0-dev-16'
}

Gradle Kotlin DSL:

repositories {
maven("https://repo.kotlin.link")
mavenCentral()
}

dependencies {
implementation("space.kscience:kmath-nd4j:0.3.0-dev-16")
}

Examples

NDStructure wrapper for INDArray:

import org.nd4j.linalg.factory.*
import scientifik.kmath.nd4j.*
import scientifik.kmath.structures.*

val array = Nd4j.ones(2, 2).asDoubleStructure()
println(array[0, 0]) // 1.0
array[intArrayOf(0, 0)] = 24.0
println(array[0, 0]) // 24.0

Fast element-wise and in-place arithmetics for INDArray:

import org.nd4j.linalg.factory.*
import scientifik.kmath.nd4j.*
import scientifik.kmath.operations.*

val field = DoubleNd4jArrayField(intArrayOf(2, 2))
val array = Nd4j.rand(2, 2).asDoubleStructure()

val res = field {
(25.0 / array + 20) * 4
}

println(res.ndArray)
// [[ 250.6449, 428.5840],
// [ 269.7913, 202.2077]]

Contributed by Iaroslav Postovalov.

+

ND4J based implementations of KMath abstractions.

  • # : NDStructure wrapper for INDArray

  • # : Rings over Nd4jArrayStructure of Int and Long

  • # : Fields over Nd4jArrayStructure of Float and Double

Artifact:

The Maven coordinates of this project are space.kscience:kmath-nd4j:0.3.0-dev-17.

Gradle:

repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}

dependencies {
implementation 'space.kscience:kmath-nd4j:0.3.0-dev-17'
}

Gradle Kotlin DSL:

repositories {
maven("https://repo.kotlin.link")
mavenCentral()
}

dependencies {
implementation("space.kscience:kmath-nd4j:0.3.0-dev-17")
}

Examples

NDStructure wrapper for INDArray:

import org.nd4j.linalg.factory.*
import scientifik.kmath.nd4j.*
import scientifik.kmath.structures.*

val array = Nd4j.ones(2, 2).asDoubleStructure()
println(array[0, 0]) // 1.0
array[intArrayOf(0, 0)] = 24.0
println(array[0, 0]) // 24.0

Fast element-wise and in-place arithmetics for INDArray:

import org.nd4j.linalg.factory.*
import scientifik.kmath.nd4j.*
import scientifik.kmath.operations.*

val field = DoubleNd4jArrayField(intArrayOf(2, 2))
val array = Nd4j.rand(2, 2).asDoubleStructure()

val res = field {
(25.0 / array + 20) * 4
}

println(res.ndArray)
// [[ 250.6449, 428.5840],
// [ 269.7913, 202.2077]]

Contributed by Iaroslav Postovalov.

Packages

diff --git a/kmath-tensors/index.html b/kmath-tensors/index.html index e3a4ac598..a6aedc55e 100644 --- a/kmath-tensors/index.html +++ b/kmath-tensors/index.html @@ -23,7 +23,7 @@

kmath-tensors

-

Common linear algebra operations on tensors.

  • src/commonMain/kotlin/space/kscience/kmath/tensors/api/TensorAlgebra.kt : Basic linear algebra operations on tensors (plus, dot, etc.)

  • src/commonMain/kotlin/space/kscience/kmath/tensors/core/BroadcastDoubleTensorAlgebra.kt : Basic linear algebra operations implemented with broadcasting.

  • src/commonMain/kotlin/space/kscience/kmath/tensors/api/LinearOpsTensorAlgebra.kt : Advanced linear algebra operations like LU decomposition, SVD, etc.

Artifact:

The Maven coordinates of this project are space.kscience:kmath-tensors:0.3.0-dev-16.

Gradle:

repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}

dependencies {
implementation 'space.kscience:kmath-tensors:0.3.0-dev-16'
}

Gradle Kotlin DSL:

repositories {
maven("https://repo.kotlin.link")
mavenCentral()
}

dependencies {
implementation("space.kscience:kmath-tensors:0.3.0-dev-16")
}
+

Common linear algebra operations on tensors.

  • src/commonMain/kotlin/space/kscience/kmath/tensors/api/TensorAlgebra.kt : Basic linear algebra operations on tensors (plus, dot, etc.)

  • src/commonMain/kotlin/space/kscience/kmath/tensors/core/BroadcastDoubleTensorAlgebra.kt : Basic linear algebra operations implemented with broadcasting.

  • src/commonMain/kotlin/space/kscience/kmath/tensors/api/LinearOpsTensorAlgebra.kt : Advanced linear algebra operations like LU decomposition, SVD, etc.

Artifact:

The Maven coordinates of this project are space.kscience:kmath-tensors:0.3.0-dev-17.

Gradle:

repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}

dependencies {
implementation 'space.kscience:kmath-tensors:0.3.0-dev-17'
}

Gradle Kotlin DSL:

repositories {
maven("https://repo.kotlin.link")
mavenCentral()
}

dependencies {
implementation("space.kscience:kmath-tensors:0.3.0-dev-17")
}

Packages