Remove MutableBufferND
This commit is contained in:
parent
90981f6a40
commit
248d42c4e0
@ -19,6 +19,7 @@
|
|||||||
### Removed
|
### Removed
|
||||||
- Nearest in Domain. To be implemented in geometry package.
|
- Nearest in Domain. To be implemented in geometry package.
|
||||||
- Number multiplication and division in main Algebra chain
|
- Number multiplication and division in main Algebra chain
|
||||||
|
- `contentEquals` from Buffer. It moved to the companion.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
54
README.md
54
README.md
@ -87,12 +87,12 @@ KMath is a modular library. Different modules provide different features with di
|
|||||||
> **Maturity**: PROTOTYPE
|
> **Maturity**: PROTOTYPE
|
||||||
>
|
>
|
||||||
> **Features:**
|
> **Features:**
|
||||||
> - [expression-language](kmath-ast/src/jvmMain/kotlin/kscience/kmath/ast/parser.kt) : Expression language and its parser
|
> - [expression-language](kmath-ast/src/jvmMain/kotlin/space/kscience/kmath/ast/parser.kt) : Expression language and its parser
|
||||||
> - [mst](kmath-ast/src/commonMain/kotlin/kscience/kmath/ast/MST.kt) : MST (Mathematical Syntax Tree) as expression language's syntax intermediate representation
|
> - [mst](kmath-ast/src/commonMain/kotlin/space/kscience/kmath/ast/MST.kt) : MST (Mathematical Syntax Tree) as expression language's syntax intermediate representation
|
||||||
> - [mst-building](kmath-ast/src/commonMain/kotlin/kscience/kmath/ast/MstAlgebra.kt) : MST building algebraic structure
|
> - [mst-building](kmath-ast/src/commonMain/kotlin/space/kscience/kmath/ast/MstAlgebra.kt) : MST building algebraic structure
|
||||||
> - [mst-interpreter](kmath-ast/src/commonMain/kotlin/kscience/kmath/ast/MST.kt) : MST interpreter
|
> - [mst-interpreter](kmath-ast/src/commonMain/kotlin/space/kscience/kmath/ast/MST.kt) : MST interpreter
|
||||||
> - [mst-jvm-codegen](kmath-ast/src/jvmMain/kotlin/kscience/kmath/asm/asm.kt) : Dynamic MST to JVM bytecode compiler
|
> - [mst-jvm-codegen](kmath-ast/src/jvmMain/kotlin/space/kscience/kmath/asm/asm.kt) : Dynamic MST to JVM bytecode compiler
|
||||||
> - [mst-js-codegen](kmath-ast/src/jsMain/kotlin/kscience/kmath/estree/estree.kt) : Dynamic MST to JS compiler
|
> - [mst-js-codegen](kmath-ast/src/jsMain/kotlin/space/kscience/kmath/estree/estree.kt) : Dynamic MST to JS compiler
|
||||||
|
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
@ -108,8 +108,8 @@ KMath is a modular library. Different modules provide different features with di
|
|||||||
> **Maturity**: PROTOTYPE
|
> **Maturity**: PROTOTYPE
|
||||||
>
|
>
|
||||||
> **Features:**
|
> **Features:**
|
||||||
> - [complex](kmath-complex/src/commonMain/kotlin/kscience/kmath/complex/Complex.kt) : Complex Numbers
|
> - [complex](kmath-complex/src/commonMain/kotlin/space/kscience/kmath/complex/Complex.kt) : Complex Numbers
|
||||||
> - [quaternion](kmath-complex/src/commonMain/kotlin/kscience/kmath/complex/Quaternion.kt) : Quaternions
|
> - [quaternion](kmath-complex/src/commonMain/kotlin/space/kscience/kmath/complex/Quaternion.kt) : Quaternions
|
||||||
|
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
@ -119,15 +119,15 @@ KMath is a modular library. Different modules provide different features with di
|
|||||||
> **Maturity**: DEVELOPMENT
|
> **Maturity**: DEVELOPMENT
|
||||||
>
|
>
|
||||||
> **Features:**
|
> **Features:**
|
||||||
> - [algebras](kmath-core/src/commonMain/kotlin/kscience/kmath/operations/Algebra.kt) : Algebraic structures like rings, spaces and fields.
|
> - [algebras](kmath-core/src/commonMain/kotlin/space/kscience/kmath/operations/Algebra.kt) : Algebraic structures like rings, spaces and fields.
|
||||||
> - [nd](kmath-core/src/commonMain/kotlin/kscience/kmath/structures/NDStructure.kt) : Many-dimensional structures and operations on them.
|
> - [nd](kmath-core/src/commonMain/kotlin/space/kscience/kmath/nd/StructureND.kt) : Many-dimensional structures and operations on them.
|
||||||
> - [linear](kmath-core/src/commonMain/kotlin/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.
|
> - [linear](kmath-core/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.
|
||||||
> - [buffers](kmath-core/src/commonMain/kotlin/kscience/kmath/structures/Buffers.kt) : One-dimensional structure
|
> - [buffers](kmath-core/src/commonMain/kotlin/space/kscience/kmath/structures/Buffer.kt) : One-dimensional structure
|
||||||
> - [expressions](kmath-core/src/commonMain/kotlin/kscience/kmath/expressions) : By writing a single mathematical expression once, users will be able to apply different types of
|
> - [expressions](kmath-core/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
|
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.
|
performance calculations to code generation.
|
||||||
> - [domains](kmath-core/src/commonMain/kotlin/kscience/kmath/domains) : Domains
|
> - [domains](kmath-core/src/commonMain/kotlin/space/kscience/kmath/domains) : Domains
|
||||||
> - [autodif](kmath-core/src/commonMain/kotlin/kscience/kmath/expressions/SimpleAutoDiff.kt) : Automatic differentiation
|
> - [autodif](kmath-core/src/commonMain/kotlin/space/kscience/kmath/expressions/SimpleAutoDiff.kt) : Automatic differentiation
|
||||||
|
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
@ -157,9 +157,9 @@ One can still use generic algebras though.
|
|||||||
> **Maturity**: EXPERIMENTAL
|
> **Maturity**: EXPERIMENTAL
|
||||||
>
|
>
|
||||||
> **Features:**
|
> **Features:**
|
||||||
> - [RealVector](kmath-for-real/src/commonMain/kotlin/kscience/kmath/real/RealVector.kt) : Numpy-like operations for Buffers/Points
|
> - [DoubleVector](kmath-for-real/src/commonMain/kotlin/space/kscience/kmath/real/DoubleVector.kt) : Numpy-like operations for Buffers/Points
|
||||||
> - [RealMatrix](kmath-for-real/src/commonMain/kotlin/kscience/kmath/real/RealMatrix.kt) : Numpy-like operations for 2d real structures
|
> - [DoubleMatrix](kmath-for-real/src/commonMain/kotlin/space/kscience/kmath/real/DoubleMatrix.kt) : Numpy-like operations for 2d real structures
|
||||||
> - [grids](kmath-for-real/src/commonMain/kotlin/kscience/kmath/structures/grids.kt) : Uniform grid generators
|
> - [grids](kmath-for-real/src/commonMain/kotlin/space/kscience/kmath/structures/grids.kt) : Uniform grid generators
|
||||||
|
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
@ -169,10 +169,10 @@ One can still use generic algebras though.
|
|||||||
> **Maturity**: PROTOTYPE
|
> **Maturity**: PROTOTYPE
|
||||||
>
|
>
|
||||||
> **Features:**
|
> **Features:**
|
||||||
> - [piecewise](kmath-functions/Piecewise functions.) : src/commonMain/kotlin/kscience/kmath/functions/Piecewise.kt
|
> - [piecewise](kmath-functions/Piecewise functions.) : src/commonMain/kotlin/space/kscience/kmath/functions/Piecewise.kt
|
||||||
> - [polynomials](kmath-functions/Polynomial functions.) : src/commonMain/kotlin/kscience/kmath/functions/Polynomial.kt
|
> - [polynomials](kmath-functions/Polynomial functions.) : src/commonMain/kotlin/space/kscience/kmath/functions/Polynomial.kt
|
||||||
> - [linear interpolation](kmath-functions/Linear XY interpolator.) : src/commonMain/kotlin/kscience/kmath/interpolation/LinearInterpolator.kt
|
> - [linear interpolation](kmath-functions/Linear XY interpolator.) : src/commonMain/kotlin/space/kscience/kmath/interpolation/LinearInterpolator.kt
|
||||||
> - [spline interpolation](kmath-functions/Cubic spline XY interpolator.) : src/commonMain/kotlin/kscience/kmath/interpolation/SplineInterpolator.kt
|
> - [spline interpolation](kmath-functions/Cubic spline XY interpolator.) : src/commonMain/kotlin/space/kscience/kmath/interpolation/SplineInterpolator.kt
|
||||||
|
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
@ -206,9 +206,9 @@ One can still use generic algebras though.
|
|||||||
> **Maturity**: EXPERIMENTAL
|
> **Maturity**: EXPERIMENTAL
|
||||||
>
|
>
|
||||||
> **Features:**
|
> **Features:**
|
||||||
> - [nd4jarraystructure](kmath-nd4j/src/commonMain/kotlin/kscience/kmath/operations/Algebra.kt) : NDStructure wrapper for INDArray
|
> - [nd4jarraystructure](kmath-nd4j/src/commonMain/kotlin/space/kscience/kmath/operations/Algebra.kt) : NDStructure wrapper for INDArray
|
||||||
> - [nd4jarrayrings](kmath-nd4j/src/commonMain/kotlin/kscience/kmath/structures/NDStructure.kt) : Rings over Nd4jArrayStructure of Int and Long
|
> - [nd4jarrayrings](kmath-nd4j/src/commonMain/kotlin/space/kscience/kmath/structures/NDStructure.kt) : Rings over Nd4jArrayStructure of Int and Long
|
||||||
> - [nd4jarrayfields](kmath-nd4j/src/commonMain/kotlin/kscience/kmath/structures/Buffers.kt) : Fields over Nd4jArrayStructure of Float and Double
|
> - [nd4jarrayfields](kmath-nd4j/src/commonMain/kotlin/space/kscience/kmath/structures/Buffers.kt) : Fields over Nd4jArrayStructure of Float and Double
|
||||||
|
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
@ -254,8 +254,8 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api("space.kscience:kmath-core:0.3.0-dev-2")
|
api("space.kscience:kmath-core:0.3.0-dev-3")
|
||||||
// api("kscience.kmath:kmath-core-jvm:0.3.0-dev-2") for jvm-specific version
|
// api("kscience.kmath:kmath-core-jvm:0.3.0-dev-3") for jvm-specific version
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ allprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "space.kscience"
|
group = "space.kscience"
|
||||||
version = "0.3.0-dev-2"
|
version = "0.3.0-dev-3"
|
||||||
}
|
}
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
|
@ -2,17 +2,17 @@
|
|||||||
|
|
||||||
This subproject implements the following features:
|
This subproject implements the following features:
|
||||||
|
|
||||||
- [expression-language](src/jvmMain/kotlin/kscience/kmath/ast/parser.kt) : Expression language and its parser
|
- [expression-language](src/jvmMain/kotlin/space/kscience/kmath/ast/parser.kt) : Expression language and its parser
|
||||||
- [mst](src/commonMain/kotlin/kscience/kmath/ast/MST.kt) : MST (Mathematical Syntax Tree) as expression language's syntax intermediate representation
|
- [mst](src/commonMain/kotlin/space/kscience/kmath/ast/MST.kt) : MST (Mathematical Syntax Tree) as expression language's syntax intermediate representation
|
||||||
- [mst-building](src/commonMain/kotlin/kscience/kmath/ast/MstAlgebra.kt) : MST building algebraic structure
|
- [mst-building](src/commonMain/kotlin/space/kscience/kmath/ast/MstAlgebra.kt) : MST building algebraic structure
|
||||||
- [mst-interpreter](src/commonMain/kotlin/kscience/kmath/ast/MST.kt) : MST interpreter
|
- [mst-interpreter](src/commonMain/kotlin/space/kscience/kmath/ast/MST.kt) : MST interpreter
|
||||||
- [mst-jvm-codegen](src/jvmMain/kotlin/kscience/kmath/asm/asm.kt) : Dynamic MST to JVM bytecode compiler
|
- [mst-jvm-codegen](src/jvmMain/kotlin/space/kscience/kmath/asm/asm.kt) : Dynamic MST to JVM bytecode compiler
|
||||||
- [mst-js-codegen](src/jsMain/kotlin/kscience/kmath/estree/estree.kt) : Dynamic MST to JS compiler
|
- [mst-js-codegen](src/jsMain/kotlin/space/kscience/kmath/estree/estree.kt) : Dynamic MST to JS compiler
|
||||||
|
|
||||||
|
|
||||||
> #### Artifact:
|
> #### Artifact:
|
||||||
>
|
>
|
||||||
> This module artifact: `space.kscience:kmath-ast:0.3.0-dev-2`.
|
> This module artifact: `space.kscience:kmath-ast:0.3.0-dev-3`.
|
||||||
>
|
>
|
||||||
> Bintray release version: [ ![Download](https://api.bintray.com/packages/mipt-npm/kscience/kmath-ast/images/download.svg) ](https://bintray.com/mipt-npm/kscience/kmath-ast/_latestVersion)
|
> Bintray release version: [ ![Download](https://api.bintray.com/packages/mipt-npm/kscience/kmath-ast/images/download.svg) ](https://bintray.com/mipt-npm/kscience/kmath-ast/_latestVersion)
|
||||||
>
|
>
|
||||||
@ -25,13 +25,10 @@ This subproject implements the following features:
|
|||||||
> maven { url 'https://repo.kotlin.link' }
|
> maven { url 'https://repo.kotlin.link' }
|
||||||
> maven { url 'https://dl.bintray.com/hotkeytlt/maven' }
|
> maven { url 'https://dl.bintray.com/hotkeytlt/maven' }
|
||||||
> maven { url "https://dl.bintray.com/kotlin/kotlin-eap" } // include for builds based on kotlin-eap
|
> maven { url "https://dl.bintray.com/kotlin/kotlin-eap" } // include for builds based on kotlin-eap
|
||||||
>// Uncomment if repo.kotlin.link is unavailable
|
|
||||||
>// maven { url 'https://dl.bintray.com/mipt-npm/kscience' }
|
|
||||||
>// maven { url 'https://dl.bintray.com/mipt-npm/dev' }
|
|
||||||
> }
|
> }
|
||||||
>
|
>
|
||||||
> dependencies {
|
> dependencies {
|
||||||
> implementation 'space.kscience:kmath-ast:0.3.0-dev-2'
|
> implementation 'space.kscience:kmath-ast:0.3.0-dev-3'
|
||||||
> }
|
> }
|
||||||
> ```
|
> ```
|
||||||
> **Gradle Kotlin DSL:**
|
> **Gradle Kotlin DSL:**
|
||||||
@ -41,13 +38,10 @@ This subproject implements the following features:
|
|||||||
> maven("https://repo.kotlin.link")
|
> maven("https://repo.kotlin.link")
|
||||||
> maven("https://dl.bintray.com/kotlin/kotlin-eap") // include for builds based on kotlin-eap
|
> maven("https://dl.bintray.com/kotlin/kotlin-eap") // include for builds based on kotlin-eap
|
||||||
> maven("https://dl.bintray.com/hotkeytlt/maven") // required for a
|
> maven("https://dl.bintray.com/hotkeytlt/maven") // required for a
|
||||||
>// Uncomment if repo.kotlin.link is unavailable
|
|
||||||
>// maven("https://dl.bintray.com/mipt-npm/kscience")
|
|
||||||
>// maven("https://dl.bintray.com/mipt-npm/dev")
|
|
||||||
> }
|
> }
|
||||||
>
|
>
|
||||||
> dependencies {
|
> dependencies {
|
||||||
> implementation("space.kscience:kmath-ast:0.3.0-dev-2")
|
> implementation("space.kscience:kmath-ast:0.3.0-dev-3")
|
||||||
> }
|
> }
|
||||||
> ```
|
> ```
|
||||||
|
|
||||||
|
@ -58,36 +58,36 @@ readme {
|
|||||||
feature(
|
feature(
|
||||||
id = "expression-language",
|
id = "expression-language",
|
||||||
description = "Expression language and its parser",
|
description = "Expression language and its parser",
|
||||||
ref = "src/jvmMain/kotlin/kscience/kmath/ast/parser.kt"
|
ref = "src/jvmMain/kotlin/space/kscience/kmath/ast/parser.kt"
|
||||||
)
|
)
|
||||||
|
|
||||||
feature(
|
feature(
|
||||||
id = "mst",
|
id = "mst",
|
||||||
description = "MST (Mathematical Syntax Tree) as expression language's syntax intermediate representation",
|
description = "MST (Mathematical Syntax Tree) as expression language's syntax intermediate representation",
|
||||||
ref = "src/commonMain/kotlin/kscience/kmath/ast/MST.kt"
|
ref = "src/commonMain/kotlin/space/kscience/kmath/ast/MST.kt"
|
||||||
)
|
)
|
||||||
|
|
||||||
feature(
|
feature(
|
||||||
id = "mst-building",
|
id = "mst-building",
|
||||||
description = "MST building algebraic structure",
|
description = "MST building algebraic structure",
|
||||||
ref = "src/commonMain/kotlin/kscience/kmath/ast/MstAlgebra.kt"
|
ref = "src/commonMain/kotlin/space/kscience/kmath/ast/MstAlgebra.kt"
|
||||||
)
|
)
|
||||||
|
|
||||||
feature(
|
feature(
|
||||||
id = "mst-interpreter",
|
id = "mst-interpreter",
|
||||||
description = "MST interpreter",
|
description = "MST interpreter",
|
||||||
ref = "src/commonMain/kotlin/kscience/kmath/ast/MST.kt"
|
ref = "src/commonMain/kotlin/space/kscience/kmath/ast/MST.kt"
|
||||||
)
|
)
|
||||||
|
|
||||||
feature(
|
feature(
|
||||||
id = "mst-jvm-codegen",
|
id = "mst-jvm-codegen",
|
||||||
description = "Dynamic MST to JVM bytecode compiler",
|
description = "Dynamic MST to JVM bytecode compiler",
|
||||||
ref = "src/jvmMain/kotlin/kscience/kmath/asm/asm.kt"
|
ref = "src/jvmMain/kotlin/space/kscience/kmath/asm/asm.kt"
|
||||||
)
|
)
|
||||||
|
|
||||||
feature(
|
feature(
|
||||||
id = "mst-js-codegen",
|
id = "mst-js-codegen",
|
||||||
description = "Dynamic MST to JS compiler",
|
description = "Dynamic MST to JS compiler",
|
||||||
ref = "src/jsMain/kotlin/kscience/kmath/estree/estree.kt"
|
ref = "src/jsMain/kotlin/space/kscience/kmath/estree/estree.kt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
Complex and hypercomplex number systems in KMath:
|
Complex and hypercomplex number systems in KMath:
|
||||||
|
|
||||||
- [complex](src/commonMain/kotlin/kscience/kmath/complex/Complex.kt) : Complex Numbers
|
- [complex](src/commonMain/kotlin/space/kscience/kmath/complex/Complex.kt) : Complex Numbers
|
||||||
- [quaternion](src/commonMain/kotlin/kscience/kmath/complex/Quaternion.kt) : Quaternions
|
- [quaternion](src/commonMain/kotlin/space/kscience/kmath/complex/Quaternion.kt) : Quaternions
|
||||||
|
|
||||||
|
|
||||||
> #### Artifact:
|
> #### Artifact:
|
||||||
>
|
>
|
||||||
> This module artifact: `space.kscience:kmath-complex:0.3.0-dev-2`.
|
> This module artifact: `space.kscience:kmath-complex:0.3.0-dev-3`.
|
||||||
>
|
>
|
||||||
> Bintray release version: [ ![Download](https://api.bintray.com/packages/mipt-npm/kscience/kmath-complex/images/download.svg) ](https://bintray.com/mipt-npm/kscience/kmath-complex/_latestVersion)
|
> Bintray release version: [ ![Download](https://api.bintray.com/packages/mipt-npm/kscience/kmath-complex/images/download.svg) ](https://bintray.com/mipt-npm/kscience/kmath-complex/_latestVersion)
|
||||||
>
|
>
|
||||||
@ -21,13 +21,10 @@ Complex and hypercomplex number systems in KMath:
|
|||||||
> maven { url 'https://repo.kotlin.link' }
|
> maven { url 'https://repo.kotlin.link' }
|
||||||
> maven { url 'https://dl.bintray.com/hotkeytlt/maven' }
|
> maven { url 'https://dl.bintray.com/hotkeytlt/maven' }
|
||||||
> maven { url "https://dl.bintray.com/kotlin/kotlin-eap" } // include for builds based on kotlin-eap
|
> maven { url "https://dl.bintray.com/kotlin/kotlin-eap" } // include for builds based on kotlin-eap
|
||||||
>// Uncomment if repo.kotlin.link is unavailable
|
|
||||||
>// maven { url 'https://dl.bintray.com/mipt-npm/kscience' }
|
|
||||||
>// maven { url 'https://dl.bintray.com/mipt-npm/dev' }
|
|
||||||
> }
|
> }
|
||||||
>
|
>
|
||||||
> dependencies {
|
> dependencies {
|
||||||
> implementation 'space.kscience:kmath-complex:0.3.0-dev-2'
|
> implementation 'space.kscience:kmath-complex:0.3.0-dev-3'
|
||||||
> }
|
> }
|
||||||
> ```
|
> ```
|
||||||
> **Gradle Kotlin DSL:**
|
> **Gradle Kotlin DSL:**
|
||||||
@ -37,12 +34,9 @@ Complex and hypercomplex number systems in KMath:
|
|||||||
> maven("https://repo.kotlin.link")
|
> maven("https://repo.kotlin.link")
|
||||||
> maven("https://dl.bintray.com/kotlin/kotlin-eap") // include for builds based on kotlin-eap
|
> maven("https://dl.bintray.com/kotlin/kotlin-eap") // include for builds based on kotlin-eap
|
||||||
> maven("https://dl.bintray.com/hotkeytlt/maven") // required for a
|
> maven("https://dl.bintray.com/hotkeytlt/maven") // required for a
|
||||||
>// Uncomment if repo.kotlin.link is unavailable
|
|
||||||
>// maven("https://dl.bintray.com/mipt-npm/kscience")
|
|
||||||
>// maven("https://dl.bintray.com/mipt-npm/dev")
|
|
||||||
> }
|
> }
|
||||||
>
|
>
|
||||||
> dependencies {
|
> dependencies {
|
||||||
> implementation("space.kscience:kmath-complex:0.3.0-dev-2")
|
> implementation("space.kscience:kmath-complex:0.3.0-dev-3")
|
||||||
> }
|
> }
|
||||||
> ```
|
> ```
|
||||||
|
@ -25,12 +25,12 @@ readme {
|
|||||||
feature(
|
feature(
|
||||||
id = "complex",
|
id = "complex",
|
||||||
description = "Complex Numbers",
|
description = "Complex Numbers",
|
||||||
ref = "src/commonMain/kotlin/kscience/kmath/complex/Complex.kt"
|
ref = "src/commonMain/kotlin/space/kscience/kmath/complex/Complex.kt"
|
||||||
)
|
)
|
||||||
|
|
||||||
feature(
|
feature(
|
||||||
id = "quaternion",
|
id = "quaternion",
|
||||||
description = "Quaternions",
|
description = "Quaternions",
|
||||||
ref = "src/commonMain/kotlin/kscience/kmath/complex/Quaternion.kt"
|
ref = "src/commonMain/kotlin/space/kscience/kmath/complex/Quaternion.kt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -2,20 +2,20 @@
|
|||||||
|
|
||||||
The core features of KMath:
|
The core features of KMath:
|
||||||
|
|
||||||
- [algebras](src/commonMain/kotlin/kscience/kmath/operations/Algebra.kt) : Algebraic structures like rings, spaces and fields.
|
- [algebras](src/commonMain/kotlin/space/kscience/kmath/operations/Algebra.kt) : Algebraic structures like rings, spaces and fields.
|
||||||
- [nd](src/commonMain/kotlin/kscience/kmath/structures/NDStructure.kt) : Many-dimensional structures and operations on them.
|
- [nd](src/commonMain/kotlin/space/kscience/kmath/structures/NDStructure.kt) : Many-dimensional structures and operations on them.
|
||||||
- [linear](src/commonMain/kotlin/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.
|
- [linear](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.
|
||||||
- [buffers](src/commonMain/kotlin/kscience/kmath/structures/Buffers.kt) : One-dimensional structure
|
- [buffers](src/commonMain/kotlin/space/kscience/kmath/structures/Buffers.kt) : One-dimensional structure
|
||||||
- [expressions](src/commonMain/kotlin/kscience/kmath/expressions) : By writing a single mathematical expression once, users will be able to apply different types of
|
- [expressions](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
|
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.
|
performance calculations to code generation.
|
||||||
- [domains](src/commonMain/kotlin/kscience/kmath/domains) : Domains
|
- [domains](src/commonMain/kotlin/space/kscience/kmath/domains) : Domains
|
||||||
- [autodif](src/commonMain/kotlin/kscience/kmath/expressions/SimpleAutoDiff.kt) : Automatic differentiation
|
- [autodif](src/commonMain/kotlin/space/kscience/kmath/expressions/SimpleAutoDiff.kt) : Automatic differentiation
|
||||||
|
|
||||||
|
|
||||||
> #### Artifact:
|
> #### Artifact:
|
||||||
>
|
>
|
||||||
> This module artifact: `space.kscience:kmath-core:0.3.0-dev-2`.
|
> This module artifact: `space.kscience:kmath-core:0.3.0-dev-3`.
|
||||||
>
|
>
|
||||||
> Bintray release version: [ ![Download](https://api.bintray.com/packages/mipt-npm/kscience/kmath-core/images/download.svg) ](https://bintray.com/mipt-npm/kscience/kmath-core/_latestVersion)
|
> Bintray release version: [ ![Download](https://api.bintray.com/packages/mipt-npm/kscience/kmath-core/images/download.svg) ](https://bintray.com/mipt-npm/kscience/kmath-core/_latestVersion)
|
||||||
>
|
>
|
||||||
@ -28,13 +28,10 @@ performance calculations to code generation.
|
|||||||
> maven { url 'https://repo.kotlin.link' }
|
> maven { url 'https://repo.kotlin.link' }
|
||||||
> maven { url 'https://dl.bintray.com/hotkeytlt/maven' }
|
> maven { url 'https://dl.bintray.com/hotkeytlt/maven' }
|
||||||
> maven { url "https://dl.bintray.com/kotlin/kotlin-eap" } // include for builds based on kotlin-eap
|
> maven { url "https://dl.bintray.com/kotlin/kotlin-eap" } // include for builds based on kotlin-eap
|
||||||
>// Uncomment if repo.kotlin.link is unavailable
|
|
||||||
>// maven { url 'https://dl.bintray.com/mipt-npm/kscience' }
|
|
||||||
>// maven { url 'https://dl.bintray.com/mipt-npm/dev' }
|
|
||||||
> }
|
> }
|
||||||
>
|
>
|
||||||
> dependencies {
|
> dependencies {
|
||||||
> implementation 'space.kscience:kmath-core:0.3.0-dev-2'
|
> implementation 'space.kscience:kmath-core:0.3.0-dev-3'
|
||||||
> }
|
> }
|
||||||
> ```
|
> ```
|
||||||
> **Gradle Kotlin DSL:**
|
> **Gradle Kotlin DSL:**
|
||||||
@ -44,12 +41,9 @@ performance calculations to code generation.
|
|||||||
> maven("https://repo.kotlin.link")
|
> maven("https://repo.kotlin.link")
|
||||||
> maven("https://dl.bintray.com/kotlin/kotlin-eap") // include for builds based on kotlin-eap
|
> maven("https://dl.bintray.com/kotlin/kotlin-eap") // include for builds based on kotlin-eap
|
||||||
> maven("https://dl.bintray.com/hotkeytlt/maven") // required for a
|
> maven("https://dl.bintray.com/hotkeytlt/maven") // required for a
|
||||||
>// Uncomment if repo.kotlin.link is unavailable
|
|
||||||
>// maven("https://dl.bintray.com/mipt-npm/kscience")
|
|
||||||
>// maven("https://dl.bintray.com/mipt-npm/dev")
|
|
||||||
> }
|
> }
|
||||||
>
|
>
|
||||||
> dependencies {
|
> dependencies {
|
||||||
> implementation("space.kscience:kmath-core:0.3.0-dev-2")
|
> implementation("space.kscience:kmath-core:0.3.0-dev-3")
|
||||||
> }
|
> }
|
||||||
> ```
|
> ```
|
||||||
|
@ -721,11 +721,11 @@ public final class space/kscience/kmath/nd/BufferAlgebraNDKt {
|
|||||||
public static final fun ring (Lspace/kscience/kmath/nd/AlgebraND$Companion;Lspace/kscience/kmath/operations/Ring;Lkotlin/jvm/functions/Function2;[I)Lspace/kscience/kmath/nd/BufferedRingND;
|
public static final fun ring (Lspace/kscience/kmath/nd/AlgebraND$Companion;Lspace/kscience/kmath/operations/Ring;Lkotlin/jvm/functions/Function2;[I)Lspace/kscience/kmath/nd/BufferedRingND;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class space/kscience/kmath/nd/BufferND : space/kscience/kmath/nd/StructureND {
|
public final class space/kscience/kmath/nd/BufferND : space/kscience/kmath/nd/StructureND {
|
||||||
public fun <init> (Lspace/kscience/kmath/nd/Strides;Lspace/kscience/kmath/structures/Buffer;)V
|
public fun <init> (Lspace/kscience/kmath/nd/Strides;Lspace/kscience/kmath/structures/Buffer;)V
|
||||||
public fun elements ()Lkotlin/sequences/Sequence;
|
public fun elements ()Lkotlin/sequences/Sequence;
|
||||||
public fun get ([I)Ljava/lang/Object;
|
public fun get ([I)Ljava/lang/Object;
|
||||||
public fun getBuffer ()Lspace/kscience/kmath/structures/Buffer;
|
public final fun getBuffer ()Lspace/kscience/kmath/structures/Buffer;
|
||||||
public fun getDimension ()I
|
public fun getDimension ()I
|
||||||
public fun getShape ()[I
|
public fun getShape ()[I
|
||||||
public final fun getStrides ()Lspace/kscience/kmath/nd/Strides;
|
public final fun getStrides ()Lspace/kscience/kmath/nd/Strides;
|
||||||
@ -972,13 +972,6 @@ public final class space/kscience/kmath/nd/GroupND$DefaultImpls {
|
|||||||
public static fun unaryPlus (Lspace/kscience/kmath/nd/GroupND;Lspace/kscience/kmath/nd/StructureND;)Lspace/kscience/kmath/nd/StructureND;
|
public static fun unaryPlus (Lspace/kscience/kmath/nd/GroupND;Lspace/kscience/kmath/nd/StructureND;)Lspace/kscience/kmath/nd/StructureND;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class space/kscience/kmath/nd/MutableBufferND : space/kscience/kmath/nd/BufferND, space/kscience/kmath/nd/MutableStructureND {
|
|
||||||
public fun <init> (Lspace/kscience/kmath/nd/Strides;Lspace/kscience/kmath/structures/MutableBuffer;)V
|
|
||||||
public synthetic fun getBuffer ()Lspace/kscience/kmath/structures/Buffer;
|
|
||||||
public fun getBuffer ()Lspace/kscience/kmath/structures/MutableBuffer;
|
|
||||||
public fun set ([ILjava/lang/Object;)V
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract interface class space/kscience/kmath/nd/MutableStructureND : space/kscience/kmath/nd/StructureND {
|
public abstract interface class space/kscience/kmath/nd/MutableStructureND : space/kscience/kmath/nd/StructureND {
|
||||||
public abstract fun set ([ILjava/lang/Object;)V
|
public abstract fun set ([ILjava/lang/Object;)V
|
||||||
}
|
}
|
||||||
@ -1127,6 +1120,7 @@ public final class space/kscience/kmath/nd/StructureND$Companion {
|
|||||||
public static synthetic fun buffered$default (Lspace/kscience/kmath/nd/StructureND$Companion;Lspace/kscience/kmath/nd/Strides;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lspace/kscience/kmath/nd/BufferND;
|
public static synthetic fun buffered$default (Lspace/kscience/kmath/nd/StructureND$Companion;Lspace/kscience/kmath/nd/Strides;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lspace/kscience/kmath/nd/BufferND;
|
||||||
public static synthetic fun buffered$default (Lspace/kscience/kmath/nd/StructureND$Companion;[ILkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lspace/kscience/kmath/nd/BufferND;
|
public static synthetic fun buffered$default (Lspace/kscience/kmath/nd/StructureND$Companion;[ILkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lspace/kscience/kmath/nd/BufferND;
|
||||||
public final fun contentEquals (Lspace/kscience/kmath/nd/StructureND;Lspace/kscience/kmath/nd/StructureND;)Z
|
public final fun contentEquals (Lspace/kscience/kmath/nd/StructureND;Lspace/kscience/kmath/nd/StructureND;)Z
|
||||||
|
public final fun toString (Lspace/kscience/kmath/nd/StructureND;)Ljava/lang/String;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class space/kscience/kmath/nd/StructureND$DefaultImpls {
|
public final class space/kscience/kmath/nd/StructureND$DefaultImpls {
|
||||||
|
@ -23,13 +23,13 @@ readme {
|
|||||||
description = """
|
description = """
|
||||||
Algebraic structures like rings, spaces and fields.
|
Algebraic structures like rings, spaces and fields.
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
ref = "src/commonMain/kotlin/kscience/kmath/operations/Algebra.kt"
|
ref = "src/commonMain/kotlin/space/kscience/kmath/operations/Algebra.kt"
|
||||||
)
|
)
|
||||||
|
|
||||||
feature(
|
feature(
|
||||||
id = "nd",
|
id = "nd",
|
||||||
description = "Many-dimensional structures and operations on them.",
|
description = "Many-dimensional structures and operations on them.",
|
||||||
ref = "src/commonMain/kotlin/kscience/kmath/structures/NDStructure.kt"
|
ref = "src/commonMain/kotlin/space/kscience/kmath/structures/StructureND.kt"
|
||||||
)
|
)
|
||||||
|
|
||||||
feature(
|
feature(
|
||||||
@ -37,13 +37,13 @@ readme {
|
|||||||
description = """
|
description = """
|
||||||
Basic linear algebra operations (sums, products, etc.), backed by the `Space` API. Advanced linear algebra operations like matrix inversion and LU decomposition.
|
Basic linear algebra operations (sums, products, etc.), backed by the `Space` API. Advanced linear algebra operations like matrix inversion and LU decomposition.
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
ref = "src/commonMain/kotlin/kscience/kmath/operations/Algebra.kt"
|
ref = "src/commonMain/kotlin/space/kscience/kmath/operations/Algebra.kt"
|
||||||
)
|
)
|
||||||
|
|
||||||
feature(
|
feature(
|
||||||
id = "buffers",
|
id = "buffers",
|
||||||
description = "One-dimensional structure",
|
description = "One-dimensional structure",
|
||||||
ref = "src/commonMain/kotlin/kscience/kmath/structures/Buffers.kt"
|
ref = "src/commonMain/kotlin/space/kscience/kmath/structures/Buffers.kt"
|
||||||
)
|
)
|
||||||
|
|
||||||
feature(
|
feature(
|
||||||
@ -53,18 +53,18 @@ readme {
|
|||||||
objects to the expression by providing a context. Expressions can be used for a wide variety of purposes from high
|
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.
|
performance calculations to code generation.
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
ref = "src/commonMain/kotlin/kscience/kmath/expressions"
|
ref = "src/commonMain/kotlin/space/kscience/kmath/expressions"
|
||||||
)
|
)
|
||||||
|
|
||||||
feature(
|
feature(
|
||||||
id = "domains",
|
id = "domains",
|
||||||
description = "Domains",
|
description = "Domains",
|
||||||
ref = "src/commonMain/kotlin/kscience/kmath/domains"
|
ref = "src/commonMain/kotlin/space/kscience/kmath/domains"
|
||||||
)
|
)
|
||||||
|
|
||||||
feature(
|
feature(
|
||||||
id = "autodif",
|
id = "autodif",
|
||||||
description = "Automatic differentiation",
|
description = "Automatic differentiation",
|
||||||
ref = "src/commonMain/kotlin/kscience/kmath/expressions/SimpleAutoDiff.kt"
|
ref = "src/commonMain/kotlin/space/kscience/kmath/expressions/SimpleAutoDiff.kt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,48 @@
|
|||||||
|
package space.kscience.kmath.nd
|
||||||
|
|
||||||
|
import space.kscience.kmath.structures.Buffer
|
||||||
|
import space.kscience.kmath.structures.BufferFactory
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents [StructureND] over [Buffer].
|
||||||
|
*
|
||||||
|
* @param T the type of items.
|
||||||
|
* @param strides The strides to access elements of [Buffer] by linear indices.
|
||||||
|
* @param buffer The underlying buffer.
|
||||||
|
*/
|
||||||
|
public class BufferND<T>(
|
||||||
|
public val strides: Strides,
|
||||||
|
public val buffer: Buffer<T>,
|
||||||
|
) : StructureND<T> {
|
||||||
|
|
||||||
|
init {
|
||||||
|
if (strides.linearSize != buffer.size) {
|
||||||
|
error("Expected buffer side of ${strides.linearSize}, but found ${buffer.size}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override operator fun get(index: IntArray): T = buffer[strides.offset(index)]
|
||||||
|
|
||||||
|
override val shape: IntArray get() = strides.shape
|
||||||
|
|
||||||
|
override fun elements(): Sequence<Pair<IntArray, T>> = strides.indices().map {
|
||||||
|
it to this[it]
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun toString(): String = StructureND.toString(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Transform structure to a new structure using provided [BufferFactory] and optimizing if argument is [BufferND]
|
||||||
|
*/
|
||||||
|
public inline fun <T, reified R : Any> StructureND<T>.mapToBuffer(
|
||||||
|
factory: BufferFactory<R> = Buffer.Companion::auto,
|
||||||
|
crossinline transform: (T) -> R,
|
||||||
|
): BufferND<R> {
|
||||||
|
return if (this is BufferND<T>)
|
||||||
|
BufferND(this.strides, factory.invoke(strides.linearSize) { transform(buffer[it]) })
|
||||||
|
else {
|
||||||
|
val strides = DefaultStrides(shape)
|
||||||
|
BufferND(strides, factory.invoke(strides.linearSize) { transform(get(strides.index(it))) })
|
||||||
|
}
|
||||||
|
}
|
@ -3,8 +3,6 @@ package space.kscience.kmath.nd
|
|||||||
import space.kscience.kmath.misc.UnstableKMathAPI
|
import space.kscience.kmath.misc.UnstableKMathAPI
|
||||||
import space.kscience.kmath.structures.Buffer
|
import space.kscience.kmath.structures.Buffer
|
||||||
import space.kscience.kmath.structures.BufferFactory
|
import space.kscience.kmath.structures.BufferFactory
|
||||||
import space.kscience.kmath.structures.MutableBuffer
|
|
||||||
import space.kscience.kmath.structures.asSequence
|
|
||||||
import kotlin.jvm.JvmName
|
import kotlin.jvm.JvmName
|
||||||
import kotlin.native.concurrent.ThreadLocal
|
import kotlin.native.concurrent.ThreadLocal
|
||||||
import kotlin.reflect.KClass
|
import kotlin.reflect.KClass
|
||||||
@ -56,7 +54,7 @@ public interface StructureND<T> {
|
|||||||
/**
|
/**
|
||||||
* Indicates whether some [StructureND] is equal to another one.
|
* Indicates whether some [StructureND] is equal to another one.
|
||||||
*/
|
*/
|
||||||
public fun <T: Any> contentEquals(st1: StructureND<T>, st2: StructureND<T>): Boolean {
|
public fun <T : Any> contentEquals(st1: StructureND<T>, st2: StructureND<T>): Boolean {
|
||||||
if (st1 === st2) return true
|
if (st1 === st2) return true
|
||||||
|
|
||||||
// fast comparison of buffers if possible
|
// fast comparison of buffers if possible
|
||||||
@ -67,6 +65,25 @@ public interface StructureND<T> {
|
|||||||
return st1.elements().all { (index, value) -> value == st2[index] }
|
return st1.elements().all { (index, value) -> value == st2[index] }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Debug output to string
|
||||||
|
*/
|
||||||
|
public fun toString(structure: StructureND<*>): String {
|
||||||
|
val bufferRepr: String = when (structure.shape.size) {
|
||||||
|
1 -> (0 until structure.shape[0]).map { structure[it] }
|
||||||
|
.joinToString(prefix = "[", postfix = "]", separator = ", ")
|
||||||
|
2 -> (0 until structure.shape[0]).joinToString(prefix = "[", postfix = "]", separator = ", ") { i ->
|
||||||
|
(0 until structure.shape[1]).joinToString(prefix = "[", postfix = "]", separator = ", ") { j ->
|
||||||
|
structure[i, j].toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else -> "..."
|
||||||
|
}
|
||||||
|
val className = structure::class.simpleName ?: "StructureND"
|
||||||
|
|
||||||
|
return "$className(shape=${structure.shape.contentToString()}, buffer=$bufferRepr)"
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a NDStructure with explicit buffer factory.
|
* Creates a NDStructure with explicit buffer factory.
|
||||||
*
|
*
|
||||||
@ -249,83 +266,6 @@ public class DefaultStrides private constructor(override val shape: IntArray) :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents [StructureND] over [Buffer].
|
|
||||||
*
|
|
||||||
* @param T the type of items.
|
|
||||||
* @param strides The strides to access elements of [Buffer] by linear indices.
|
|
||||||
* @param buffer The underlying buffer.
|
|
||||||
*/
|
|
||||||
public open class BufferND<T>(
|
|
||||||
public val strides: Strides,
|
|
||||||
buffer: Buffer<T>,
|
|
||||||
) : StructureND<T> {
|
|
||||||
|
|
||||||
init {
|
|
||||||
if (strides.linearSize != buffer.size) {
|
|
||||||
error("Expected buffer side of ${strides.linearSize}, but found ${buffer.size}")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public open val buffer: Buffer<T> = buffer
|
|
||||||
|
|
||||||
override operator fun get(index: IntArray): T = buffer[strides.offset(index)]
|
|
||||||
|
|
||||||
override val shape: IntArray get() = strides.shape
|
|
||||||
|
|
||||||
override fun elements(): Sequence<Pair<IntArray, T>> = strides.indices().map {
|
|
||||||
it to this[it]
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun toString(): String {
|
|
||||||
val bufferRepr: String = when (shape.size) {
|
|
||||||
1 -> buffer.asSequence().joinToString(prefix = "[", postfix = "]", separator = ", ")
|
|
||||||
2 -> (0 until shape[0]).joinToString(prefix = "[", postfix = "]", separator = ", ") { i ->
|
|
||||||
(0 until shape[1]).joinToString(prefix = "[", postfix = "]", separator = ", ") { j ->
|
|
||||||
val offset = strides.offset(intArrayOf(i, j))
|
|
||||||
buffer[offset].toString()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else -> "..."
|
|
||||||
}
|
|
||||||
return "NDBuffer(shape=${shape.contentToString()}, buffer=$bufferRepr)"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Transform structure to a new structure using provided [BufferFactory] and optimizing if argument is [BufferND]
|
|
||||||
*/
|
|
||||||
public inline fun <T, reified R : Any> StructureND<T>.mapToBuffer(
|
|
||||||
factory: BufferFactory<R> = Buffer.Companion::auto,
|
|
||||||
crossinline transform: (T) -> R,
|
|
||||||
): BufferND<R> {
|
|
||||||
return if (this is BufferND<T>)
|
|
||||||
BufferND(this.strides, factory.invoke(strides.linearSize) { transform(buffer[it]) })
|
|
||||||
else {
|
|
||||||
val strides = DefaultStrides(shape)
|
|
||||||
BufferND(strides, factory.invoke(strides.linearSize) { transform(get(strides.index(it))) })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Mutable ND buffer based on linear [MutableBuffer].
|
|
||||||
*/
|
|
||||||
public class MutableBufferND<T>(
|
|
||||||
strides: Strides,
|
|
||||||
buffer: MutableBuffer<T>,
|
|
||||||
) : BufferND<T>(strides, buffer), MutableStructureND<T> {
|
|
||||||
|
|
||||||
init {
|
|
||||||
require(strides.linearSize == buffer.size) {
|
|
||||||
"Expected buffer side of ${strides.linearSize}, but found ${buffer.size}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override val buffer: MutableBuffer<T> = super.buffer as MutableBuffer<T>
|
|
||||||
|
|
||||||
override operator fun set(index: IntArray, value: T): Unit = buffer.set(strides.offset(index), value)
|
|
||||||
}
|
|
||||||
|
|
||||||
public inline fun <reified T : Any> StructureND<T>.combine(
|
public inline fun <reified T : Any> StructureND<T>.combine(
|
||||||
struct: StructureND<T>,
|
struct: StructureND<T>,
|
||||||
crossinline block: (T, T) -> T,
|
crossinline block: (T, T) -> T,
|
||||||
|
@ -41,6 +41,9 @@ public interface Buffer<out T> {
|
|||||||
|
|
||||||
public companion object {
|
public companion object {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check the element-by-element match of content of two buffers.
|
||||||
|
*/
|
||||||
public fun <T: Any> contentEquals(first: Buffer<T>, second: Buffer<T>): Boolean{
|
public fun <T: Any> contentEquals(first: Buffer<T>, second: Buffer<T>): Boolean{
|
||||||
if (first.size != second.size) return false
|
if (first.size != second.size) return false
|
||||||
for (i in first.indices) {
|
for (i in first.indices) {
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
# Real number specialization module (`kmath-for-real`)
|
# Real number specialization module (`kmath-for-real`)
|
||||||
|
|
||||||
- [RealVector](src/commonMain/kotlin/kscience/kmath/real/RealVector.kt) : Numpy-like operations for Buffers/Points
|
- [DoubleVector](src/commonMain/kotlin/space/kscience/kmath/real/DoubleVector.kt) : Numpy-like operations for Buffers/Points
|
||||||
- [RealMatrix](src/commonMain/kotlin/kscience/kmath/real/RealMatrix.kt) : Numpy-like operations for 2d real structures
|
- [DoubleMatrix](src/commonMain/kotlin/space/kscience/kmath/real/DoubleMatrix.kt) : Numpy-like operations for 2d real structures
|
||||||
- [grids](src/commonMain/kotlin/kscience/kmath/structures/grids.kt) : Uniform grid generators
|
- [grids](src/commonMain/kotlin/space/kscience/kmath/structures/grids.kt) : Uniform grid generators
|
||||||
|
|
||||||
|
|
||||||
> #### Artifact:
|
> #### Artifact:
|
||||||
>
|
>
|
||||||
> This module artifact: `space.kscience:kmath-for-real:0.3.0-dev-2`.
|
> This module artifact: `space.kscience:kmath-for-real:0.3.0-dev-3`.
|
||||||
>
|
>
|
||||||
> Bintray release version: [ ![Download](https://api.bintray.com/packages/mipt-npm/kscience/kmath-for-real/images/download.svg) ](https://bintray.com/mipt-npm/kscience/kmath-for-real/_latestVersion)
|
> Bintray release version: [ ![Download](https://api.bintray.com/packages/mipt-npm/kscience/kmath-for-real/images/download.svg) ](https://bintray.com/mipt-npm/kscience/kmath-for-real/_latestVersion)
|
||||||
>
|
>
|
||||||
@ -20,13 +20,10 @@
|
|||||||
> maven { url 'https://repo.kotlin.link' }
|
> maven { url 'https://repo.kotlin.link' }
|
||||||
> maven { url 'https://dl.bintray.com/hotkeytlt/maven' }
|
> maven { url 'https://dl.bintray.com/hotkeytlt/maven' }
|
||||||
> maven { url "https://dl.bintray.com/kotlin/kotlin-eap" } // include for builds based on kotlin-eap
|
> maven { url "https://dl.bintray.com/kotlin/kotlin-eap" } // include for builds based on kotlin-eap
|
||||||
>// Uncomment if repo.kotlin.link is unavailable
|
|
||||||
>// maven { url 'https://dl.bintray.com/mipt-npm/kscience' }
|
|
||||||
>// maven { url 'https://dl.bintray.com/mipt-npm/dev' }
|
|
||||||
> }
|
> }
|
||||||
>
|
>
|
||||||
> dependencies {
|
> dependencies {
|
||||||
> implementation 'space.kscience:kmath-for-real:0.3.0-dev-2'
|
> implementation 'space.kscience:kmath-for-real:0.3.0-dev-3'
|
||||||
> }
|
> }
|
||||||
> ```
|
> ```
|
||||||
> **Gradle Kotlin DSL:**
|
> **Gradle Kotlin DSL:**
|
||||||
@ -36,12 +33,9 @@
|
|||||||
> maven("https://repo.kotlin.link")
|
> maven("https://repo.kotlin.link")
|
||||||
> maven("https://dl.bintray.com/kotlin/kotlin-eap") // include for builds based on kotlin-eap
|
> maven("https://dl.bintray.com/kotlin/kotlin-eap") // include for builds based on kotlin-eap
|
||||||
> maven("https://dl.bintray.com/hotkeytlt/maven") // required for a
|
> maven("https://dl.bintray.com/hotkeytlt/maven") // required for a
|
||||||
>// Uncomment if repo.kotlin.link is unavailable
|
|
||||||
>// maven("https://dl.bintray.com/mipt-npm/kscience")
|
|
||||||
>// maven("https://dl.bintray.com/mipt-npm/dev")
|
|
||||||
> }
|
> }
|
||||||
>
|
>
|
||||||
> dependencies {
|
> dependencies {
|
||||||
> implementation("space.kscience:kmath-for-real:0.3.0-dev-2")
|
> implementation("space.kscience:kmath-for-real:0.3.0-dev-3")
|
||||||
> }
|
> }
|
||||||
> ```
|
> ```
|
||||||
|
@ -20,18 +20,18 @@ readme {
|
|||||||
feature(
|
feature(
|
||||||
id = "DoubleVector",
|
id = "DoubleVector",
|
||||||
description = "Numpy-like operations for Buffers/Points",
|
description = "Numpy-like operations for Buffers/Points",
|
||||||
ref = "src/commonMain/kotlin/kscience/kmath/real/DoubleVector.kt"
|
ref = "src/commonMain/kotlin/space/kscience/kmath/real/DoubleVector.kt"
|
||||||
)
|
)
|
||||||
|
|
||||||
feature(
|
feature(
|
||||||
id = "DoubleMatrix",
|
id = "DoubleMatrix",
|
||||||
description = "Numpy-like operations for 2d real structures",
|
description = "Numpy-like operations for 2d real structures",
|
||||||
ref = "src/commonMain/kotlin/kscience/kmath/real/DoubleMatrix.kt"
|
ref = "src/commonMain/kotlin/space/kscience/kmath/real/DoubleMatrix.kt"
|
||||||
)
|
)
|
||||||
|
|
||||||
feature(
|
feature(
|
||||||
id = "grids",
|
id = "grids",
|
||||||
description = "Uniform grid generators",
|
description = "Uniform grid generators",
|
||||||
ref = "src/commonMain/kotlin/kscience/kmath/structures/grids.kt"
|
ref = "src/commonMain/kotlin/space/kscience/kmath/structures/grids.kt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -2,15 +2,15 @@
|
|||||||
|
|
||||||
Functions and interpolations:
|
Functions and interpolations:
|
||||||
|
|
||||||
- [piecewise](Piecewise functions.) : src/commonMain/kotlin/kscience/kmath/functions/Piecewise.kt
|
- [piecewise](Piecewise functions.) : src/commonMain/kotlin/space/kscience/kmath/functions/Piecewise.kt
|
||||||
- [polynomials](Polynomial functions.) : src/commonMain/kotlin/kscience/kmath/functions/Polynomial.kt
|
- [polynomials](Polynomial functions.) : src/commonMain/kotlin/space/kscience/kmath/functions/Polynomial.kt
|
||||||
- [linear interpolation](Linear XY interpolator.) : src/commonMain/kotlin/kscience/kmath/interpolation/LinearInterpolator.kt
|
- [linear interpolation](Linear XY interpolator.) : src/commonMain/kotlin/space/kscience/kmath/interpolation/LinearInterpolator.kt
|
||||||
- [spline interpolation](Cubic spline XY interpolator.) : src/commonMain/kotlin/kscience/kmath/interpolation/SplineInterpolator.kt
|
- [spline interpolation](Cubic spline XY interpolator.) : src/commonMain/kotlin/space/kscience/kmath/interpolation/SplineInterpolator.kt
|
||||||
|
|
||||||
|
|
||||||
> #### Artifact:
|
> #### Artifact:
|
||||||
>
|
>
|
||||||
> This module artifact: `space.kscience:kmath-functions:0.3.0-dev-2`.
|
> This module artifact: `space.kscience:kmath-functions:0.3.0-dev-3`.
|
||||||
>
|
>
|
||||||
> Bintray release version: [ ![Download](https://api.bintray.com/packages/mipt-npm/kscience/kmath-functions/images/download.svg) ](https://bintray.com/mipt-npm/kscience/kmath-functions/_latestVersion)
|
> Bintray release version: [ ![Download](https://api.bintray.com/packages/mipt-npm/kscience/kmath-functions/images/download.svg) ](https://bintray.com/mipt-npm/kscience/kmath-functions/_latestVersion)
|
||||||
>
|
>
|
||||||
@ -23,13 +23,10 @@ Functions and interpolations:
|
|||||||
> maven { url 'https://repo.kotlin.link' }
|
> maven { url 'https://repo.kotlin.link' }
|
||||||
> maven { url 'https://dl.bintray.com/hotkeytlt/maven' }
|
> maven { url 'https://dl.bintray.com/hotkeytlt/maven' }
|
||||||
> maven { url "https://dl.bintray.com/kotlin/kotlin-eap" } // include for builds based on kotlin-eap
|
> maven { url "https://dl.bintray.com/kotlin/kotlin-eap" } // include for builds based on kotlin-eap
|
||||||
>// Uncomment if repo.kotlin.link is unavailable
|
|
||||||
>// maven { url 'https://dl.bintray.com/mipt-npm/kscience' }
|
|
||||||
>// maven { url 'https://dl.bintray.com/mipt-npm/dev' }
|
|
||||||
> }
|
> }
|
||||||
>
|
>
|
||||||
> dependencies {
|
> dependencies {
|
||||||
> implementation 'space.kscience:kmath-functions:0.3.0-dev-2'
|
> implementation 'space.kscience:kmath-functions:0.3.0-dev-3'
|
||||||
> }
|
> }
|
||||||
> ```
|
> ```
|
||||||
> **Gradle Kotlin DSL:**
|
> **Gradle Kotlin DSL:**
|
||||||
@ -39,12 +36,9 @@ Functions and interpolations:
|
|||||||
> maven("https://repo.kotlin.link")
|
> maven("https://repo.kotlin.link")
|
||||||
> maven("https://dl.bintray.com/kotlin/kotlin-eap") // include for builds based on kotlin-eap
|
> maven("https://dl.bintray.com/kotlin/kotlin-eap") // include for builds based on kotlin-eap
|
||||||
> maven("https://dl.bintray.com/hotkeytlt/maven") // required for a
|
> maven("https://dl.bintray.com/hotkeytlt/maven") // required for a
|
||||||
>// Uncomment if repo.kotlin.link is unavailable
|
|
||||||
>// maven("https://dl.bintray.com/mipt-npm/kscience")
|
|
||||||
>// maven("https://dl.bintray.com/mipt-npm/dev")
|
|
||||||
> }
|
> }
|
||||||
>
|
>
|
||||||
> dependencies {
|
> dependencies {
|
||||||
> implementation("space.kscience:kmath-functions:0.3.0-dev-2")
|
> implementation("space.kscience:kmath-functions:0.3.0-dev-3")
|
||||||
> }
|
> }
|
||||||
> ```
|
> ```
|
||||||
|
@ -13,12 +13,12 @@ readme {
|
|||||||
maturity = ru.mipt.npm.gradle.Maturity.PROTOTYPE
|
maturity = ru.mipt.npm.gradle.Maturity.PROTOTYPE
|
||||||
propertyByTemplate("artifact", rootProject.file("docs/templates/ARTIFACT-TEMPLATE.md"))
|
propertyByTemplate("artifact", rootProject.file("docs/templates/ARTIFACT-TEMPLATE.md"))
|
||||||
|
|
||||||
feature("piecewise", "src/commonMain/kotlin/kscience/kmath/functions/Piecewise.kt", "Piecewise functions.")
|
feature("piecewise", "src/commonMain/kotlin/space/kscience/kmath/functions/Piecewise.kt", "Piecewise functions.")
|
||||||
feature("polynomials", "src/commonMain/kotlin/kscience/kmath/functions/Polynomial.kt", "Polynomial functions.")
|
feature("polynomials", "src/commonMain/kotlin/space/kscience/kmath/functions/Polynomial.kt", "Polynomial functions.")
|
||||||
feature("linear interpolation",
|
feature("linear interpolation",
|
||||||
"src/commonMain/kotlin/kscience/kmath/interpolation/LinearInterpolator.kt",
|
"src/commonMain/kotlin/space/kscience/kmath/interpolation/LinearInterpolator.kt",
|
||||||
"Linear XY interpolator.")
|
"Linear XY interpolator.")
|
||||||
feature("spline interpolation",
|
feature("spline interpolation",
|
||||||
"src/commonMain/kotlin/kscience/kmath/interpolation/SplineInterpolator.kt",
|
"src/commonMain/kotlin/space/kscience/kmath/interpolation/SplineInterpolator.kt",
|
||||||
"Cubic spline XY interpolator.")
|
"Cubic spline XY interpolator.")
|
||||||
}
|
}
|
@ -2,14 +2,14 @@
|
|||||||
|
|
||||||
This subproject implements the following features:
|
This subproject implements the following features:
|
||||||
|
|
||||||
- [nd4jarraystructure](src/commonMain/kotlin/kscience/kmath/operations/Algebra.kt) : NDStructure wrapper for INDArray
|
- [nd4jarraystructure](#) : NDStructure wrapper for INDArray
|
||||||
- [nd4jarrayrings](src/commonMain/kotlin/kscience/kmath/structures/NDStructure.kt) : Rings over Nd4jArrayStructure of Int and Long
|
- [nd4jarrayrings](#) : Rings over Nd4jArrayStructure of Int and Long
|
||||||
- [nd4jarrayfields](src/commonMain/kotlin/kscience/kmath/structures/Buffers.kt) : Fields over Nd4jArrayStructure of Float and Double
|
- [nd4jarrayfields](#) : Fields over Nd4jArrayStructure of Float and Double
|
||||||
|
|
||||||
|
|
||||||
> #### Artifact:
|
> #### Artifact:
|
||||||
>
|
>
|
||||||
> This module artifact: `space.kscience:kmath-nd4j:0.3.0-dev-2`.
|
> This module artifact: `space.kscience:kmath-nd4j:0.3.0-dev-3`.
|
||||||
>
|
>
|
||||||
> Bintray release version: [ ![Download](https://api.bintray.com/packages/mipt-npm/kscience/kmath-nd4j/images/download.svg) ](https://bintray.com/mipt-npm/kscience/kmath-nd4j/_latestVersion)
|
> Bintray release version: [ ![Download](https://api.bintray.com/packages/mipt-npm/kscience/kmath-nd4j/images/download.svg) ](https://bintray.com/mipt-npm/kscience/kmath-nd4j/_latestVersion)
|
||||||
>
|
>
|
||||||
@ -22,13 +22,10 @@ This subproject implements the following features:
|
|||||||
> maven { url 'https://repo.kotlin.link' }
|
> maven { url 'https://repo.kotlin.link' }
|
||||||
> maven { url 'https://dl.bintray.com/hotkeytlt/maven' }
|
> maven { url 'https://dl.bintray.com/hotkeytlt/maven' }
|
||||||
> maven { url "https://dl.bintray.com/kotlin/kotlin-eap" } // include for builds based on kotlin-eap
|
> maven { url "https://dl.bintray.com/kotlin/kotlin-eap" } // include for builds based on kotlin-eap
|
||||||
>// Uncomment if repo.kotlin.link is unavailable
|
|
||||||
>// maven { url 'https://dl.bintray.com/mipt-npm/kscience' }
|
|
||||||
>// maven { url 'https://dl.bintray.com/mipt-npm/dev' }
|
|
||||||
> }
|
> }
|
||||||
>
|
>
|
||||||
> dependencies {
|
> dependencies {
|
||||||
> implementation 'space.kscience:kmath-nd4j:0.3.0-dev-2'
|
> implementation 'space.kscience:kmath-nd4j:0.3.0-dev-3'
|
||||||
> }
|
> }
|
||||||
> ```
|
> ```
|
||||||
> **Gradle Kotlin DSL:**
|
> **Gradle Kotlin DSL:**
|
||||||
@ -38,13 +35,10 @@ This subproject implements the following features:
|
|||||||
> maven("https://repo.kotlin.link")
|
> maven("https://repo.kotlin.link")
|
||||||
> maven("https://dl.bintray.com/kotlin/kotlin-eap") // include for builds based on kotlin-eap
|
> maven("https://dl.bintray.com/kotlin/kotlin-eap") // include for builds based on kotlin-eap
|
||||||
> maven("https://dl.bintray.com/hotkeytlt/maven") // required for a
|
> maven("https://dl.bintray.com/hotkeytlt/maven") // required for a
|
||||||
>// Uncomment if repo.kotlin.link is unavailable
|
|
||||||
>// maven("https://dl.bintray.com/mipt-npm/kscience")
|
|
||||||
>// maven("https://dl.bintray.com/mipt-npm/dev")
|
|
||||||
> }
|
> }
|
||||||
>
|
>
|
||||||
> dependencies {
|
> dependencies {
|
||||||
> implementation("space.kscience:kmath-nd4j:0.3.0-dev-2")
|
> implementation("space.kscience:kmath-nd4j:0.3.0-dev-3")
|
||||||
> }
|
> }
|
||||||
> ```
|
> ```
|
||||||
|
|
||||||
@ -57,7 +51,7 @@ import org.nd4j.linalg.factory.*
|
|||||||
import scientifik.kmath.nd4j.*
|
import scientifik.kmath.nd4j.*
|
||||||
import scientifik.kmath.structures.*
|
import scientifik.kmath.structures.*
|
||||||
|
|
||||||
val array = Nd4j.ones(2, 2).asRealStructure()
|
val array = Nd4j.ones(2, 2).asDoubleStructure()
|
||||||
println(array[0, 0]) // 1.0
|
println(array[0, 0]) // 1.0
|
||||||
array[intArrayOf(0, 0)] = 24.0
|
array[intArrayOf(0, 0)] = 24.0
|
||||||
println(array[0, 0]) // 24.0
|
println(array[0, 0]) // 24.0
|
||||||
@ -70,8 +64,8 @@ import org.nd4j.linalg.factory.*
|
|||||||
import scientifik.kmath.nd4j.*
|
import scientifik.kmath.nd4j.*
|
||||||
import scientifik.kmath.operations.*
|
import scientifik.kmath.operations.*
|
||||||
|
|
||||||
val field = RealNd4jArrayField(intArrayOf(2, 2))
|
val field = DoubleNd4jArrayField(intArrayOf(2, 2))
|
||||||
val array = Nd4j.rand(2, 2).asRealStructure()
|
val array = Nd4j.rand(2, 2).asDoubleStructure()
|
||||||
|
|
||||||
val res = field {
|
val res = field {
|
||||||
(25.0 / array + 20) * 4
|
(25.0 / array + 20) * 4
|
||||||
|
@ -19,19 +19,16 @@ readme {
|
|||||||
|
|
||||||
feature(
|
feature(
|
||||||
id = "nd4jarraystructure",
|
id = "nd4jarraystructure",
|
||||||
description = "NDStructure wrapper for INDArray",
|
description = "NDStructure wrapper for INDArray"
|
||||||
ref = "src/commonMain/kotlin/kscience/kmath/operations/Algebra.kt"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
feature(
|
feature(
|
||||||
id = "nd4jarrayrings",
|
id = "nd4jarrayrings",
|
||||||
description = "Rings over Nd4jArrayStructure of Int and Long",
|
description = "Rings over Nd4jArrayStructure of Int and Long"
|
||||||
ref = "src/commonMain/kotlin/kscience/kmath/structures/NDStructure.kt"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
feature(
|
feature(
|
||||||
id = "nd4jarrayfields",
|
id = "nd4jarrayfields",
|
||||||
description = "Fields over Nd4jArrayStructure of Float and Double",
|
description = "Fields over Nd4jArrayStructure of Float and Double"
|
||||||
ref = "src/commonMain/kotlin/kscience/kmath/structures/Buffers.kt"
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user