forked from kscience/kmath
Merge histograms
This commit is contained in:
parent
c6ea423bd6
commit
209e17cd42
19
docs/templates/ARTIFACT-TEMPLATE.md
vendored
19
docs/templates/ARTIFACT-TEMPLATE.md
vendored
@ -10,11 +10,12 @@
|
|||||||
>
|
>
|
||||||
> ```gradle
|
> ```gradle
|
||||||
> repositories {
|
> repositories {
|
||||||
> maven { url "https://dl.bintray.com/kotlin/kotlin-eap" }
|
> maven { url 'https://repo.kotlin.link' }
|
||||||
> 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' }
|
> maven { url 'https://dl.bintray.com/hotkeytlt/maven' }
|
||||||
>
|
> 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 {
|
||||||
@ -25,10 +26,12 @@
|
|||||||
>
|
>
|
||||||
> ```kotlin
|
> ```kotlin
|
||||||
> repositories {
|
> repositories {
|
||||||
> maven("https://dl.bintray.com/kotlin/kotlin-eap")
|
> maven("https://repo.kotlin.link")
|
||||||
> maven("https://dl.bintray.com/mipt-npm/kscience")
|
> maven("https://dl.bintray.com/kotlin/kotlin-eap") // include for builds based on kotlin-eap
|
||||||
> maven("https://dl.bintray.com/mipt-npm/dev")
|
> maven("https://dl.bintray.com/hotkeytlt/maven") // required for a
|
||||||
> maven("https://dl.bintray.com/hotkeytlt/maven")
|
>// 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 {
|
||||||
|
@ -12,7 +12,7 @@ This subproject implements the following features:
|
|||||||
|
|
||||||
> #### Artifact:
|
> #### Artifact:
|
||||||
>
|
>
|
||||||
> This module artifact: `kscience.kmath:kmath-ast:0.2.0-dev-7`.
|
> This module artifact: `space.kscience:kmath-ast:0.2.0-dev-7`.
|
||||||
>
|
>
|
||||||
> 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)
|
||||||
>
|
>
|
||||||
@ -22,29 +22,32 @@ This subproject implements the following features:
|
|||||||
>
|
>
|
||||||
> ```gradle
|
> ```gradle
|
||||||
> repositories {
|
> repositories {
|
||||||
> maven { url "https://dl.bintray.com/kotlin/kotlin-eap" }
|
> maven { url 'https://repo.kotlin.link' }
|
||||||
> 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' }
|
> maven { url 'https://dl.bintray.com/hotkeytlt/maven' }
|
||||||
>
|
> 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 'kscience.kmath:kmath-ast:0.2.0-dev-7'
|
> implementation 'space.kscience:kmath-ast:0.2.0-dev-7'
|
||||||
> }
|
> }
|
||||||
> ```
|
> ```
|
||||||
> **Gradle Kotlin DSL:**
|
> **Gradle Kotlin DSL:**
|
||||||
>
|
>
|
||||||
> ```kotlin
|
> ```kotlin
|
||||||
> repositories {
|
> repositories {
|
||||||
> maven("https://dl.bintray.com/kotlin/kotlin-eap")
|
> maven("https://repo.kotlin.link")
|
||||||
> maven("https://dl.bintray.com/mipt-npm/kscience")
|
> maven("https://dl.bintray.com/kotlin/kotlin-eap") // include for builds based on kotlin-eap
|
||||||
> maven("https://dl.bintray.com/mipt-npm/dev")
|
> maven("https://dl.bintray.com/hotkeytlt/maven") // required for a
|
||||||
> maven("https://dl.bintray.com/hotkeytlt/maven")
|
>// 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("kscience.kmath:kmath-ast:0.2.0-dev-7")
|
> implementation("space.kscience:kmath-ast:0.2.0-dev-7")
|
||||||
> }
|
> }
|
||||||
> ```
|
> ```
|
||||||
|
|
||||||
@ -61,10 +64,10 @@ 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 space.kscience.kmath.asm.generated;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import kotlin.jvm.functions.Function2;
|
import kotlin.jvm.functions.Function2;
|
||||||
|
@ -22,7 +22,7 @@ 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 space.kscience.kmath.asm.generated;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import kotlin.jvm.functions.Function2;
|
import kotlin.jvm.functions.Function2;
|
||||||
|
@ -8,7 +8,7 @@ Complex and hypercomplex number systems in KMath:
|
|||||||
|
|
||||||
> #### Artifact:
|
> #### Artifact:
|
||||||
>
|
>
|
||||||
> This module artifact: `kscience.kmath:kmath-complex:0.2.0-dev-7`.
|
> This module artifact: `space.kscience:kmath-complex:0.2.0-dev-7`.
|
||||||
>
|
>
|
||||||
> 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)
|
||||||
>
|
>
|
||||||
@ -18,28 +18,31 @@ Complex and hypercomplex number systems in KMath:
|
|||||||
>
|
>
|
||||||
> ```gradle
|
> ```gradle
|
||||||
> repositories {
|
> repositories {
|
||||||
> maven { url "https://dl.bintray.com/kotlin/kotlin-eap" }
|
> maven { url 'https://repo.kotlin.link' }
|
||||||
> 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' }
|
> maven { url 'https://dl.bintray.com/hotkeytlt/maven' }
|
||||||
>
|
> 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 'kscience.kmath:kmath-complex:0.2.0-dev-7'
|
> implementation 'space.kscience:kmath-complex:0.2.0-dev-7'
|
||||||
> }
|
> }
|
||||||
> ```
|
> ```
|
||||||
> **Gradle Kotlin DSL:**
|
> **Gradle Kotlin DSL:**
|
||||||
>
|
>
|
||||||
> ```kotlin
|
> ```kotlin
|
||||||
> repositories {
|
> repositories {
|
||||||
> maven("https://dl.bintray.com/kotlin/kotlin-eap")
|
> maven("https://repo.kotlin.link")
|
||||||
> maven("https://dl.bintray.com/mipt-npm/kscience")
|
> maven("https://dl.bintray.com/kotlin/kotlin-eap") // include for builds based on kotlin-eap
|
||||||
> maven("https://dl.bintray.com/mipt-npm/dev")
|
> maven("https://dl.bintray.com/hotkeytlt/maven") // required for a
|
||||||
> maven("https://dl.bintray.com/hotkeytlt/maven")
|
>// 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("kscience.kmath:kmath-complex:0.2.0-dev-7")
|
> implementation("space.kscience:kmath-complex:0.2.0-dev-7")
|
||||||
> }
|
> }
|
||||||
> ```
|
> ```
|
||||||
|
@ -15,7 +15,7 @@ performance calculations to code generation.
|
|||||||
|
|
||||||
> #### Artifact:
|
> #### Artifact:
|
||||||
>
|
>
|
||||||
> This module artifact: `kscience.kmath:kmath-core:0.2.0-dev-7`.
|
> This module artifact: `space.kscience:kmath-core:0.2.0-dev-7`.
|
||||||
>
|
>
|
||||||
> 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)
|
||||||
>
|
>
|
||||||
@ -25,28 +25,31 @@ performance calculations to code generation.
|
|||||||
>
|
>
|
||||||
> ```gradle
|
> ```gradle
|
||||||
> repositories {
|
> repositories {
|
||||||
> maven { url "https://dl.bintray.com/kotlin/kotlin-eap" }
|
> maven { url 'https://repo.kotlin.link' }
|
||||||
> 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' }
|
> maven { url 'https://dl.bintray.com/hotkeytlt/maven' }
|
||||||
>
|
> 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 'kscience.kmath:kmath-core:0.2.0-dev-7'
|
> implementation 'space.kscience:kmath-core:0.2.0-dev-7'
|
||||||
> }
|
> }
|
||||||
> ```
|
> ```
|
||||||
> **Gradle Kotlin DSL:**
|
> **Gradle Kotlin DSL:**
|
||||||
>
|
>
|
||||||
> ```kotlin
|
> ```kotlin
|
||||||
> repositories {
|
> repositories {
|
||||||
> maven("https://dl.bintray.com/kotlin/kotlin-eap")
|
> maven("https://repo.kotlin.link")
|
||||||
> maven("https://dl.bintray.com/mipt-npm/kscience")
|
> maven("https://dl.bintray.com/kotlin/kotlin-eap") // include for builds based on kotlin-eap
|
||||||
> maven("https://dl.bintray.com/mipt-npm/dev")
|
> maven("https://dl.bintray.com/hotkeytlt/maven") // required for a
|
||||||
> maven("https://dl.bintray.com/hotkeytlt/maven")
|
>// 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("kscience.kmath:kmath-core:0.2.0-dev-7")
|
> implementation("space.kscience:kmath-core:0.2.0-dev-7")
|
||||||
> }
|
> }
|
||||||
> ```
|
> ```
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -13,12 +13,12 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package kscience.kmath.domains
|
package space.kscience.kmath.domains
|
||||||
|
|
||||||
import kscience.kmath.linear.Point
|
import space.kscience.kmath.linear.Point
|
||||||
import kscience.kmath.structures.Buffer
|
import space.kscience.kmath.structures.Buffer
|
||||||
import kscience.kmath.structures.RealBuffer
|
import space.kscience.kmath.structures.RealBuffer
|
||||||
import kscience.kmath.structures.indices
|
import space.kscience.kmath.structures.indices
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
> #### Artifact:
|
> #### Artifact:
|
||||||
>
|
>
|
||||||
> This module artifact: `kscience.kmath:kmath-for-real:0.2.0-dev-7`.
|
> This module artifact: `space.kscience:kmath-for-real:0.2.0-dev-7`.
|
||||||
>
|
>
|
||||||
> 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)
|
||||||
>
|
>
|
||||||
@ -17,28 +17,31 @@
|
|||||||
>
|
>
|
||||||
> ```gradle
|
> ```gradle
|
||||||
> repositories {
|
> repositories {
|
||||||
> maven { url "https://dl.bintray.com/kotlin/kotlin-eap" }
|
> maven { url 'https://repo.kotlin.link' }
|
||||||
> 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' }
|
> maven { url 'https://dl.bintray.com/hotkeytlt/maven' }
|
||||||
>
|
> 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 'kscience.kmath:kmath-for-real:0.2.0-dev-7'
|
> implementation 'space.kscience:kmath-for-real:0.2.0-dev-7'
|
||||||
> }
|
> }
|
||||||
> ```
|
> ```
|
||||||
> **Gradle Kotlin DSL:**
|
> **Gradle Kotlin DSL:**
|
||||||
>
|
>
|
||||||
> ```kotlin
|
> ```kotlin
|
||||||
> repositories {
|
> repositories {
|
||||||
> maven("https://dl.bintray.com/kotlin/kotlin-eap")
|
> maven("https://repo.kotlin.link")
|
||||||
> maven("https://dl.bintray.com/mipt-npm/kscience")
|
> maven("https://dl.bintray.com/kotlin/kotlin-eap") // include for builds based on kotlin-eap
|
||||||
> maven("https://dl.bintray.com/mipt-npm/dev")
|
> maven("https://dl.bintray.com/hotkeytlt/maven") // required for a
|
||||||
> maven("https://dl.bintray.com/hotkeytlt/maven")
|
>// 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("kscience.kmath:kmath-for-real:0.2.0-dev-7")
|
> implementation("space.kscience:kmath-for-real:0.2.0-dev-7")
|
||||||
> }
|
> }
|
||||||
> ```
|
> ```
|
||||||
|
@ -10,7 +10,7 @@ Functions and interpolations:
|
|||||||
|
|
||||||
> #### Artifact:
|
> #### Artifact:
|
||||||
>
|
>
|
||||||
> This module artifact: `kscience.kmath:kmath-functions:0.2.0-dev-7`.
|
> This module artifact: `space.kscience:kmath-functions:0.2.0-dev-7`.
|
||||||
>
|
>
|
||||||
> 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)
|
||||||
>
|
>
|
||||||
@ -20,28 +20,31 @@ Functions and interpolations:
|
|||||||
>
|
>
|
||||||
> ```gradle
|
> ```gradle
|
||||||
> repositories {
|
> repositories {
|
||||||
> maven { url "https://dl.bintray.com/kotlin/kotlin-eap" }
|
> maven { url 'https://repo.kotlin.link' }
|
||||||
> 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' }
|
> maven { url 'https://dl.bintray.com/hotkeytlt/maven' }
|
||||||
>
|
> 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 'kscience.kmath:kmath-functions:0.2.0-dev-7'
|
> implementation 'space.kscience:kmath-functions:0.2.0-dev-7'
|
||||||
> }
|
> }
|
||||||
> ```
|
> ```
|
||||||
> **Gradle Kotlin DSL:**
|
> **Gradle Kotlin DSL:**
|
||||||
>
|
>
|
||||||
> ```kotlin
|
> ```kotlin
|
||||||
> repositories {
|
> repositories {
|
||||||
> maven("https://dl.bintray.com/kotlin/kotlin-eap")
|
> maven("https://repo.kotlin.link")
|
||||||
> maven("https://dl.bintray.com/mipt-npm/kscience")
|
> maven("https://dl.bintray.com/kotlin/kotlin-eap") // include for builds based on kotlin-eap
|
||||||
> maven("https://dl.bintray.com/mipt-npm/dev")
|
> maven("https://dl.bintray.com/hotkeytlt/maven") // required for a
|
||||||
> maven("https://dl.bintray.com/hotkeytlt/maven")
|
>// 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("kscience.kmath:kmath-functions:0.2.0-dev-7")
|
> implementation("space.kscience:kmath-functions:0.2.0-dev-7")
|
||||||
> }
|
> }
|
||||||
> ```
|
> ```
|
||||||
|
@ -2,8 +2,8 @@ package space.kscience.kmath.histogram
|
|||||||
|
|
||||||
import kotlinx.atomicfu.atomic
|
import kotlinx.atomicfu.atomic
|
||||||
import kotlinx.atomicfu.getAndUpdate
|
import kotlinx.atomicfu.getAndUpdate
|
||||||
import kscience.kmath.operations.RealField
|
import space.kscience.kmath.operations.RealField
|
||||||
import kscience.kmath.operations.Space
|
import space.kscience.kmath.operations.Space
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Common representation for atomic counters
|
* Common representation for atomic counters
|
@ -1,14 +1,14 @@
|
|||||||
package kscience.kmath.histogram
|
package space.kscience.kmath.histogram
|
||||||
|
|
||||||
import kscience.kmath.domains.Domain
|
import space.kscience.kmath.domains.Domain
|
||||||
import kscience.kmath.linear.Point
|
import space.kscience.kmath.linear.Point
|
||||||
import kscience.kmath.misc.UnstableKMathAPI
|
import space.kscience.kmath.misc.UnstableKMathAPI
|
||||||
import kscience.kmath.nd.NDSpace
|
import space.kscience.kmath.nd.NDSpace
|
||||||
import kscience.kmath.nd.NDStructure
|
import space.kscience.kmath.nd.NDStructure
|
||||||
import kscience.kmath.nd.Strides
|
import space.kscience.kmath.nd.Strides
|
||||||
import kscience.kmath.operations.Space
|
import space.kscience.kmath.operations.Space
|
||||||
import kscience.kmath.operations.SpaceElement
|
import space.kscience.kmath.operations.SpaceElement
|
||||||
import kscience.kmath.operations.invoke
|
import space.kscience.kmath.operations.invoke
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A simple histogram bin based on domain
|
* A simple histogram bin based on domain
|
@ -1,9 +1,9 @@
|
|||||||
package kscience.kmath.histogram
|
package space.kscience.kmath.histogram
|
||||||
|
|
||||||
import kscience.kmath.domains.Domain
|
import space.kscience.kmath.domains.Domain
|
||||||
import kscience.kmath.domains.HyperSquareDomain
|
import space.kscience.kmath.domains.HyperSquareDomain
|
||||||
import kscience.kmath.nd.*
|
import space.kscience.kmath.nd.*
|
||||||
import kscience.kmath.structures.*
|
import space.kscience.kmath.structures.*
|
||||||
import kotlin.math.floor
|
import kotlin.math.floor
|
||||||
|
|
||||||
public class RealHistogramSpace(
|
public class RealHistogramSpace(
|
@ -1,10 +1,8 @@
|
|||||||
package scietifik.kmath.histogram
|
package space.kscience.kmath.histogram
|
||||||
|
|
||||||
import kscience.kmath.histogram.RealHistogramSpace
|
import space.kscience.kmath.operations.invoke
|
||||||
import kscience.kmath.histogram.put
|
import space.kscience.kmath.real.RealVector
|
||||||
import kscience.kmath.operations.invoke
|
import space.kscience.kmath.real.invoke
|
||||||
import kscience.kmath.real.RealVector
|
|
||||||
import kscience.kmath.real.invoke
|
|
||||||
import kotlin.random.Random
|
import kotlin.random.Random
|
||||||
import kotlin.test.*
|
import kotlin.test.*
|
||||||
|
|
||||||
@ -46,7 +44,7 @@ internal class MultivariateHistogramTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testHistogramAlgebra() {
|
fun testHistogramAlgebra() {
|
||||||
val hSpace = RealHistogramSpace.fromRanges(
|
RealHistogramSpace.fromRanges(
|
||||||
(-1.0..1.0),
|
(-1.0..1.0),
|
||||||
(-1.0..1.0),
|
(-1.0..1.0),
|
||||||
(-1.0..1.0)
|
(-1.0..1.0)
|
@ -1,11 +1,12 @@
|
|||||||
package kscience.kmath.histogram
|
package space.kscience.kmath.histogram
|
||||||
|
|
||||||
import kscience.kmath.domains.UnivariateDomain
|
import space.kscience.kmath.domains.UnivariateDomain
|
||||||
import kscience.kmath.misc.UnstableKMathAPI
|
import space.kscience.kmath.misc.UnstableKMathAPI
|
||||||
import kscience.kmath.operations.Space
|
import space.kscience.kmath.operations.Space
|
||||||
import kscience.kmath.structures.Buffer
|
import space.kscience.kmath.structures.Buffer
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import kotlin.math.abs
|
import kotlin.math.abs
|
||||||
|
import kotlin.math.floor
|
||||||
import kotlin.math.sqrt
|
import kotlin.math.sqrt
|
||||||
|
|
||||||
private fun <B : ClosedFloatingPointRange<Double>> TreeMap<Double, B>.getBin(value: Double): B? {
|
private fun <B : ClosedFloatingPointRange<Double>> TreeMap<Double, B>.getBin(value: Double): B? {
|
||||||
@ -68,7 +69,7 @@ public class TreeHistogramSpace(
|
|||||||
}
|
}
|
||||||
hBuilder.apply(builder)
|
hBuilder.apply(builder)
|
||||||
val resBins = TreeMap<Double, UnivariateBin>()
|
val resBins = TreeMap<Double, UnivariateBin>()
|
||||||
bins.forEach { key, binCounter ->
|
bins.forEach { (key, binCounter) ->
|
||||||
val count = binCounter.counter.value
|
val count = binCounter.counter.value
|
||||||
resBins[key] = UnivariateBin(binCounter.domain, count, sqrt(count))
|
resBins[key] = UnivariateBin(binCounter.domain, count, sqrt(count))
|
||||||
}
|
}
|
||||||
@ -122,7 +123,7 @@ public class TreeHistogramSpace(
|
|||||||
binSize: Double,
|
binSize: Double,
|
||||||
start: Double = 0.0,
|
start: Double = 0.0,
|
||||||
): TreeHistogramSpace = TreeHistogramSpace { value ->
|
): TreeHistogramSpace = TreeHistogramSpace { value ->
|
||||||
val center = start + binSize * Math.floor((value - start) / binSize + 0.5)
|
val center = start + binSize * floor((value - start) / binSize + 0.5)
|
||||||
UnivariateDomain((center - binSize / 2)..(center + binSize / 2))
|
UnivariateDomain((center - binSize / 2)..(center + binSize / 2))
|
||||||
}
|
}
|
||||||
|
|
@ -1,11 +1,11 @@
|
|||||||
package kscience.kmath.histogram
|
package space.kscience.kmath.histogram
|
||||||
|
|
||||||
import kscience.kmath.domains.UnivariateDomain
|
import space.kscience.kmath.domains.UnivariateDomain
|
||||||
import kscience.kmath.misc.UnstableKMathAPI
|
import space.kscience.kmath.misc.UnstableKMathAPI
|
||||||
import kscience.kmath.operations.Space
|
import space.kscience.kmath.operations.Space
|
||||||
import kscience.kmath.operations.SpaceElement
|
import space.kscience.kmath.operations.SpaceElement
|
||||||
import kscience.kmath.structures.Buffer
|
import space.kscience.kmath.structures.Buffer
|
||||||
import kscience.kmath.structures.asSequence
|
import space.kscience.kmath.structures.asSequence
|
||||||
|
|
||||||
|
|
||||||
public val UnivariateDomain.center: Double get() = (range.endInclusive - range.start) / 2
|
public val UnivariateDomain.center: Double get() = (range.endInclusive - range.start) / 2
|
||||||
|
@ -9,7 +9,7 @@ This subproject implements the following features:
|
|||||||
|
|
||||||
> #### Artifact:
|
> #### Artifact:
|
||||||
>
|
>
|
||||||
> This module artifact: `kscience.kmath:kmath-nd4j:0.2.0-dev-7`.
|
> This module artifact: `space.kscience:kmath-nd4j:0.2.0-dev-7`.
|
||||||
>
|
>
|
||||||
> 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)
|
||||||
>
|
>
|
||||||
@ -19,29 +19,32 @@ This subproject implements the following features:
|
|||||||
>
|
>
|
||||||
> ```gradle
|
> ```gradle
|
||||||
> repositories {
|
> repositories {
|
||||||
> maven { url "https://dl.bintray.com/kotlin/kotlin-eap" }
|
> maven { url 'https://repo.kotlin.link' }
|
||||||
> 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' }
|
> maven { url 'https://dl.bintray.com/hotkeytlt/maven' }
|
||||||
>
|
> 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 'kscience.kmath:kmath-nd4j:0.2.0-dev-7'
|
> implementation 'space.kscience:kmath-nd4j:0.2.0-dev-7'
|
||||||
> }
|
> }
|
||||||
> ```
|
> ```
|
||||||
> **Gradle Kotlin DSL:**
|
> **Gradle Kotlin DSL:**
|
||||||
>
|
>
|
||||||
> ```kotlin
|
> ```kotlin
|
||||||
> repositories {
|
> repositories {
|
||||||
> maven("https://dl.bintray.com/kotlin/kotlin-eap")
|
> maven("https://repo.kotlin.link")
|
||||||
> maven("https://dl.bintray.com/mipt-npm/kscience")
|
> maven("https://dl.bintray.com/kotlin/kotlin-eap") // include for builds based on kotlin-eap
|
||||||
> maven("https://dl.bintray.com/mipt-npm/dev")
|
> maven("https://dl.bintray.com/hotkeytlt/maven") // required for a
|
||||||
> maven("https://dl.bintray.com/hotkeytlt/maven")
|
>// 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("kscience.kmath:kmath-nd4j:0.2.0-dev-7")
|
> implementation("space.kscience:kmath-nd4j:0.2.0-dev-7")
|
||||||
> }
|
> }
|
||||||
> ```
|
> ```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user