Merge branch 'dev' into feature/quaternion
# Conflicts: # CHANGELOG.md # README.md # kmath-core/README.md
This commit is contained in:
commit
46650a414e
@ -12,6 +12,8 @@ jobs:
|
|||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: 11
|
java-version: 11
|
||||||
|
- name: Grant execute permission for gradlew
|
||||||
|
run: chmod +x gradlew
|
||||||
- name: Install Chrome
|
- name: Install Chrome
|
||||||
run: |
|
run: |
|
||||||
sudo apt install -y libappindicator1 fonts-liberation
|
sudo apt install -y libappindicator1 fonts-liberation
|
||||||
@ -47,6 +49,8 @@ jobs:
|
|||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: 11
|
java-version: 11
|
||||||
|
- name: Grant execute permission for gradlew
|
||||||
|
run: chmod +x gradlew
|
||||||
- name: Cache gradle
|
- name: Cache gradle
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
@ -77,6 +81,8 @@ jobs:
|
|||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: 11
|
java-version: 11
|
||||||
|
- name: Grant execute permission for gradlew
|
||||||
|
run: chmod +x gradlew
|
||||||
- name: Add msys to path
|
- name: Add msys to path
|
||||||
run: SETX PATH "%PATH%;C:\msys64\mingw64\bin"
|
run: SETX PATH "%PATH%;C:\msys64\mingw64\bin"
|
||||||
- name: Cache gradle
|
- name: Cache gradle
|
117
.github/workflows/publish.yml
vendored
Normal file
117
.github/workflows/publish.yml
vendored
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
name: Bintray Publish
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types:
|
||||||
|
- created
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-ubuntu:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up JDK 11
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: 11
|
||||||
|
- name: Grant execute permission for gradlew
|
||||||
|
run: chmod +x gradlew
|
||||||
|
- name: Install Chrome
|
||||||
|
run: |
|
||||||
|
sudo apt install -y libappindicator1 fonts-liberation
|
||||||
|
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
||||||
|
sudo dpkg -i google-chrome*.deb
|
||||||
|
- name: Cache gradle
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
.gradle
|
||||||
|
build
|
||||||
|
~/.gradle
|
||||||
|
key: gradle
|
||||||
|
restore-keys: gradle
|
||||||
|
|
||||||
|
- name: Cache konan
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.konan/dependencies
|
||||||
|
~/.konan/kotlin-native-prebuilt-linux-*
|
||||||
|
key: ${{ runner.os }}-konan
|
||||||
|
restore-keys: ${{ runner.os }}-konan
|
||||||
|
- name: Build with Gradle
|
||||||
|
run: ./gradlew -Dorg.gradle.daemon=false --build-cache build
|
||||||
|
- name: Run release task
|
||||||
|
run: ./gradlew release -PbintrayUser=${{ secrets.BINTRAY_USER }} -PbintrayApiKey=${{ secrets.BINTRAY_KEY }}
|
||||||
|
|
||||||
|
build-osx:
|
||||||
|
runs-on: macos-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up JDK 11
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: 11
|
||||||
|
- name: Grant execute permission for gradlew
|
||||||
|
run: chmod +x gradlew
|
||||||
|
- name: Cache gradle
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
.gradle
|
||||||
|
build
|
||||||
|
~/.gradle
|
||||||
|
key: gradle
|
||||||
|
restore-keys: gradle
|
||||||
|
|
||||||
|
- name: Cache konan
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.konan/dependencies
|
||||||
|
~/.konan/kotlin-native-prebuilt-macos-*
|
||||||
|
key: ${{ runner.os }}-konan
|
||||||
|
restore-keys: ${{ runner.os }}-konan
|
||||||
|
- name: Build with Gradle
|
||||||
|
run: sudo ./gradlew -Dorg.gradle.daemon=false --build-cache build
|
||||||
|
- name: Run release task
|
||||||
|
run: ./gradlew release -PbintrayUser=${{ secrets.BINTRAY_USER }} -PbintrayApiKey=${{ secrets.BINTRAY_KEY }}
|
||||||
|
|
||||||
|
build-windows:
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up JDK 11
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: 11
|
||||||
|
- name: Grant execute permission for gradlew
|
||||||
|
run: chmod +x gradlew
|
||||||
|
- name: Add msys to path
|
||||||
|
run: SETX PATH "%PATH%;C:\msys64\mingw64\bin"
|
||||||
|
- name: Cache gradle
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
.gradle
|
||||||
|
build
|
||||||
|
~/.gradle
|
||||||
|
key: ${{ runner.os }}-gradle
|
||||||
|
restore-keys: ${{ runner.os }}-gradle
|
||||||
|
|
||||||
|
- name: Cache konan
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.konan/dependencies
|
||||||
|
~/.konan/kotlin-native-prebuilt-mingw-*
|
||||||
|
key: ${{ runner.os }}-konan
|
||||||
|
restore-keys: ${{ runner.os }}-konan
|
||||||
|
- name: Build with Gradle
|
||||||
|
run: ./gradlew --build-cache build
|
||||||
|
- name: Run release task
|
||||||
|
run: ./gradlew release -PbintrayUser=${{ secrets.BINTRAY_USER }} -PbintrayApiKey=${{ secrets.BINTRAY_KEY }}
|
||||||
|
|
@ -38,6 +38,7 @@
|
|||||||
- Features moved to NDStructure and became transparent.
|
- Features moved to NDStructure and became transparent.
|
||||||
- Capitalization of LUP in many names changed to Lup.
|
- Capitalization of LUP in many names changed to Lup.
|
||||||
- Refactored `NDStructure` algebra to be more simple, preferring under-the-hood conversion to explicit NDStructure types
|
- Refactored `NDStructure` algebra to be more simple, preferring under-the-hood conversion to explicit NDStructure types
|
||||||
|
- Refactor histograms. They are marked as prototype
|
||||||
- `Complex` and related features moved to a separate module `kmath-complex`
|
- `Complex` and related features moved to a separate module `kmath-complex`
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
|
99
README.md
99
README.md
@ -9,7 +9,7 @@ Bintray-dev: [ ![Download](https://api.bintray.com/packages/mipt-npm/dev/kmat
|
|||||||
|
|
||||||
# KMath
|
# KMath
|
||||||
|
|
||||||
Could be pronounced as `key-math`. The Kotlin MATHematics library was initially intended as a Kotlin-based analog to
|
Could be pronounced as `key-math`. The **K**otlin **Math**ematics library was initially intended as a Kotlin-based analog to
|
||||||
Python's NumPy library. Later we found that kotlin is much more flexible language and allows superior architecture
|
Python's NumPy library. Later we found that kotlin is much more flexible language and allows superior architecture
|
||||||
designs. In contrast to `numpy` and `scipy` it is modular and has a lightweight core. The `numpy`-like experience could
|
designs. In contrast to `numpy` and `scipy` it is modular and has a lightweight core. The `numpy`-like experience could
|
||||||
be achieved with [kmath-for-real](/kmath-for-real) extension module.
|
be achieved with [kmath-for-real](/kmath-for-real) extension module.
|
||||||
@ -32,49 +32,46 @@ be achieved with [kmath-for-real](/kmath-for-real) extension module.
|
|||||||
* Provide the best performance out of the box. We have specialized libraries for that. Need only API wrappers for them.
|
* Provide the best performance out of the box. We have specialized libraries for that. Need only API wrappers for them.
|
||||||
* Cover all cases as immediately and in one bundle. We will modularize everything and add new features gradually.
|
* Cover all cases as immediately and in one bundle. We will modularize everything and add new features gradually.
|
||||||
* Provide specialized behavior in the core. API is made generic on purpose, so one needs to specialize for types, like
|
* Provide specialized behavior in the core. API is made generic on purpose, so one needs to specialize for types, like
|
||||||
for `Double` in the core. For that we will have specialization modules like `for-real`, which will give better
|
for `Double` in the core. For that we will have specialization modules like `kmath-for-real`, which will give better
|
||||||
experience for those, who want to work with specific types.
|
experience for those, who want to work with specific types.
|
||||||
|
|
||||||
## Features
|
## Features and stability
|
||||||
|
|
||||||
Current feature list is [here](/docs/features.md)
|
KMath is a modular library. Different modules provide different features with different API stability guarantees. All core modules are released with the same version, but with different API change policy. The features are described in module definitions below. The module stability could have following levels:
|
||||||
|
|
||||||
* **Algebra**
|
* **PROTOTYPE**. On this level there are no compatibility guarantees. All methods and classes form those modules could break any moment. You can still use it, but be sure to fix the specific version.
|
||||||
* Algebraic structures like rings, spaces and fields (**TODO** add example to wiki)
|
* **EXPERIMENTAL**. The general API is decided, but some changes could be made. Volatile API is marked with `@UnstableKmathAPI` or other stability warning annotations.
|
||||||
* Basic linear algebra operations (sums, products, etc.), backed by the `Space` API.
|
* **DEVELOPMENT**. API breaking genrally follows semantic versioning ideology. There could be changes in minor versions, but not in patch versions. API is protected with [binary-compatibility-validator](https://github.com/Kotlin/binary-compatibility-validator) tool.
|
||||||
* Complex numbers backed by the `Field` API (meaning they will be usable in any structure like vectors and
|
* **STABLE**. The API stabilized. Breaking changes are allowed only in major releases.
|
||||||
N-dimensional arrays).
|
|
||||||
* Advanced linear algebra operations like matrix inversion and LU decomposition.
|
|
||||||
|
|
||||||
* **Array-like structures** Full support of many-dimensional array-like structures
|
<!--Current feature list is [here](/docs/features.md)-->
|
||||||
including mixed arithmetic operations and function operations over arrays and numbers (with the added benefit of static type checking).
|
|
||||||
|
|
||||||
* **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.
|
|
||||||
|
|
||||||
* **Histograms** Fast multi-dimensional histograms.
|
<!--* **Array-like structures** Full support of many-dimensional array-like structures -->
|
||||||
|
<!--including mixed arithmetic operations and function operations over arrays and numbers (with the added benefit of static type checking).-->
|
||||||
|
|
||||||
* **Streaming** Streaming operations on mathematical objects and objects buffers.
|
<!--* **Histograms** Fast multi-dimensional histograms.-->
|
||||||
|
|
||||||
* **Type-safe dimensions** Type-safe dimensions for matrix operations.
|
<!--* **Streaming** Streaming operations on mathematical objects and objects buffers.-->
|
||||||
|
|
||||||
* **Commons-math wrapper** It is planned to gradually wrap most parts of
|
<!--* **Type-safe dimensions** Type-safe dimensions for matrix operations.-->
|
||||||
[Apache commons-math](http://commons.apache.org/proper/commons-math/) library in Kotlin code and maybe rewrite some
|
|
||||||
parts to better suit the Kotlin programming paradigm, however there is no established roadmap for that. Feel free to
|
|
||||||
submit a feature request if you want something to be implemented first.
|
|
||||||
|
|
||||||
## Planned features
|
|
||||||
|
|
||||||
* **Messaging** A mathematical notation to support multi-language and multi-node communication for mathematical tasks.
|
<!--* **Commons-math wrapper** It is planned to gradually wrap most parts of -->
|
||||||
|
<!--[Apache commons-math](http://commons.apache.org/proper/commons-math/) library in Kotlin code and maybe rewrite some -->
|
||||||
|
<!--parts to better suit the Kotlin programming paradigm, however there is no established roadmap for that. Feel free to -->
|
||||||
|
<!--submit a feature request if you want something to be implemented first.-->
|
||||||
|
<!-- -->
|
||||||
|
<!--## Planned features-->
|
||||||
|
|
||||||
* **Array statistics**
|
<!--* **Messaging** A mathematical notation to support multi-language and multi-node communication for mathematical tasks.-->
|
||||||
|
|
||||||
* **Integration** Univariate and multivariate integration framework.
|
<!--* **Array statistics** -->
|
||||||
|
|
||||||
* **Probability and distributions**
|
<!--* **Integration** Univariate and multivariate integration framework.-->
|
||||||
|
|
||||||
* **Fitting** Non-linear curve fitting facilities
|
<!--* **Probability and distributions**-->
|
||||||
|
|
||||||
|
<!--* **Fitting** Non-linear curve fitting facilities-->
|
||||||
|
|
||||||
## Modules
|
## Modules
|
||||||
|
|
||||||
@ -107,27 +104,19 @@ submit a feature request if you want something to be implemented first.
|
|||||||
> **Maturity**: EXPERIMENTAL
|
> **Maturity**: EXPERIMENTAL
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
* ### [kmath-complex](kmath-complex)
|
|
||||||
> Complex numbers and quaternions.
|
|
||||||
>
|
|
||||||
> **Maturity**: PROTOTYPE
|
|
||||||
>
|
|
||||||
> **Features:**
|
|
||||||
> - [complex](kmath-complex/src/commonMain/kotlin/kscience/kmath/complex/Complex.kt) : Complex Numbers
|
|
||||||
> - [quaternion](kmath-complex/src/commonMain/kotlin/kscience/kmath/complex/Quaternion.kt) : Quaternions
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
* ### [kmath-core](kmath-core)
|
* ### [kmath-core](kmath-core)
|
||||||
> Core classes, algebra definitions, basic linear algebra
|
> Core classes, algebra definitions, basic linear algebra
|
||||||
>
|
>
|
||||||
> **Maturity**: DEVELOPMENT
|
> **Maturity**: DEVELOPMENT
|
||||||
>
|
>
|
||||||
> **Features:**
|
> **Features:**
|
||||||
> - [algebras](kmath-core/src/commonMain/kotlin/kscience/kmath/operations/Algebra.kt) : Algebraic structures: contexts and elements
|
> - [algebras](kmath-core/src/commonMain/kotlin/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
|
> - [nd](kmath-core/src/commonMain/kotlin/kscience/kmath/structures/NDStructure.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.
|
||||||
> - [buffers](kmath-core/src/commonMain/kotlin/kscience/kmath/structures/Buffers.kt) : One-dimensional structure
|
> - [buffers](kmath-core/src/commonMain/kotlin/kscience/kmath/structures/Buffers.kt) : One-dimensional structure
|
||||||
> - [expressions](kmath-core/src/commonMain/kotlin/kscience/kmath/expressions) : Functional Expressions
|
> - [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
|
||||||
|
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.
|
||||||
> - [domains](kmath-core/src/commonMain/kotlin/kscience/kmath/domains) : Domains
|
> - [domains](kmath-core/src/commonMain/kotlin/kscience/kmath/domains) : Domains
|
||||||
> - [autodif](kmath-core/src/commonMain/kotlin/kscience/kmath/expressions/SimpleAutoDiff.kt) : Automatic differentiation
|
> - [autodif](kmath-core/src/commonMain/kotlin/kscience/kmath/expressions/SimpleAutoDiff.kt) : Automatic differentiation
|
||||||
|
|
||||||
@ -148,7 +137,7 @@ submit a feature request if you want something to be implemented first.
|
|||||||
* ### [kmath-ejml](kmath-ejml)
|
* ### [kmath-ejml](kmath-ejml)
|
||||||
>
|
>
|
||||||
>
|
>
|
||||||
> **Maturity**: EXPERIMENTAL
|
> **Maturity**: PROTOTYPE
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
* ### [kmath-for-real](kmath-for-real)
|
* ### [kmath-for-real](kmath-for-real)
|
||||||
@ -166,15 +155,22 @@ One can still use generic algebras though.
|
|||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
* ### [kmath-functions](kmath-functions)
|
* ### [kmath-functions](kmath-functions)
|
||||||
>
|
> Functions and interpolation
|
||||||
>
|
>
|
||||||
> **Maturity**: EXPERIMENTAL
|
> **Maturity**: PROTOTYPE
|
||||||
|
>
|
||||||
|
> **Features:**
|
||||||
|
> - [piecewise](kmath-functions/Piecewise functions.) : src/commonMain/kotlin/kscience/kmath/functions/Piecewise.kt
|
||||||
|
> - [polynomials](kmath-functions/Polynomial functions.) : src/commonMain/kotlin/kscience/kmath/functions/Polynomial.kt
|
||||||
|
> - [linear interpolation](kmath-functions/Linear XY interpolator.) : src/commonMain/kotlin/kscience/kmath/interpolation/LinearInterpolator.kt
|
||||||
|
> - [spline interpolation](kmath-functions/Cubic spline XY interpolator.) : src/commonMain/kotlin/kscience/kmath/interpolation/SplineInterpolator.kt
|
||||||
|
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
* ### [kmath-geometry](kmath-geometry)
|
* ### [kmath-geometry](kmath-geometry)
|
||||||
>
|
>
|
||||||
>
|
>
|
||||||
> **Maturity**: EXPERIMENTAL
|
> **Maturity**: PROTOTYPE
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
* ### [kmath-histograms](kmath-histograms)
|
* ### [kmath-histograms](kmath-histograms)
|
||||||
@ -186,13 +182,13 @@ One can still use generic algebras though.
|
|||||||
* ### [kmath-kotlingrad](kmath-kotlingrad)
|
* ### [kmath-kotlingrad](kmath-kotlingrad)
|
||||||
>
|
>
|
||||||
>
|
>
|
||||||
> **Maturity**: EXPERIMENTAL
|
> **Maturity**: PROTOTYPE
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
* ### [kmath-memory](kmath-memory)
|
* ### [kmath-memory](kmath-memory)
|
||||||
>
|
> An API and basic implementation for arranging objects in a continous memory block.
|
||||||
>
|
>
|
||||||
> **Maturity**: EXPERIMENTAL
|
> **Maturity**: DEVELOPMENT
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
* ### [kmath-nd4j](kmath-nd4j)
|
* ### [kmath-nd4j](kmath-nd4j)
|
||||||
@ -216,7 +212,7 @@ One can still use generic algebras though.
|
|||||||
* ### [kmath-viktor](kmath-viktor)
|
* ### [kmath-viktor](kmath-viktor)
|
||||||
>
|
>
|
||||||
>
|
>
|
||||||
> **Maturity**: EXPERIMENTAL
|
> **Maturity**: DEVELOPMENT
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
|
|
||||||
@ -246,6 +242,7 @@ Release artifacts are accessible from bintray with following configuration (see
|
|||||||
```kotlin
|
```kotlin
|
||||||
repositories {
|
repositories {
|
||||||
maven("https://dl.bintray.com/mipt-npm/kscience")
|
maven("https://dl.bintray.com/mipt-npm/kscience")
|
||||||
|
// maven("https://dl.bintray.com/mipt-npm/dev") for dev versions
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
@ -35,10 +35,6 @@ readme {
|
|||||||
readmeTemplate = file("docs/templates/README-TEMPLATE.md")
|
readmeTemplate = file("docs/templates/README-TEMPLATE.md")
|
||||||
}
|
}
|
||||||
|
|
||||||
apiValidation {
|
|
||||||
validationDisabled = true
|
|
||||||
}
|
|
||||||
|
|
||||||
ksciencePublish {
|
ksciencePublish {
|
||||||
spaceRepo = "https://maven.pkg.jetbrains.space/mipt-npm/p/sci/maven"
|
spaceRepo = "https://maven.pkg.jetbrains.space/mipt-npm/p/sci/maven"
|
||||||
}
|
}
|
||||||
|
56
docs/templates/README-TEMPLATE.md
vendored
56
docs/templates/README-TEMPLATE.md
vendored
@ -9,7 +9,7 @@ Bintray-dev: [ ![Download](https://api.bintray.com/packages/mipt-npm/dev/kmat
|
|||||||
|
|
||||||
# KMath
|
# KMath
|
||||||
|
|
||||||
Could be pronounced as `key-math`. The Kotlin MATHematics library was initially intended as a Kotlin-based analog to
|
Could be pronounced as `key-math`. The **K**otlin **Math**ematics library was initially intended as a Kotlin-based analog to
|
||||||
Python's NumPy library. Later we found that kotlin is much more flexible language and allows superior architecture
|
Python's NumPy library. Later we found that kotlin is much more flexible language and allows superior architecture
|
||||||
designs. In contrast to `numpy` and `scipy` it is modular and has a lightweight core. The `numpy`-like experience could
|
designs. In contrast to `numpy` and `scipy` it is modular and has a lightweight core. The `numpy`-like experience could
|
||||||
be achieved with [kmath-for-real](/kmath-for-real) extension module.
|
be achieved with [kmath-for-real](/kmath-for-real) extension module.
|
||||||
@ -32,49 +32,46 @@ be achieved with [kmath-for-real](/kmath-for-real) extension module.
|
|||||||
* Provide the best performance out of the box. We have specialized libraries for that. Need only API wrappers for them.
|
* Provide the best performance out of the box. We have specialized libraries for that. Need only API wrappers for them.
|
||||||
* Cover all cases as immediately and in one bundle. We will modularize everything and add new features gradually.
|
* Cover all cases as immediately and in one bundle. We will modularize everything and add new features gradually.
|
||||||
* Provide specialized behavior in the core. API is made generic on purpose, so one needs to specialize for types, like
|
* Provide specialized behavior in the core. API is made generic on purpose, so one needs to specialize for types, like
|
||||||
for `Double` in the core. For that we will have specialization modules like `for-real`, which will give better
|
for `Double` in the core. For that we will have specialization modules like `kmath-for-real`, which will give better
|
||||||
experience for those, who want to work with specific types.
|
experience for those, who want to work with specific types.
|
||||||
|
|
||||||
## Features
|
## Features and stability
|
||||||
|
|
||||||
Current feature list is [here](/docs/features.md)
|
KMath is a modular library. Different modules provide different features with different API stability guarantees. All core modules are released with the same version, but with different API change policy. The features are described in module definitions below. The module stability could have following levels:
|
||||||
|
|
||||||
* **Algebra**
|
* **PROTOTYPE**. On this level there are no compatibility guarantees. All methods and classes form those modules could break any moment. You can still use it, but be sure to fix the specific version.
|
||||||
* Algebraic structures like rings, spaces and fields (**TODO** add example to wiki)
|
* **EXPERIMENTAL**. The general API is decided, but some changes could be made. Volatile API is marked with `@UnstableKmathAPI` or other stability warning annotations.
|
||||||
* Basic linear algebra operations (sums, products, etc.), backed by the `Space` API.
|
* **DEVELOPMENT**. API breaking genrally follows semantic versioning ideology. There could be changes in minor versions, but not in patch versions. API is protected with [binary-compatibility-validator](https://github.com/Kotlin/binary-compatibility-validator) tool.
|
||||||
* Complex numbers backed by the `Field` API (meaning they will be usable in any structure like vectors and
|
* **STABLE**. The API stabilized. Breaking changes are allowed only in major releases.
|
||||||
N-dimensional arrays).
|
|
||||||
* Advanced linear algebra operations like matrix inversion and LU decomposition.
|
|
||||||
|
|
||||||
* **Array-like structures** Full support of many-dimensional array-like structures
|
<!--Current feature list is [here](/docs/features.md)-->
|
||||||
including mixed arithmetic operations and function operations over arrays and numbers (with the added benefit of static type checking).
|
|
||||||
|
|
||||||
* **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.
|
|
||||||
|
|
||||||
* **Histograms** Fast multi-dimensional histograms.
|
<!--* **Array-like structures** Full support of many-dimensional array-like structures -->
|
||||||
|
<!--including mixed arithmetic operations and function operations over arrays and numbers (with the added benefit of static type checking).-->
|
||||||
|
|
||||||
* **Streaming** Streaming operations on mathematical objects and objects buffers.
|
<!--* **Histograms** Fast multi-dimensional histograms.-->
|
||||||
|
|
||||||
* **Type-safe dimensions** Type-safe dimensions for matrix operations.
|
<!--* **Streaming** Streaming operations on mathematical objects and objects buffers.-->
|
||||||
|
|
||||||
* **Commons-math wrapper** It is planned to gradually wrap most parts of
|
<!--* **Type-safe dimensions** Type-safe dimensions for matrix operations.-->
|
||||||
[Apache commons-math](http://commons.apache.org/proper/commons-math/) library in Kotlin code and maybe rewrite some
|
|
||||||
parts to better suit the Kotlin programming paradigm, however there is no established roadmap for that. Feel free to
|
|
||||||
submit a feature request if you want something to be implemented first.
|
|
||||||
|
|
||||||
## Planned features
|
|
||||||
|
|
||||||
* **Messaging** A mathematical notation to support multi-language and multi-node communication for mathematical tasks.
|
<!--* **Commons-math wrapper** It is planned to gradually wrap most parts of -->
|
||||||
|
<!--[Apache commons-math](http://commons.apache.org/proper/commons-math/) library in Kotlin code and maybe rewrite some -->
|
||||||
|
<!--parts to better suit the Kotlin programming paradigm, however there is no established roadmap for that. Feel free to -->
|
||||||
|
<!--submit a feature request if you want something to be implemented first.-->
|
||||||
|
<!-- -->
|
||||||
|
<!--## Planned features-->
|
||||||
|
|
||||||
* **Array statistics**
|
<!--* **Messaging** A mathematical notation to support multi-language and multi-node communication for mathematical tasks.-->
|
||||||
|
|
||||||
* **Integration** Univariate and multivariate integration framework.
|
<!--* **Array statistics** -->
|
||||||
|
|
||||||
* **Probability and distributions**
|
<!--* **Integration** Univariate and multivariate integration framework.-->
|
||||||
|
|
||||||
* **Fitting** Non-linear curve fitting facilities
|
<!--* **Probability and distributions**-->
|
||||||
|
|
||||||
|
<!--* **Fitting** Non-linear curve fitting facilities-->
|
||||||
|
|
||||||
## Modules
|
## Modules
|
||||||
|
|
||||||
@ -106,6 +103,7 @@ Release artifacts are accessible from bintray with following configuration (see
|
|||||||
```kotlin
|
```kotlin
|
||||||
repositories {
|
repositories {
|
||||||
maven("https://dl.bintray.com/mipt-npm/kscience")
|
maven("https://dl.bintray.com/mipt-npm/kscience")
|
||||||
|
// maven("https://dl.bintray.com/mipt-npm/dev") for dev versions
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
@ -88,3 +88,7 @@ kotlin.sourceSets.all {
|
|||||||
tasks.withType<KotlinCompile> {
|
tasks.withType<KotlinCompile> {
|
||||||
kotlinOptions.jvmTarget = "11"
|
kotlinOptions.jvmTarget = "11"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
readme{
|
||||||
|
maturity = ru.mipt.npm.gradle.Maturity.EXPERIMENTAL
|
||||||
|
}
|
||||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
@ -61,7 +61,7 @@ For example, the following builder:
|
|||||||
RealField.mstInField { symbol("x") + 2 }.compile()
|
RealField.mstInField { symbol("x") + 2 }.compile()
|
||||||
```
|
```
|
||||||
|
|
||||||
… leads to generation of bytecode, which can be decompiled to the following Java class:
|
… leads to generation of bytecode, which can be decompiled to the following Java class:
|
||||||
|
|
||||||
```java
|
```java
|
||||||
package kscience.kmath.asm.generated;
|
package kscience.kmath.asm.generated;
|
||||||
|
@ -11,3 +11,7 @@ dependencies {
|
|||||||
api(project(":kmath-functions"))
|
api(project(":kmath-functions"))
|
||||||
api("org.apache.commons:commons-math3:3.6.1")
|
api("org.apache.commons:commons-math3:3.6.1")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
readme{
|
||||||
|
maturity = ru.mipt.npm.gradle.Maturity.EXPERIMENTAL
|
||||||
|
}
|
@ -2,10 +2,13 @@
|
|||||||
|
|
||||||
The core features of KMath:
|
The core features of KMath:
|
||||||
|
|
||||||
- [algebras](src/commonMain/kotlin/kscience/kmath/operations/Algebra.kt) : Algebraic structures: contexts and elements
|
- [algebras](src/commonMain/kotlin/kscience/kmath/operations/Algebra.kt) : Algebraic structures like rings, spaces and fields.
|
||||||
- [nd](src/commonMain/kotlin/kscience/kmath/structures/NDStructure.kt) : Many-dimensional structures
|
- [nd](src/commonMain/kotlin/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.
|
||||||
- [buffers](src/commonMain/kotlin/kscience/kmath/structures/Buffers.kt) : One-dimensional structure
|
- [buffers](src/commonMain/kotlin/kscience/kmath/structures/Buffers.kt) : One-dimensional structure
|
||||||
- [expressions](src/commonMain/kotlin/kscience/kmath/expressions) : Functional Expressions
|
- [expressions](src/commonMain/kotlin/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.
|
||||||
- [domains](src/commonMain/kotlin/kscience/kmath/domains) : Domains
|
- [domains](src/commonMain/kotlin/kscience/kmath/domains) : Domains
|
||||||
- [autodif](src/commonMain/kotlin/kscience/kmath/expressions/SimpleAutoDiff.kt) : Automatic differentiation
|
- [autodif](src/commonMain/kotlin/kscience/kmath/expressions/SimpleAutoDiff.kt) : Automatic differentiation
|
||||||
|
|
||||||
|
3364
kmath-core/api/kmath-core.api
Normal file
3364
kmath-core/api/kmath-core.api
Normal file
File diff suppressed because it is too large
Load Diff
@ -26,16 +26,26 @@ readme {
|
|||||||
|
|
||||||
feature(
|
feature(
|
||||||
id = "algebras",
|
id = "algebras",
|
||||||
description = "Algebraic structures: contexts and elements",
|
description = """
|
||||||
|
Algebraic structures like rings, spaces and fields.
|
||||||
|
""".trimIndent(),
|
||||||
ref = "src/commonMain/kotlin/kscience/kmath/operations/Algebra.kt"
|
ref = "src/commonMain/kotlin/kscience/kmath/operations/Algebra.kt"
|
||||||
)
|
)
|
||||||
|
|
||||||
feature(
|
feature(
|
||||||
id = "nd",
|
id = "nd",
|
||||||
description = "Many-dimensional structures",
|
description = "Many-dimensional structures and operations on them.",
|
||||||
ref = "src/commonMain/kotlin/kscience/kmath/structures/NDStructure.kt"
|
ref = "src/commonMain/kotlin/kscience/kmath/structures/NDStructure.kt"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
feature(
|
||||||
|
id = "linear",
|
||||||
|
description = """
|
||||||
|
Basic linear algebra operations (sums, products, etc.), backed by the `Space` API. Advanced linear algebra operations like matrix inversion and LU decomposition.
|
||||||
|
""".trimIndent(),
|
||||||
|
ref = "src/commonMain/kotlin/kscience/kmath/operations/Algebra.kt"
|
||||||
|
)
|
||||||
|
|
||||||
feature(
|
feature(
|
||||||
id = "buffers",
|
id = "buffers",
|
||||||
description = "One-dimensional structure",
|
description = "One-dimensional structure",
|
||||||
@ -44,7 +54,11 @@ readme {
|
|||||||
|
|
||||||
feature(
|
feature(
|
||||||
id = "expressions",
|
id = "expressions",
|
||||||
description = "Functional Expressions",
|
description = """
|
||||||
|
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.
|
||||||
|
""".trimIndent(),
|
||||||
ref = "src/commonMain/kotlin/kscience/kmath/expressions"
|
ref = "src/commonMain/kotlin/kscience/kmath/expressions"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -17,3 +17,7 @@ kotlin.sourceSets {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
readme{
|
||||||
|
maturity = ru.mipt.npm.gradle.Maturity.EXPERIMENTAL
|
||||||
|
}
|
@ -6,3 +6,7 @@ dependencies {
|
|||||||
implementation("org.ejml:ejml-simple:0.39")
|
implementation("org.ejml:ejml-simple:0.39")
|
||||||
implementation(project(":kmath-core"))
|
implementation(project(":kmath-core"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
readme{
|
||||||
|
maturity = ru.mipt.npm.gradle.Maturity.PROTOTYPE
|
||||||
|
}
|
47
kmath-functions/README.md
Normal file
47
kmath-functions/README.md
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
# Functions (`kmath-functions`)
|
||||||
|
|
||||||
|
Functions and interpolations:
|
||||||
|
|
||||||
|
- [piecewise](Piecewise functions.) : src/commonMain/kotlin/kscience/kmath/functions/Piecewise.kt
|
||||||
|
- [polynomials](Polynomial functions.) : src/commonMain/kotlin/kscience/kmath/functions/Polynomial.kt
|
||||||
|
- [linear interpolation](Linear XY interpolator.) : src/commonMain/kotlin/kscience/kmath/interpolation/LinearInterpolator.kt
|
||||||
|
- [spline interpolation](Cubic spline XY interpolator.) : src/commonMain/kotlin/kscience/kmath/interpolation/SplineInterpolator.kt
|
||||||
|
|
||||||
|
|
||||||
|
> #### Artifact:
|
||||||
|
>
|
||||||
|
> This module artifact: `kscience.kmath:kmath-functions:0.2.0-dev-6`.
|
||||||
|
>
|
||||||
|
> 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 development version: [ ![Download](https://api.bintray.com/packages/mipt-npm/dev/kmath-functions/images/download.svg) ](https://bintray.com/mipt-npm/dev/kmath-functions/_latestVersion)
|
||||||
|
>
|
||||||
|
> **Gradle:**
|
||||||
|
>
|
||||||
|
> ```gradle
|
||||||
|
> repositories {
|
||||||
|
> maven { url "https://dl.bintray.com/kotlin/kotlin-eap" }
|
||||||
|
> maven { url 'https://dl.bintray.com/mipt-npm/kscience' }
|
||||||
|
> maven { url 'https://dl.bintray.com/mipt-npm/dev' }
|
||||||
|
> maven { url 'https://dl.bintray.com/hotkeytlt/maven' }
|
||||||
|
>
|
||||||
|
> }
|
||||||
|
>
|
||||||
|
> dependencies {
|
||||||
|
> implementation 'kscience.kmath:kmath-functions:0.2.0-dev-6'
|
||||||
|
> }
|
||||||
|
> ```
|
||||||
|
> **Gradle Kotlin DSL:**
|
||||||
|
>
|
||||||
|
> ```kotlin
|
||||||
|
> repositories {
|
||||||
|
> maven("https://dl.bintray.com/kotlin/kotlin-eap")
|
||||||
|
> maven("https://dl.bintray.com/mipt-npm/kscience")
|
||||||
|
> maven("https://dl.bintray.com/mipt-npm/dev")
|
||||||
|
> maven("https://dl.bintray.com/hotkeytlt/maven")
|
||||||
|
> }
|
||||||
|
>
|
||||||
|
> dependencies {
|
||||||
|
> implementation("kscience.kmath:kmath-functions:0.2.0-dev-6")
|
||||||
|
> }
|
||||||
|
> ```
|
@ -7,3 +7,14 @@ kotlin.sourceSets.commonMain {
|
|||||||
api(project(":kmath-core"))
|
api(project(":kmath-core"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
readme {
|
||||||
|
description = "Functions and interpolation"
|
||||||
|
maturity = ru.mipt.npm.gradle.Maturity.PROTOTYPE
|
||||||
|
propertyByTemplate("artifact", rootProject.file("docs/templates/ARTIFACT-TEMPLATE.md"))
|
||||||
|
|
||||||
|
feature("piecewise", "src/commonMain/kotlin/kscience/kmath/functions/Piecewise.kt", "Piecewise functions.")
|
||||||
|
feature("polynomials", "src/commonMain/kotlin/kscience/kmath/functions/Polynomial.kt", "Polynomial functions.")
|
||||||
|
feature("linear interpolation", "src/commonMain/kotlin/kscience/kmath/interpolation/LinearInterpolator.kt", "Linear XY interpolator.")
|
||||||
|
feature("spline interpolation", "src/commonMain/kotlin/kscience/kmath/interpolation/SplineInterpolator.kt", "Cubic spline XY interpolator.")
|
||||||
|
}
|
7
kmath-functions/docs/README-TEMPLATE.md
Normal file
7
kmath-functions/docs/README-TEMPLATE.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# Functions (`kmath-functions`)
|
||||||
|
|
||||||
|
Functions and interpolations:
|
||||||
|
|
||||||
|
${features}
|
||||||
|
|
||||||
|
${artifact}
|
@ -6,8 +6,7 @@ public fun interface Piecewise<T, R> {
|
|||||||
public fun findPiece(arg: T): R?
|
public fun findPiece(arg: T): R?
|
||||||
}
|
}
|
||||||
|
|
||||||
public fun interface PiecewisePolynomial<T : Any> :
|
public fun interface PiecewisePolynomial<T : Any> : Piecewise<T, Polynomial<T>>
|
||||||
Piecewise<T, Polynomial<T>>
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ordered list of pieces in piecewise function
|
* Ordered list of pieces in piecewise function
|
||||||
|
@ -5,3 +5,7 @@ kotlin.sourceSets.commonMain {
|
|||||||
api(project(":kmath-core"))
|
api(project(":kmath-core"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
readme{
|
||||||
|
maturity = ru.mipt.npm.gradle.Maturity.PROTOTYPE
|
||||||
|
}
|
||||||
|
@ -8,10 +8,10 @@ import kscience.kmath.operations.invoke
|
|||||||
import kscience.kmath.structures.*
|
import kscience.kmath.structures.*
|
||||||
import kotlin.math.floor
|
import kotlin.math.floor
|
||||||
|
|
||||||
public data class BinDef<T : Comparable<T>>(
|
public data class BinDefinition<T : Comparable<T>>(
|
||||||
public val space: SpaceOperations<Point<T>>,
|
public val space: SpaceOperations<Point<T>>,
|
||||||
public val center: Point<T>,
|
public val center: Point<T>,
|
||||||
public val sizes: Point<T>
|
public val sizes: Point<T>,
|
||||||
) {
|
) {
|
||||||
public fun contains(vector: Point<out T>): Boolean {
|
public fun contains(vector: Point<out T>): Boolean {
|
||||||
require(vector.size == center.size) { "Dimension mismatch for input vector. Expected ${center.size}, but found ${vector.size}" }
|
require(vector.size == center.size) { "Dimension mismatch for input vector. Expected ${center.size}, but found ${vector.size}" }
|
||||||
@ -22,14 +22,17 @@ public data class BinDef<T : Comparable<T>>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class MultivariateBin<T : Comparable<T>>(public val def: BinDef<T>, public override val value: Number) : Bin<T> {
|
public class MultivariateBin<T : Comparable<T>>(
|
||||||
|
public val definition: BinDefinition<T>,
|
||||||
|
public override val value: Number,
|
||||||
|
) : Bin<T> {
|
||||||
public override val dimension: Int
|
public override val dimension: Int
|
||||||
get() = def.center.size
|
get() = definition.center.size
|
||||||
|
|
||||||
public override val center: Point<T>
|
public override val center: Point<T>
|
||||||
get() = def.center
|
get() = definition.center
|
||||||
|
|
||||||
public override operator fun contains(point: Point<T>): Boolean = def.contains(point)
|
public override operator fun contains(point: Point<T>): Boolean = definition.contains(point)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -38,11 +41,11 @@ public class MultivariateBin<T : Comparable<T>>(public val def: BinDef<T>, publi
|
|||||||
public class RealHistogram(
|
public class RealHistogram(
|
||||||
private val lower: Buffer<Double>,
|
private val lower: Buffer<Double>,
|
||||||
private val upper: Buffer<Double>,
|
private val upper: Buffer<Double>,
|
||||||
private val binNums: IntArray = IntArray(lower.size) { 20 }
|
private val binNums: IntArray = IntArray(lower.size) { 20 },
|
||||||
) : MutableHistogram<Double, MultivariateBin<Double>> {
|
) : MutableHistogram<Double, MultivariateBin<Double>> {
|
||||||
private val strides = DefaultStrides(IntArray(binNums.size) { binNums[it] + 2 })
|
private val strides = DefaultStrides(IntArray(binNums.size) { binNums[it] + 2 })
|
||||||
private val values: NDStructure<LongCounter> = NDStructure.auto(strides) { LongCounter() }
|
private val counts: NDStructure<LongCounter> = NDStructure.auto(strides) { LongCounter() }
|
||||||
private val weights: NDStructure<DoubleCounter> = NDStructure.auto(strides) { DoubleCounter() }
|
private val values: NDStructure<DoubleCounter> = NDStructure.auto(strides) { DoubleCounter() }
|
||||||
public override val dimension: Int get() = lower.size
|
public override val dimension: Int get() = lower.size
|
||||||
private val binSize = RealBuffer(dimension) { (upper[it] - lower[it]) / binNums[it] }
|
private val binSize = RealBuffer(dimension) { (upper[it] - lower[it]) / binNums[it] }
|
||||||
|
|
||||||
@ -65,11 +68,11 @@ public class RealHistogram(
|
|||||||
|
|
||||||
private fun getIndex(point: Buffer<out Double>): IntArray = IntArray(dimension) { getIndex(it, point[it]) }
|
private fun getIndex(point: Buffer<out Double>): IntArray = IntArray(dimension) { getIndex(it, point[it]) }
|
||||||
|
|
||||||
private fun getValue(index: IntArray): Long = values[index].sum()
|
private fun getValue(index: IntArray): Long = counts[index].sum()
|
||||||
|
|
||||||
public fun getValue(point: Buffer<out Double>): Long = getValue(getIndex(point))
|
public fun getValue(point: Buffer<out Double>): Long = getValue(getIndex(point))
|
||||||
|
|
||||||
private fun getDef(index: IntArray): BinDef<Double> {
|
private fun getBinDefinition(index: IntArray): BinDefinition<Double> {
|
||||||
val center = index.mapIndexed { axis, i ->
|
val center = index.mapIndexed { axis, i ->
|
||||||
when (i) {
|
when (i) {
|
||||||
0 -> Double.NEGATIVE_INFINITY
|
0 -> Double.NEGATIVE_INFINITY
|
||||||
@ -78,14 +81,14 @@ public class RealHistogram(
|
|||||||
}
|
}
|
||||||
}.asBuffer()
|
}.asBuffer()
|
||||||
|
|
||||||
return BinDef(RealBufferFieldOperations, center, binSize)
|
return BinDefinition(RealBufferFieldOperations, center, binSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
public fun getDef(point: Buffer<out Double>): BinDef<Double> = getDef(getIndex(point))
|
public fun getBinDefinition(point: Buffer<out Double>): BinDefinition<Double> = getBinDefinition(getIndex(point))
|
||||||
|
|
||||||
public override operator fun get(point: Buffer<out Double>): MultivariateBin<Double>? {
|
public override operator fun get(point: Buffer<out Double>): MultivariateBin<Double>? {
|
||||||
val index = getIndex(point)
|
val index = getIndex(point)
|
||||||
return MultivariateBin(getDef(index), getValue(index))
|
return MultivariateBin(getBinDefinition(index), getValue(index))
|
||||||
}
|
}
|
||||||
|
|
||||||
// fun put(point: Point<out Double>){
|
// fun put(point: Point<out Double>){
|
||||||
@ -95,23 +98,24 @@ public class RealHistogram(
|
|||||||
|
|
||||||
public override fun putWithWeight(point: Buffer<out Double>, weight: Double) {
|
public override fun putWithWeight(point: Buffer<out Double>, weight: Double) {
|
||||||
val index = getIndex(point)
|
val index = getIndex(point)
|
||||||
values[index].increment()
|
counts[index].increment()
|
||||||
weights[index].add(weight)
|
values[index].add(weight)
|
||||||
}
|
}
|
||||||
|
|
||||||
public override operator fun iterator(): Iterator<MultivariateBin<Double>> =
|
public override operator fun iterator(): Iterator<MultivariateBin<Double>> =
|
||||||
weights.elements().map { (index, value) -> MultivariateBin(getDef(index), value.sum()) }
|
values.elements().map { (index, value) ->
|
||||||
.iterator()
|
MultivariateBin(getBinDefinition(index), value.sum())
|
||||||
|
}.iterator()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert this histogram into NDStructure containing bin values but not bin descriptions
|
* NDStructure containing number of events in bins without weights
|
||||||
*/
|
*/
|
||||||
public fun values(): NDStructure<Number> = NDStructure.auto(values.shape) { values[it].sum() }
|
public fun counts(): NDStructure<Long> = NDStructure.auto(counts.shape) { counts[it].sum() }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sum of weights
|
* NDStructure containing values of bins including weights
|
||||||
*/
|
*/
|
||||||
public fun weights(): NDStructure<Double> = NDStructure.auto(weights.shape) { weights[it].sum() }
|
public fun values(): NDStructure<Double> = NDStructure.auto(values.shape) { values[it].sum() }
|
||||||
|
|
||||||
public companion object {
|
public companion object {
|
||||||
/**
|
/**
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
package kscience.kmath.histogram
|
package kscience.kmath.histogram
|
||||||
|
|
||||||
import kscience.kmath.linear.Point
|
import kscience.kmath.linear.Point
|
||||||
|
import kscience.kmath.misc.UnstableKMathAPI
|
||||||
import kscience.kmath.structures.Buffer
|
import kscience.kmath.structures.Buffer
|
||||||
import kscience.kmath.structures.asBuffer
|
import kscience.kmath.structures.asBuffer
|
||||||
|
import kscience.kmath.structures.asSequence
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import kotlin.math.floor
|
import kotlin.math.floor
|
||||||
|
|
||||||
@ -11,29 +13,36 @@ import kotlin.math.floor
|
|||||||
public class UnivariateBin(
|
public class UnivariateBin(
|
||||||
public val position: Double,
|
public val position: Double,
|
||||||
public val size: Double,
|
public val size: Double,
|
||||||
public val counter: LongCounter = LongCounter(),
|
|
||||||
) : Bin<Double> {
|
) : Bin<Double> {
|
||||||
//TODO add weighting
|
//internal mutation operations
|
||||||
public override val value: Number get() = counter.sum()
|
internal val counter: LongCounter = LongCounter()
|
||||||
|
internal val weightCounter: DoubleCounter = DoubleCounter()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The precise number of events ignoring weighting
|
||||||
|
*/
|
||||||
|
public val count: Long get() = counter.sum()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value of histogram including weighting
|
||||||
|
*/
|
||||||
|
public override val value: Double get() = weightCounter.sum()
|
||||||
|
|
||||||
public override val center: Point<Double> get() = doubleArrayOf(position).asBuffer()
|
public override val center: Point<Double> get() = doubleArrayOf(position).asBuffer()
|
||||||
public override val dimension: Int get() = 1
|
public override val dimension: Int get() = 1
|
||||||
|
|
||||||
public operator fun contains(value: Double): Boolean = value in (position - size / 2)..(position + size / 2)
|
public operator fun contains(value: Double): Boolean = value in (position - size / 2)..(position + size / 2)
|
||||||
public override fun contains(point: Buffer<Double>): Boolean = contains(point[0])
|
public override fun contains(point: Buffer<Double>): Boolean = contains(point[0])
|
||||||
internal operator fun inc(): UnivariateBin = this.also { counter.increment() }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Univariate histogram with log(n) bin search speed
|
* Univariate histogram with log(n) bin search speed
|
||||||
*/
|
*/
|
||||||
public class UnivariateHistogram private constructor(
|
public abstract class UnivariateHistogram(
|
||||||
private val factory: (Double) -> UnivariateBin,
|
protected val bins: TreeMap<Double, UnivariateBin> = TreeMap(),
|
||||||
) : MutableHistogram<Double, UnivariateBin> {
|
) : Histogram<Double, UnivariateBin> {
|
||||||
|
|
||||||
private val bins: TreeMap<Double, UnivariateBin> = TreeMap()
|
public operator fun get(value: Double): UnivariateBin? {
|
||||||
|
|
||||||
private operator fun get(value: Double): UnivariateBin? {
|
|
||||||
// check ceiling entry and return it if it is what needed
|
// check ceiling entry and return it if it is what needed
|
||||||
val ceil = bins.ceilingEntry(value)?.value
|
val ceil = bins.ceilingEntry(value)?.value
|
||||||
if (ceil != null && value in ceil) return ceil
|
if (ceil != null && value in ceil) return ceil
|
||||||
@ -44,38 +53,38 @@ public class UnivariateHistogram private constructor(
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createBin(value: Double): UnivariateBin = factory(value).also {
|
|
||||||
synchronized(this) { bins[it.position] = it }
|
|
||||||
}
|
|
||||||
|
|
||||||
public override operator fun get(point: Buffer<out Double>): UnivariateBin? = get(point[0])
|
public override operator fun get(point: Buffer<out Double>): UnivariateBin? = get(point[0])
|
||||||
|
|
||||||
public override val dimension: Int get() = 1
|
public override val dimension: Int get() = 1
|
||||||
|
|
||||||
public override operator fun iterator(): Iterator<UnivariateBin> = bins.values.iterator()
|
public override operator fun iterator(): Iterator<UnivariateBin> = bins.values.iterator()
|
||||||
|
|
||||||
/**
|
|
||||||
* Thread safe put operation
|
|
||||||
*/
|
|
||||||
public fun put(value: Double) {
|
|
||||||
(get(value) ?: createBin(value)).inc()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun putWithWeight(point: Buffer<out Double>, weight: Double) {
|
|
||||||
if (weight != 1.0) TODO("Implement weighting")
|
|
||||||
put(point[0])
|
|
||||||
}
|
|
||||||
|
|
||||||
public companion object {
|
public companion object {
|
||||||
public fun uniform(binSize: Double, start: Double = 0.0): UnivariateHistogram = UnivariateHistogram { value ->
|
/**
|
||||||
val center = start + binSize * floor((value - start) / binSize + 0.5)
|
* Build a histogram with a uniform binning with a start at [start] and a bin size of [binSize]
|
||||||
UnivariateBin(center, binSize)
|
*/
|
||||||
}
|
public fun uniformBuilder(binSize: Double, start: Double = 0.0): UnivariateHistogramBuilder =
|
||||||
|
UnivariateHistogramBuilder { value ->
|
||||||
|
val center = start + binSize * floor((value - start) / binSize + 0.5)
|
||||||
|
UnivariateBin(center, binSize)
|
||||||
|
}
|
||||||
|
|
||||||
public fun custom(borders: DoubleArray): UnivariateHistogram {
|
/**
|
||||||
|
* Build and fill a [UnivariateHistogram]. Returns a read-only histogram.
|
||||||
|
*/
|
||||||
|
public fun uniform(
|
||||||
|
binSize: Double,
|
||||||
|
start: Double = 0.0,
|
||||||
|
builder: UnivariateHistogramBuilder.() -> Unit,
|
||||||
|
): UnivariateHistogram = uniformBuilder(binSize, start).apply(builder)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a histogram with custom cell borders
|
||||||
|
*/
|
||||||
|
public fun customBuilder(borders: DoubleArray): UnivariateHistogramBuilder {
|
||||||
val sorted = borders.sortedArray()
|
val sorted = borders.sortedArray()
|
||||||
|
|
||||||
return UnivariateHistogram { value ->
|
return UnivariateHistogramBuilder { value ->
|
||||||
when {
|
when {
|
||||||
value < sorted.first() -> UnivariateBin(
|
value < sorted.first() -> UnivariateBin(
|
||||||
Double.NEGATIVE_INFINITY,
|
Double.NEGATIVE_INFINITY,
|
||||||
@ -96,7 +105,55 @@ public class UnivariateHistogram private constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build and fill a histogram with custom borders. Returns a read-only histogram.
|
||||||
|
*/
|
||||||
|
public fun custom(
|
||||||
|
borders: DoubleArray,
|
||||||
|
builder: UnivariateHistogramBuilder.() -> Unit,
|
||||||
|
): UnivariateHistogram = customBuilder(borders).apply(builder)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public fun UnivariateHistogram.fill(sequence: Iterable<Double>): Unit = sequence.forEach(::put)
|
public class UnivariateHistogramBuilder(
|
||||||
|
private val factory: (Double) -> UnivariateBin,
|
||||||
|
) : UnivariateHistogram(), MutableHistogram<Double, UnivariateBin> {
|
||||||
|
|
||||||
|
private fun createBin(value: Double): UnivariateBin = factory(value).also {
|
||||||
|
synchronized(this) { bins[it.position] = it }
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Thread safe put operation
|
||||||
|
*/
|
||||||
|
public fun put(value: Double, weight: Double = 1.0) {
|
||||||
|
(get(value) ?: createBin(value)).apply{
|
||||||
|
counter.increment()
|
||||||
|
weightCounter.add(weight)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun putWithWeight(point: Buffer<out Double>, weight: Double) {
|
||||||
|
put(point[0], weight)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Put several items into a single bin
|
||||||
|
*/
|
||||||
|
public fun putMany(value: Double, count: Int, weight: Double = count.toDouble()){
|
||||||
|
(get(value) ?: createBin(value)).apply{
|
||||||
|
counter.add(count.toLong())
|
||||||
|
weightCounter.add(weight)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@UnstableKMathAPI
|
||||||
|
public fun UnivariateHistogramBuilder.fill(items: Iterable<Double>): Unit = items.forEach(::put)
|
||||||
|
|
||||||
|
@UnstableKMathAPI
|
||||||
|
public fun UnivariateHistogramBuilder.fill(array: DoubleArray): Unit = array.forEach(::put)
|
||||||
|
|
||||||
|
@UnstableKMathAPI
|
||||||
|
public fun UnivariateHistogramBuilder.fill(buffer: Buffer<Double>): Unit = buffer.asSequence().forEach(::put)
|
@ -7,3 +7,7 @@ dependencies {
|
|||||||
implementation("com.github.breandan:kotlingrad:0.4.0")
|
implementation("com.github.breandan:kotlingrad:0.4.0")
|
||||||
api(project(":kmath-ast"))
|
api(project(":kmath-ast"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
readme{
|
||||||
|
maturity = ru.mipt.npm.gradle.Maturity.PROTOTYPE
|
||||||
|
}
|
72
kmath-memory/api/kmath-memory.api
Normal file
72
kmath-memory/api/kmath-memory.api
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
public final class kscience/kmath/memory/ByteBufferMemory : kscience/kmath/memory/Memory {
|
||||||
|
public fun <init> (Ljava/nio/ByteBuffer;II)V
|
||||||
|
public synthetic fun <init> (Ljava/nio/ByteBuffer;IIILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||||
|
public fun copy ()Lkscience/kmath/memory/Memory;
|
||||||
|
public final fun getBuffer ()Ljava/nio/ByteBuffer;
|
||||||
|
public fun getSize ()I
|
||||||
|
public final fun getStartOffset ()I
|
||||||
|
public fun reader ()Lkscience/kmath/memory/MemoryReader;
|
||||||
|
public fun view (II)Lkscience/kmath/memory/Memory;
|
||||||
|
public fun writer ()Lkscience/kmath/memory/MemoryWriter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final class kscience/kmath/memory/ByteBufferMemoryKt {
|
||||||
|
public static final fun allocate (Lkscience/kmath/memory/Memory$Companion;I)Lkscience/kmath/memory/Memory;
|
||||||
|
public static final fun asMemory (Ljava/nio/ByteBuffer;II)Lkscience/kmath/memory/Memory;
|
||||||
|
public static synthetic fun asMemory$default (Ljava/nio/ByteBuffer;IIILjava/lang/Object;)Lkscience/kmath/memory/Memory;
|
||||||
|
public static final fun readAsMemory (Ljava/nio/file/Path;JJLkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||||
|
public static synthetic fun readAsMemory$default (Ljava/nio/file/Path;JJLkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public static final fun wrap (Lkscience/kmath/memory/Memory$Companion;[B)Lkscience/kmath/memory/Memory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract interface class kscience/kmath/memory/Memory {
|
||||||
|
public static final field Companion Lkscience/kmath/memory/Memory$Companion;
|
||||||
|
public abstract fun copy ()Lkscience/kmath/memory/Memory;
|
||||||
|
public abstract fun getSize ()I
|
||||||
|
public abstract fun reader ()Lkscience/kmath/memory/MemoryReader;
|
||||||
|
public abstract fun view (II)Lkscience/kmath/memory/Memory;
|
||||||
|
public abstract fun writer ()Lkscience/kmath/memory/MemoryWriter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final class kscience/kmath/memory/Memory$Companion {
|
||||||
|
}
|
||||||
|
|
||||||
|
public final class kscience/kmath/memory/MemoryKt {
|
||||||
|
public static final fun read (Lkscience/kmath/memory/Memory;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||||
|
public static final fun write (Lkscience/kmath/memory/Memory;Lkotlin/jvm/functions/Function1;)V
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract interface class kscience/kmath/memory/MemoryReader {
|
||||||
|
public abstract fun getMemory ()Lkscience/kmath/memory/Memory;
|
||||||
|
public abstract fun readByte (I)B
|
||||||
|
public abstract fun readDouble (I)D
|
||||||
|
public abstract fun readFloat (I)F
|
||||||
|
public abstract fun readInt (I)I
|
||||||
|
public abstract fun readLong (I)J
|
||||||
|
public abstract fun readShort (I)S
|
||||||
|
public abstract fun release ()V
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract interface class kscience/kmath/memory/MemorySpec {
|
||||||
|
public abstract fun getObjectSize ()I
|
||||||
|
public abstract fun read (Lkscience/kmath/memory/MemoryReader;I)Ljava/lang/Object;
|
||||||
|
public abstract fun write (Lkscience/kmath/memory/MemoryWriter;ILjava/lang/Object;)V
|
||||||
|
}
|
||||||
|
|
||||||
|
public final class kscience/kmath/memory/MemorySpecKt {
|
||||||
|
public static final fun read (Lkscience/kmath/memory/MemoryReader;Lkscience/kmath/memory/MemorySpec;I)Ljava/lang/Object;
|
||||||
|
public static final fun write (Lkscience/kmath/memory/MemoryWriter;Lkscience/kmath/memory/MemorySpec;ILjava/lang/Object;)V
|
||||||
|
public static final fun writeArray (Lkscience/kmath/memory/MemoryWriter;Lkscience/kmath/memory/MemorySpec;I[Ljava/lang/Object;)V
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract interface class kscience/kmath/memory/MemoryWriter {
|
||||||
|
public abstract fun getMemory ()Lkscience/kmath/memory/Memory;
|
||||||
|
public abstract fun release ()V
|
||||||
|
public abstract fun writeByte (IB)V
|
||||||
|
public abstract fun writeDouble (ID)V
|
||||||
|
public abstract fun writeFloat (IF)V
|
||||||
|
public abstract fun writeInt (II)V
|
||||||
|
public abstract fun writeLong (IJ)V
|
||||||
|
public abstract fun writeShort (IS)V
|
||||||
|
}
|
||||||
|
|
@ -2,3 +2,10 @@ plugins {
|
|||||||
id("ru.mipt.npm.mpp")
|
id("ru.mipt.npm.mpp")
|
||||||
id("ru.mipt.npm.native")
|
id("ru.mipt.npm.native")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
readme{
|
||||||
|
description = """
|
||||||
|
An API and basic implementation for arranging objects in a continous memory block.
|
||||||
|
""".trimIndent()
|
||||||
|
maturity = ru.mipt.npm.gradle.Maturity.DEVELOPMENT
|
||||||
|
}
|
@ -23,3 +23,7 @@ kotlin.sourceSets {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
readme{
|
||||||
|
maturity = ru.mipt.npm.gradle.Maturity.EXPERIMENTAL
|
||||||
|
}
|
189
kmath-viktor/api/kmath-viktor.api
Normal file
189
kmath-viktor/api/kmath-viktor.api
Normal file
@ -0,0 +1,189 @@
|
|||||||
|
public final class kscience/kmath/viktor/ViktorBuffer : kscience/kmath/structures/MutableBuffer {
|
||||||
|
public static final synthetic fun box-impl (Lorg/jetbrains/bio/viktor/F64FlatArray;)Lkscience/kmath/viktor/ViktorBuffer;
|
||||||
|
public static fun constructor-impl (Lorg/jetbrains/bio/viktor/F64FlatArray;)Lorg/jetbrains/bio/viktor/F64FlatArray;
|
||||||
|
public fun contentEquals (Lkscience/kmath/structures/Buffer;)Z
|
||||||
|
public static fun contentEquals-impl (Lorg/jetbrains/bio/viktor/F64FlatArray;Lkscience/kmath/structures/Buffer;)Z
|
||||||
|
public fun copy ()Lkscience/kmath/structures/MutableBuffer;
|
||||||
|
public static fun copy-impl (Lorg/jetbrains/bio/viktor/F64FlatArray;)Lkscience/kmath/structures/MutableBuffer;
|
||||||
|
public fun equals (Ljava/lang/Object;)Z
|
||||||
|
public static fun equals-impl (Lorg/jetbrains/bio/viktor/F64FlatArray;Ljava/lang/Object;)Z
|
||||||
|
public static final fun equals-impl0 (Lorg/jetbrains/bio/viktor/F64FlatArray;Lorg/jetbrains/bio/viktor/F64FlatArray;)Z
|
||||||
|
public fun get (I)Ljava/lang/Double;
|
||||||
|
public synthetic fun get (I)Ljava/lang/Object;
|
||||||
|
public static fun get-impl (Lorg/jetbrains/bio/viktor/F64FlatArray;I)Ljava/lang/Double;
|
||||||
|
public final fun getFlatArray ()Lorg/jetbrains/bio/viktor/F64FlatArray;
|
||||||
|
public fun getSize ()I
|
||||||
|
public static fun getSize-impl (Lorg/jetbrains/bio/viktor/F64FlatArray;)I
|
||||||
|
public fun hashCode ()I
|
||||||
|
public static fun hashCode-impl (Lorg/jetbrains/bio/viktor/F64FlatArray;)I
|
||||||
|
public fun iterator ()Ljava/util/Iterator;
|
||||||
|
public static fun iterator-impl (Lorg/jetbrains/bio/viktor/F64FlatArray;)Ljava/util/Iterator;
|
||||||
|
public fun set (ID)V
|
||||||
|
public synthetic fun set (ILjava/lang/Object;)V
|
||||||
|
public static fun set-impl (Lorg/jetbrains/bio/viktor/F64FlatArray;ID)V
|
||||||
|
public fun toString ()Ljava/lang/String;
|
||||||
|
public static fun toString-impl (Lorg/jetbrains/bio/viktor/F64FlatArray;)Ljava/lang/String;
|
||||||
|
public final synthetic fun unbox-impl ()Lorg/jetbrains/bio/viktor/F64FlatArray;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final class kscience/kmath/viktor/ViktorNDField : kscience/kmath/nd/NDField, kscience/kmath/operations/ExtendedField, kscience/kmath/operations/RingWithNumbers {
|
||||||
|
public fun <init> ([I)V
|
||||||
|
public synthetic fun acos (Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public fun acos-02gLDOA (Lkscience/kmath/nd/NDStructure;)Lorg/jetbrains/bio/viktor/F64Array;
|
||||||
|
public synthetic fun acosh (Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public fun acosh (Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public synthetic fun add (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public synthetic fun add (Lkscience/kmath/nd/NDStructure;Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public fun add-frQ_39w (Lkscience/kmath/nd/NDStructure;Lkscience/kmath/nd/NDStructure;)Lorg/jetbrains/bio/viktor/F64Array;
|
||||||
|
public synthetic fun asin (Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public fun asin-02gLDOA (Lkscience/kmath/nd/NDStructure;)Lorg/jetbrains/bio/viktor/F64Array;
|
||||||
|
public synthetic fun asinh (Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public fun asinh (Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public synthetic fun atan (Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public fun atan-02gLDOA (Lkscience/kmath/nd/NDStructure;)Lorg/jetbrains/bio/viktor/F64Array;
|
||||||
|
public synthetic fun atanh (Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public fun atanh (Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public synthetic fun binaryOperation (Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public fun binaryOperation (Ljava/lang/String;Lkscience/kmath/nd/NDStructure;Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public fun binaryOperationFunction (Ljava/lang/String;)Lkotlin/jvm/functions/Function2;
|
||||||
|
public synthetic fun combine (Lkscience/kmath/nd/NDStructure;Lkscience/kmath/nd/NDStructure;Lkotlin/jvm/functions/Function3;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public fun combine-C8Lp-Ak (Lkscience/kmath/nd/NDStructure;Lkscience/kmath/nd/NDStructure;Lkotlin/jvm/functions/Function3;)Lorg/jetbrains/bio/viktor/F64Array;
|
||||||
|
public synthetic fun cos (Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public fun cos-02gLDOA (Lkscience/kmath/nd/NDStructure;)Lorg/jetbrains/bio/viktor/F64Array;
|
||||||
|
public synthetic fun cosh (Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public fun cosh (Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public fun div (DLkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public synthetic fun div (Ljava/lang/Number;Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public fun div (Ljava/lang/Number;Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public synthetic fun div (Ljava/lang/Object;Ljava/lang/Number;)Ljava/lang/Object;
|
||||||
|
public synthetic fun div (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public synthetic fun div (Ljava/lang/Object;Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public fun div (Lkscience/kmath/nd/NDStructure;D)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public fun div (Lkscience/kmath/nd/NDStructure;Ljava/lang/Number;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public synthetic fun div (Lkscience/kmath/nd/NDStructure;Ljava/lang/Object;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public fun div (Lkscience/kmath/nd/NDStructure;Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public synthetic fun divide (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public fun divide (Lkscience/kmath/nd/NDStructure;Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public synthetic fun exp (Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public fun exp-02gLDOA (Lkscience/kmath/nd/NDStructure;)Lorg/jetbrains/bio/viktor/F64Array;
|
||||||
|
public synthetic fun getElementContext ()Ljava/lang/Object;
|
||||||
|
public fun getElementContext ()Lkscience/kmath/operations/RealField;
|
||||||
|
public final fun getF64Buffer (Lkscience/kmath/nd/NDStructure;)Lorg/jetbrains/bio/viktor/F64Array;
|
||||||
|
public synthetic fun getOne ()Ljava/lang/Object;
|
||||||
|
public fun getOne-hHuhEO0 ()Lorg/jetbrains/bio/viktor/F64Array;
|
||||||
|
public fun getShape ()[I
|
||||||
|
public synthetic fun getZero ()Ljava/lang/Object;
|
||||||
|
public fun getZero-hHuhEO0 ()Lorg/jetbrains/bio/viktor/F64Array;
|
||||||
|
public fun invoke (Lkotlin/jvm/functions/Function1;Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public synthetic fun leftSideNumberOperation (Ljava/lang/String;Ljava/lang/Number;Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public fun leftSideNumberOperation (Ljava/lang/String;Ljava/lang/Number;Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public fun leftSideNumberOperationFunction (Ljava/lang/String;)Lkotlin/jvm/functions/Function2;
|
||||||
|
public synthetic fun ln (Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public fun ln-02gLDOA (Lkscience/kmath/nd/NDStructure;)Lorg/jetbrains/bio/viktor/F64Array;
|
||||||
|
public synthetic fun map (Lkscience/kmath/nd/NDStructure;Lkotlin/jvm/functions/Function2;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public fun map-frQ_39w (Lkscience/kmath/nd/NDStructure;Lkotlin/jvm/functions/Function2;)Lorg/jetbrains/bio/viktor/F64Array;
|
||||||
|
public synthetic fun mapIndexed (Lkscience/kmath/nd/NDStructure;Lkotlin/jvm/functions/Function3;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public fun mapIndexed-frQ_39w (Lkscience/kmath/nd/NDStructure;Lkotlin/jvm/functions/Function3;)Lorg/jetbrains/bio/viktor/F64Array;
|
||||||
|
public fun minus (DLkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public synthetic fun minus (Ljava/lang/Number;Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public fun minus (Ljava/lang/Number;Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public synthetic fun minus (Ljava/lang/Object;Ljava/lang/Number;)Ljava/lang/Object;
|
||||||
|
public synthetic fun minus (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public synthetic fun minus (Ljava/lang/Object;Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public fun minus (Lkscience/kmath/nd/NDStructure;D)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public fun minus (Lkscience/kmath/nd/NDStructure;Ljava/lang/Number;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public synthetic fun minus (Lkscience/kmath/nd/NDStructure;Ljava/lang/Object;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public synthetic fun minus (Lkscience/kmath/nd/NDStructure;Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public fun minus-frQ_39w (Lkscience/kmath/nd/NDStructure;Lkscience/kmath/nd/NDStructure;)Lorg/jetbrains/bio/viktor/F64Array;
|
||||||
|
public synthetic fun multiply (Ljava/lang/Object;Ljava/lang/Number;)Ljava/lang/Object;
|
||||||
|
public synthetic fun multiply (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public synthetic fun multiply (Lkscience/kmath/nd/NDStructure;Ljava/lang/Number;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public fun multiply (Lkscience/kmath/nd/NDStructure;Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public fun multiply-frQ_39w (Lkscience/kmath/nd/NDStructure;Ljava/lang/Number;)Lorg/jetbrains/bio/viktor/F64Array;
|
||||||
|
public synthetic fun number (Ljava/lang/Number;)Ljava/lang/Object;
|
||||||
|
public fun number-02gLDOA (Ljava/lang/Number;)Lorg/jetbrains/bio/viktor/F64Array;
|
||||||
|
public fun plus (DLkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public synthetic fun plus (Ljava/lang/Number;Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public fun plus (Ljava/lang/Number;Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public synthetic fun plus (Ljava/lang/Object;Ljava/lang/Number;)Ljava/lang/Object;
|
||||||
|
public synthetic fun plus (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public synthetic fun plus (Ljava/lang/Object;Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public fun plus (Lkscience/kmath/nd/NDStructure;Ljava/lang/Number;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public synthetic fun plus (Lkscience/kmath/nd/NDStructure;Ljava/lang/Object;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public synthetic fun plus (Lkscience/kmath/nd/NDStructure;Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public fun plus-frQ_39w (Lkscience/kmath/nd/NDStructure;D)Lorg/jetbrains/bio/viktor/F64Array;
|
||||||
|
public fun plus-frQ_39w (Lkscience/kmath/nd/NDStructure;Lkscience/kmath/nd/NDStructure;)Lorg/jetbrains/bio/viktor/F64Array;
|
||||||
|
public synthetic fun pow (Ljava/lang/Object;Ljava/lang/Number;)Ljava/lang/Object;
|
||||||
|
public fun pow (Lkscience/kmath/nd/NDStructure;Ljava/lang/Number;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public synthetic fun power (Ljava/lang/Object;Ljava/lang/Number;)Ljava/lang/Object;
|
||||||
|
public fun power-frQ_39w (Lkscience/kmath/nd/NDStructure;Ljava/lang/Number;)Lorg/jetbrains/bio/viktor/F64Array;
|
||||||
|
public synthetic fun produce (Lkotlin/jvm/functions/Function2;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public fun produce-02gLDOA (Lkotlin/jvm/functions/Function2;)Lorg/jetbrains/bio/viktor/F64Array;
|
||||||
|
public synthetic fun rightSideNumberOperation (Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Number;)Ljava/lang/Object;
|
||||||
|
public fun rightSideNumberOperation (Ljava/lang/String;Lkscience/kmath/nd/NDStructure;Ljava/lang/Number;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public fun rightSideNumberOperationFunction (Ljava/lang/String;)Lkotlin/jvm/functions/Function2;
|
||||||
|
public synthetic fun sin (Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public fun sin-02gLDOA (Lkscience/kmath/nd/NDStructure;)Lorg/jetbrains/bio/viktor/F64Array;
|
||||||
|
public synthetic fun sinh (Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public fun sinh (Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public synthetic fun sqrt (Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public fun sqrt (Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public synthetic fun symbol (Ljava/lang/String;)Ljava/lang/Object;
|
||||||
|
public fun symbol (Ljava/lang/String;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public synthetic fun tan (Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public fun tan (Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public synthetic fun tanh (Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public fun tanh (Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public fun times (DLkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public synthetic fun times (Ljava/lang/Number;Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public fun times (Ljava/lang/Number;Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public synthetic fun times (Ljava/lang/Object;Ljava/lang/Number;)Ljava/lang/Object;
|
||||||
|
public synthetic fun times (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public synthetic fun times (Ljava/lang/Object;Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public fun times (Lkscience/kmath/nd/NDStructure;D)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public synthetic fun times (Lkscience/kmath/nd/NDStructure;Ljava/lang/Number;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public synthetic fun times (Lkscience/kmath/nd/NDStructure;Ljava/lang/Object;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public fun times (Lkscience/kmath/nd/NDStructure;Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public fun times-frQ_39w (Lkscience/kmath/nd/NDStructure;Ljava/lang/Number;)Lorg/jetbrains/bio/viktor/F64Array;
|
||||||
|
public synthetic fun unaryMinus (Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public fun unaryMinus (Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public synthetic fun unaryOperation (Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public fun unaryOperation (Ljava/lang/String;Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
public fun unaryOperationFunction (Ljava/lang/String;)Lkotlin/jvm/functions/Function1;
|
||||||
|
public synthetic fun unaryPlus (Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
|
public fun unaryPlus (Lkscience/kmath/nd/NDStructure;)Lkscience/kmath/nd/NDStructure;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final class kscience/kmath/viktor/ViktorNDStructure : kscience/kmath/nd/MutableNDStructure {
|
||||||
|
public static final synthetic fun box-impl (Lorg/jetbrains/bio/viktor/F64Array;)Lkscience/kmath/viktor/ViktorNDStructure;
|
||||||
|
public static fun constructor-impl (Lorg/jetbrains/bio/viktor/F64Array;)Lorg/jetbrains/bio/viktor/F64Array;
|
||||||
|
public fun elements ()Lkotlin/sequences/Sequence;
|
||||||
|
public static fun elements-impl (Lorg/jetbrains/bio/viktor/F64Array;)Lkotlin/sequences/Sequence;
|
||||||
|
public fun equals (Ljava/lang/Object;)Z
|
||||||
|
public static fun equals-impl (Lorg/jetbrains/bio/viktor/F64Array;Ljava/lang/Object;)Z
|
||||||
|
public static final fun equals-impl0 (Lorg/jetbrains/bio/viktor/F64Array;Lorg/jetbrains/bio/viktor/F64Array;)Z
|
||||||
|
public fun get ([I)Ljava/lang/Double;
|
||||||
|
public synthetic fun get ([I)Ljava/lang/Object;
|
||||||
|
public static fun get-impl (Lorg/jetbrains/bio/viktor/F64Array;[I)Ljava/lang/Double;
|
||||||
|
public fun getDimension ()I
|
||||||
|
public static fun getDimension-impl (Lorg/jetbrains/bio/viktor/F64Array;)I
|
||||||
|
public final fun getF64Buffer ()Lorg/jetbrains/bio/viktor/F64Array;
|
||||||
|
public fun getFeature (Lkotlin/reflect/KClass;)Ljava/lang/Object;
|
||||||
|
public static fun getFeature-impl (Lorg/jetbrains/bio/viktor/F64Array;Lkotlin/reflect/KClass;)Ljava/lang/Object;
|
||||||
|
public fun getShape ()[I
|
||||||
|
public static fun getShape-impl (Lorg/jetbrains/bio/viktor/F64Array;)[I
|
||||||
|
public fun hashCode ()I
|
||||||
|
public static fun hashCode-impl (Lorg/jetbrains/bio/viktor/F64Array;)I
|
||||||
|
public fun set ([ID)V
|
||||||
|
public synthetic fun set ([ILjava/lang/Object;)V
|
||||||
|
public static fun set-impl (Lorg/jetbrains/bio/viktor/F64Array;[ID)V
|
||||||
|
public fun toString ()Ljava/lang/String;
|
||||||
|
public static fun toString-impl (Lorg/jetbrains/bio/viktor/F64Array;)Ljava/lang/String;
|
||||||
|
public final synthetic fun unbox-impl ()Lorg/jetbrains/bio/viktor/F64Array;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final class kscience/kmath/viktor/ViktorNDStructureKt {
|
||||||
|
public static final fun ViktorNDField ([I)Lkscience/kmath/viktor/ViktorNDField;
|
||||||
|
public static final fun asStructure (Lorg/jetbrains/bio/viktor/F64Array;)Lorg/jetbrains/bio/viktor/F64Array;
|
||||||
|
}
|
||||||
|
|
@ -8,3 +8,7 @@ dependencies {
|
|||||||
api(project(":kmath-core"))
|
api(project(":kmath-core"))
|
||||||
api("org.jetbrains.bio:viktor:1.0.1")
|
api("org.jetbrains.bio:viktor:1.0.1")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
readme{
|
||||||
|
maturity = ru.mipt.npm.gradle.Maturity.DEVELOPMENT
|
||||||
|
}
|
@ -8,7 +8,7 @@ pluginManagement {
|
|||||||
maven("https://dl.bintray.com/kotlin/kotlinx")
|
maven("https://dl.bintray.com/kotlin/kotlinx")
|
||||||
}
|
}
|
||||||
|
|
||||||
val toolsVersion = "0.7.3-1.4.30-RC"
|
val toolsVersion = "0.7.4"
|
||||||
val kotlinVersion = "1.4.30-RC"
|
val kotlinVersion = "1.4.30-RC"
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
|
Loading…
Reference in New Issue
Block a user