forked from kscience/kmath
Merge remote-tracking branch 'origin/dev' into nd4j
This commit is contained in:
commit
367a59461d
@ -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).
|
||||
|
@ -1,4 +1,4 @@
|
||||
# The Core Module (`kmath-ast`)
|
||||
# The Core Module (`kmath-core`)
|
||||
|
||||
The core features of KMath:
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user