Merge remote-tracking branch 'origin/dev' into nd4j

This commit is contained in:
Iaroslav Postovalov 2020-09-09 22:36:49 +07:00
commit 367a59461d
No known key found for this signature in database
GPG Key ID: 70D5F4DCB0972F1B
3 changed files with 11 additions and 3 deletions

View File

@ -11,6 +11,11 @@ Bintray-dev: [ ![Download](https://api.bintray.com/packages/mipt-npm/dev/kmat
Could be pronounced as `key-math`.
The Kotlin MATHematics library is intended as a Kotlin-based analog to Python's `numpy` library. In contrast to `numpy` and `scipy` it is modular and has a lightweight core.
## Publications
* [A conceptual article about context-oriented design](https://proandroiddev.com/an-introduction-context-oriented-programming-in-kotlin-2e79d316b0a2)
* [Another article about context-oriented design](https://proandroiddev.com/diving-deeper-into-context-oriented-programming-in-kotlin-3ecb4ec38814)
* [ACAT 2019 conference paper](https://aip.scitation.org/doi/abs/10.1063/1.5130103)
# Goal
* Provide a flexible and powerful API to work with mathematics abstractions in Kotlin-multiplatform (JVM and JS for now and Native in future).
* Provide basic multiplatform implementations for those abstractions (without significant performance optimization).

View File

@ -1,4 +1,4 @@
# The Core Module (`kmath-ast`)
# The Core Module (`kmath-core`)
The core features of KMath:

View File

@ -83,9 +83,12 @@ interface MemoryReader {
/**
* Uses the memory for read then releases the reader.
*/
inline fun Memory.read(block: MemoryReader.() -> Unit) {
inline fun <R> Memory.read(block: MemoryReader.() -> R): R {
contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) }
reader().apply(block).release()
val reader = reader()
val result = reader.block()
reader.release()
return result
}
/**