Kotlin mathematics extensions library
Go to file
2018-12-26 12:56:43 +03:00
doc A general idea of context-oriented approach in doc 2018-12-26 12:56:43 +03:00
kmath-core Matrix and linear algebra redone 2018-12-24 15:19:35 +03:00
kmath-coroutines Lazy structures, structure is no longer iterable, removed copy on read-only buffers. 2018-12-11 17:25:55 +03:00
kmath-io Lazy structures, structure is no longer iterable, removed copy on read-only buffers. 2018-12-11 17:25:55 +03:00
kmath-jmh Lazy structures, structure is no longer iterable, removed copy on read-only buffers. 2018-12-11 17:25:55 +03:00
.gitignore Quick AIDA port 2018-10-26 20:14:07 +03:00
build.gradle.kts Matrix and linear algebra redone 2018-12-24 15:19:35 +03:00
LICENSE Initial commit 2018-04-14 08:52:49 +03:00
README.md Lazy structures, structure is no longer iterable, removed copy on read-only buffers. 2018-12-11 17:25:55 +03:00
settings.gradle.kts Lazy structures, structure is no longer iterable, removed copy on read-only buffers. 2018-12-11 17:25:55 +03:00

KMath

Kotlin MATHematics library is intended as a kotlin based analog of numpy python library. Contrary to numpy and scipy it is modular and has a lightweight core.

Features

  • Algebra

    • Mathematical operation entities like rings, spaces and fields with (TODO add example to wiki)
    • Basic linear algebra operations (summs products, etc) backed by Space API.
    • Complex numbers backed by Field API (meaning that they will be useable in any structures like vectors and NDArrays).
    • [In progress] advanced linear algebra operations like matrix inversions.
  • Array-like structures Full support of numpy-like ndarray including mixed arithmetic operations and function operations on arrays and numbers just like it works in python (with benefit of static type checking).

  • Expressions Expressions are one of the ultimate goals of kmath. It is planned to be able to write some mathematical expression once an then apply it to different types of objects by providing different context. Exception could be used for a wide variety of purposes from high performance calculations to code generation.

Planned features

  • Common mathematics It is planned to gradually wrap most parts of Apache commons-math library in kotlin code and maybe rewrite some parts to better suite kotlin programming paradigm. There is no fixed priority list for that. Feel free to submit a future request if you want something to be done first.

  • Messaging A mathematical notation to support multi-language and multi-node communication for mathematical tasks.

Multi-platform support

KMath is developed as a multi-platform library, which means that most of interfaces are declared in common module. Implementation is also done in common module wherever it is possible. In some cases features are delegated to platform even if they could be done in common module because of platform performance optimization. Currently the main focus of development is the JVM platform, contribution of implementations for Kotlin - Native and Kotlin - JS is welcome.

Performance

The calculation performance is one of major goals of KMath in the future, but in some cases it is not possible to achieve both performance and flexibility. We expect to firstly focus on creating convenient universal API and then work on increasing performance for specific cases. We expect the worst KMath performance still be better than natural python, but worse than optimized native/scipy (mostly due to boxing operations on primitive numbers). The best performance of optimized parts should be better than scipy.

Releases

The project is currently in pre-release stage. Nightly builds could be used by adding additional repository to (groovy) gradle config:

repositories {
    maven { url = "http://npm.mipt.ru:8081/artifactory/gradle-dev" }
    mavenCentral()
} 

or for kotlin gradle dsl:

repositories {
    maven { setUrl("http://npm.mipt.ru:8081/artifactory/gradle-dev") }
    mavenCentral()
} 

Then use regular dependency like

compile(group: 'scientifik', name: 'kmath-core', version: '0.0.1-SNAPSHOT')

or in kotlin

compile(group = "scientifik", name = "kmath-core", version = "0.0.1-SNAPSHOT")

Work builds could be obtained with .

Contributing

The project requires a lot of additional work. Please fill free to contribute in any way and propose new features.