Dev #194

Merged
altavir merged 266 commits from dev into master 2021-01-20 17:32:32 +03:00
3 changed files with 11 additions and 3 deletions
Showing only changes of commit 367a59461d - Show all commits

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
}
/**