Kotlin mathematics extensions library

Overview

JetBrains Research DOI Gradle build Maven Central Space

KMath

Could be pronounced as key-math. The Kotlin Mathematics library was initially intended as a Kotlin-based analog to Python's NumPy library. Later we found that kotlin is much more flexible language and allows superior architecture designs. In contrast to numpy and scipy it is modular and has a lightweight core. The numpy-like experience could be achieved with kmath-for-real extension module.

Documentation site (WIP)

Publications and talks

Goal

  • Provide a flexible and powerful API to work with mathematics abstractions in Kotlin-multiplatform (JVM, JS and Native) .
  • Provide basic multiplatform implementations for those abstractions (without significant performance optimization).
  • Provide bindings and wrappers with those abstractions for popular optimized platform libraries.

Non-goals

  • Be like NumPy. It was the idea at the beginning, but we decided that we can do better in API.
  • Provide the best performance out of the box. We have specialized libraries for that. Need only API wrappers for them.
  • Cover all cases as immediately and in one bundle. We will modularize everything and add new features gradually.
  • Provide specialized behavior in the core. API is made generic on purpose, so one needs to specialize for types, like for Double in the core. For that we will have specialization modules like kmath-for-real, which will give better experience for those, who want to work with specific types.

Features and stability

KMath is a modular library. Different modules provide different features with different API stability guarantees. All core modules are released with the same version, but with different API change policy. The features are described in module definitions below. The module stability could have the following levels:

  • PROTOTYPE. On this level there are no compatibility guarantees. All methods and classes form those modules could break any moment. You can still use it, but be sure to fix the specific version.
  • EXPERIMENTAL. The general API is decided, but some changes could be made. Volatile API is marked with @UnstableKmathAPI or other stability warning annotations.
  • DEVELOPMENT. API breaking generally follows semantic versioning ideology. There could be changes in minor versions, but not in patch versions. API is protected with binary-compatibility-validator tool.
  • STABLE. The API stabilized. Breaking changes are allowed only in major releases.

Modules


Maturity: EXPERIMENTAL


Maturity: EXPERIMENTAL


Maturity: EXPERIMENTAL

Features:


Maturity: EXPERIMENTAL


Complex numbers and quaternions.

Maturity: PROTOTYPE

Features:


Core classes, algebra definitions, basic linear algebra

Maturity: DEVELOPMENT

Features:

  • algebras : Algebraic structures like rings, spaces and fields.
  • nd : Many-dimensional structures and operations on them.
  • linear : Basic linear algebra operations (sums, products, etc.), backed by the Space API. Advanced linear algebra operations like matrix inversion and LU decomposition.
  • buffers : One-dimensional structure
  • expressions : By writing a single mathematical expression once, users will be able to apply different types of objects to the expression by providing a context. Expressions can be used for a wide variety of purposes from high performance calculations to code generation.
  • domains : Domains
  • autodiff : Automatic differentiation

Maturity: EXPERIMENTAL


Maturity: PROTOTYPE


Maturity: PROTOTYPE

Features:


Extension module that should be used to achieve numpy-like behavior. All operations are specialized to work with Double numbers without declaring algebraic contexts. One can still use generic algebras though.

Maturity: EXPERIMENTAL

Features:

  • DoubleVector : Numpy-like operations for Buffers/Points
  • DoubleMatrix : Numpy-like operations for 2d real structures
  • grids : Uniform grid generators

Maturity: EXPERIMENTAL

Features:


Maturity: PROTOTYPE


Maturity: PROTOTYPE


Maturity: PROTOTYPE

Features:

  • jafama-double : Double ExtendedField implementations based on Jafama

Maturity: PROTOTYPE


Maturity: EXPERIMENTAL

Features:


An API and basic implementation for arranging objects in a continuous memory block.

Maturity: DEVELOPMENT


Maturity: EXPERIMENTAL

Features:


Maturity: EXPERIMENTAL


Maturity: PROTOTYPE


Maturity: PROTOTYPE

Features:


Maturity: DEVELOPMENT


Multi-platform support

KMath is developed as a multi-platform library, which means that most of the interfaces are declared in the common source sets and implemented there wherever it is possible. In some cases, features are delegated to platform-specific implementations even if they could be provided in the common module for performance reasons. Currently, the Kotlin/JVM is the primary platform, however Kotlin/Native and Kotlin/JS contributions and feedback are also welcome.

Performance

Calculation performance is one of major goals of KMath in the future, but in some cases it is impossible to achieve both performance and flexibility.

We expect to focus on creating convenient universal API first and then work on increasing performance for specific cases. We expect the worst KMath benchmarks will perform better than native Python, but worse than optimized native/SciPy (mostly due to boxing operations on primitive numbers). The best performance of optimized parts could be better than SciPy.

Requirements

KMath currently relies on JDK 11 for compilation and execution of Kotlin-JVM part. We recommend to use GraalVM-CE 11 for execution to get better performance.

Repositories

Release and development artifacts are accessible from mipt-npm Space repository https://maven.pkg.jetbrains.space/mipt-npm/p/sci/maven (see documentation of Kotlin Multiplatform for more details). The repository could be reached through repo.kotlin.link proxy:

repositories {
    maven("https://repo.kotlin.link")
}

dependencies {
    api("space.kscience:kmath-core:0.3.0-dev-14")
    // api("space.kscience:kmath-core-jvm:0.3.0-dev-14") for jvm-specific version
}

Gradle 6.0+ is required for multiplatform artifacts.

Contributing

The project requires a lot of additional work. The most important thing we need is a feedback about what features are required the most. Feel free to create feature requests. We are also welcome to code contributions, especially in issues marked with waiting for a hero label.

Comments
  • Integration with Jafama

    Integration with Jafama

    To external contributors:

    Notify us if you are going to try to implement this feature to receive our contacts (and maybe guest access to our Space) and extensive explanations of what does this problem means.

    feature performance 
    opened by CommanderTvis 20
  • Feature: Polynomials and rational functions

    Feature: Polynomials and rational functions

    This is implementation of different kinds of polynomials and rational functions. It should close issues #462, #336 See also: #39, #446,

    Comment: files systematisation

    1. Each kind of polynomials and corresponding polynomial spaces are placed in corresponding file named after type of polynomials.
    2. The same goes for rational functions: each kind of rational functions and corresponding rational functions' spaces are placed in corresponding file named after type of polynomials.
    3. Utilities for each kind of polynomials and rational functions are placed in file named after corresponding type of polynomials/rational functions with additional Util suffix.
    4. Constructors (and building DSLs) for each kind of polynomials and rational functions are placed in file named after corresponding type with additional Constructors suffix.
    5. Abstract entities are places in Polynomial.kt and RationalFunction.kt.

    Problems and questions

    1. Is it worth to change Map<Symbol, UInt> to android.util.ArrayMap<Symbo, UInt> or something similar? This class is designed to be more memory efficient for small numbers of entries which is exactly our use case.

    2. What is better way to implement interoperability with integers? As fact, additive (abelian) groups has natural product operation with integers: product of element c and integer n is just:

      • sum of n copies of c if n is positive,
      • sum of -n copies of -c if n is negative (or negate of sum of -n copies of c, which is the same),
      • zero (neutral element) of the group if n is zero.

      The same goes for multiplicative groups and power. (As a matter of fact, rings do not provide multiplicative (abelian) groups, but multiplicative (abelian) monoids, so the power can be defined not for integers, but for non-negative integers.) In context of rings we also have addition of ring members and integers: for real, sum of element c and integer n is just c + n * one (where one is unit of the ring). And multiplication and exponentiation are very helpful and frequently used.

      For example, when you calculate derivative of polynomial you multiply coefficients of terms to corresponding degrees (which are positive integers), so to implement derivative you have to implement multiplication yourself (see algebraicStub.kt) or require ability to convert integer to ring member (see Polynomial<C>.derivative that preserves former logic). Both variants are bad: manual multiplication usually slower then multiplication that could be provided by corresponding ring, and requiring convertibility (by ScaleOperations or even NumericAlgebra because there are no alternatives) makes it impossible to use it in common rings (say hi to rational numbers again).

      In my opinion, the best way is to declare the interactions in GroupOps/Group (for multiplication) and Ring (for exponentiation that is already declared and addition) interfaces and implement them in all current algebraic structures. (It's very easy, even is a bit of boilerplate.) It's even inconsistent in some way that exponentiation is declared in Ring, but multiplication by Int/UInt (which is the same operation not in multiplicative group/monoid, but in additive group/monoid) is not.

      So the trivial question here: what should I do here?

    3. Maybe, it is better to move first argument ring of utility functions (substitute, derivative, etc.) to context (when context receivers will be available), isn't it?

    4. Is there need in other functionality? For example, string representation: it is already implemented in my other repositories, it remains only to copy it with minimal modification.

    5. Should RFs spaces be implemented as field? If yes, then what division operations should be implemented? (For example, what should c / c return? And when field over C is provided?) And how to implement current Number-oriented functions of Field?

    6. Should cases for A (the type of provided ring of constants) being Field be considered as well? I mean that function operator fun Polynomial<C>.div(other: C): Polynomial<C> makes sense only in context of of field over C. And it looks helpful. So should I implement something like this? (But of course, I'll be able to implement something like this when context receivers will be released. For now I can sketch it, comment it and add TODO mark to it.)

    TODO list

    • [ ] Write optimized algorithms for substitution.
    • [ ] Anything else? (Look at inline TODOs.)
    feature 
    opened by lounres 19
  • release() for DirectByteBuffer

    release() for DirectByteBuffer

    as you come upon DirectByteBuffers, see

    https://stackoverflow.com/a/8462690

    re: https://github.com/mipt-npm/kmath/blob/e52cfcaafe7eb1149170838d9910e54851ba1a92/kmath-memory/src/jvmMain/kotlin/scientifik/memory/ByteBufferMemory.kt#L88

    discussion 
    opened by jnorthrup 18
  • Integration with kotlingrad

    Integration with kotlingrad

    https://github.com/breandan/kotlingrad

    The idea is to connect kotlingrad automatic differentiation done in kotlngrad via MST expressions. One should be able to transform MST expressions to kotlingrad node-graph and back again. This way we will be able to perform autodif on any algebra. The integration possibly will require some changes in kotlingrad API.

    cc @breandan

    feature 
    opened by altavir 12
  • Initial geometry projections implemetations

    Initial geometry projections implemetations

    1. Added Projections support into geometry package along with Shift/LinearMap transformations
    2. Also tried to enhance Vector/VectorSpace API with parametrization:
    • from one side tried to make interfaces generic enough so it will be easy to add a custom implementation (if the default implementation is not enough) and still use all existing infrastructure;
    • from the other hand tried not to introduce too much overhead to not harm performance;
    • added Dimension parameter to Vector/VectorSpace to allow operations only on vectors of the same size;
    • added Vector's type to VectorSpace class to allow custom implementation that can leverage some internals of particular implementation of Vector's class;
    • provided default implementation to generic EuclideanSpace in D dimension over some field;
    • provided an implementation of EuclideanSpace in D dimension over Field.
    1. Covered code with basic tests.
    feature 
    opened by knok16 12
  • Bug in cast to Structure2D

    Bug in cast to Structure2D

    There is a probable bug in cast of NDStructure to Structure2D with as2D() function. In that case class uses swapped rowNum and colNum values because of the reversed shape, so in fact you store row number in colNum and vice versa. https://github.com/mipt-npm/kmath/blob/e52cfcaafe7eb1149170838d9910e54851ba1a92/kmath-core/src/commonMain/kotlin/scientifik/kmath/structures/Structure2D.kt#L7-L8 Since rowNum and colNum values are swapped, there is also another probable bug in get method (swapped requested column and row indices again) https://github.com/mipt-npm/kmath/blob/e52cfcaafe7eb1149170838d9910e54851ba1a92/kmath-core/src/commonMain/kotlin/scientifik/kmath/structures/Structure2D.kt#L18-L20 For example, this makes dot operation for the structures work incorrectly. A simple example that shows an error:

    val firstMatrix = BufferNDStructure(DefaultStrides(intArrayOf(3, 2)), ListBuffer(6) { 1.0 })
    val secondMatrix = BufferNDStructure(DefaultStrides(intArrayOf(5, 3)), ListBuffer(15) { 1.0 })
    val product = MatrixContext.real.run { firstMatrix.as2D() dot secondMatrix.as2D() }
    

    My possible fix - link

    bug 
    opened by cupertank 10
  • Slowness with Neural Network Example

    Slowness with Neural Network Example

    Slowness with neural network usage example

    I started to port over some existing machine learning from scratch demos to use kmath. This particular neural network demo I made using stochastic hill climbing is extremely slow, much slower than just using vanilla Kotlin.

    I'm open to feedback and learning if I'm doing something wrong...

    https://github.com/thomasnield/numky/blob/master/src/test/kotlin/org/nield/numky/NeuralNetworkSimulatedAnnealing.kt

    performance 
    opened by thomasnield 8
  • Support for Probability Distributions

    Support for Probability Distributions

    Hi, Is there any way to include these components? Url apache commons math

    • distribution normal
    • distribution t-student
    • distribution chi-square
    • distribution F-fisher

    for example

    f.cumulativeProbability(x)
    f.probability(x)
    f.inverseCumulativeProbability(p)
    
    //    example t-student distribution
    
    TDistribution t = new TDistribution(29);
    double lowerTail = t.cumulativeProbability(-2.656);     // P(T(29) <= -2.656)
    double upperTail = 1.0 - t.cumulativeProbability(2.75); // P(T(29) >= 2.75)
    
    
    feature 
    opened by Moriand 7
  • Set up continuous integration

    Set up continuous integration

    It looks like the build artifacts are outdated. TeamCity offers free builds for OSS, as well as Travis CI or CircleCI. It is possible to autobuild on a per-commit basis, and publish releases to a custom Maven repository. Please let me know if you need any help setting this up.

    discussion 
    opened by breandan 7
  • Karatsuba added, 2 bugs are fixed

    Karatsuba added, 2 bugs are fixed

    • Karatsuba was added and increased benchmarks results.
    • The bug that was caused by abs(Int.MIN_VALUE) == Int.MIN_VALUE was fixed.
    • The equals function now behaves with instances of other types as all other objects do.
    opened by zhelenskiy 6
  • Support for BigInteger

    Support for BigInteger

    Secure multi-party computation (SMPC) and related mechanisms work with numbers that exceed the maximum values of Kotlin primitive types.

    By adding support to BigInteger, components using KMath could be used in SMPC setups.

    An interesting field where this could be applied is to training and inference of machine learning algorithms where the data is never shared.

    feature 
    opened by mccorby 6
  • Pull request quality gates

    Pull request quality gates

    There is already a bunch of nice features from KMath contributors. But since the code is usually sophisticated, some community design process needs to be enforced in order to make them play together. So here are some rules.

    1. Any contribution with new classes/features must have test coverage of algorithmic part (not necessary 100% code coverage).
    2. Any feature contribution must include a set of examples (goes into examples project), short feature description (goes into readme/feature section of appropriate module build file) and a design document (goes into docs directory). The design document is made to explain the design decisions made for the specific features (look at how KEEP works). Designing mathematics library is hard and we want all decisions to be consistent. The discussion in Kotlin Slack is welcome.
    3. Any changes made to stable maturity modules must be ABI compatible between major versions and development maturity means ABI compatibility between minor versions. If your change is breaking it should be moved to a separate module or to the next release branch.
    discussion documentation 
    opened by altavir 2
  • Add functions to compute Union & Intersection Area of two rectangles

    Add functions to compute Union & Intersection Area of two rectangles

    Feature Request

    Use Case

    • When doing object detection using deep learning, we have to do what is known as non-max supression. To do so we need to compute the IoU (Intersection over Union) of two rectangles (compute area of the union and the area of the intersection of the two rectangles). Adding it to KMath would allow us to make use of it for the IoU computation without implementing the area computation part from scratch. Even though it is not very hard to do, I think it could be a nice addition to KMath since its usage can be much broader than just for deep learning, area computation is pretty generic in maths.

    Proposal

    • A function/method similar to getIntersectionArea(Rect1, Rect2)
    • A function/method similar to getUnionArea(Rect1, Rect2) or
    • A single function getIoU(Rect1, Rect2) Ideally the solution should be mockable so that library users have more freedom.
    feature 
    opened by AlexandreBrown 4
Releases(v0.3.0)
  • v0.3.0(Apr 12, 2022)

    Added

    • ScaleOperations interface
    • Field extends ScaleOperations
    • Basic integration API
    • Basic MPP distributions and samplers
    • bindSymbolOrNull
    • Blocking chains and Statistics
    • Multiplatform integration
    • Integration for any Field element
    • Extended operations for ND4J fields
    • Jupyter Notebook integration module (kmath-jupyter)
    • @PerformancePitfall annotation to mark possibly slow API
    • Unified architecture for Integration and Optimization using features.
    • BigInt operation performance improvement and fixes by @zhelenskiy (#328)
    • Integration between MST and Symja IExpr
    • Complex power
    • Separate methods for UInt, Int and Number powers. NaN safety.
    • Tensorflow prototype
    • ValueAndErrorField
    • MST compilation to WASM: #286
    • Jafama integration: #176
    • contentEquals with tolerance: #364
    • Compilation to TeX for MST: #254

    Changed

    • Exponential operations merged with hyperbolic functions
    • Space is replaced by Group. Space is reserved for vector spaces.
    • VectorSpace is now a vector space
    • Buffer factories for primitives moved to MutableBuffer.Companion
    • Rename NDStructure and NDAlgebra to StructureND and AlgebraND respectively
    • Real -> Double
    • DataSets are moved from functions to core
    • Redesign advanced Chain API
    • Redesign MST. Remove MstExpression.
    • Move MST to core
    • Separated benchmarks and examples
    • Rewrite kmath-ejml without ejml-simple artifact, support sparse matrices
    • Promote stability of kmath-ast and kmath-kotlingrad to EXPERIMENTAL.
    • ColumnarData returns nullable column
    • MST is made sealed interface
    • Replace MST.Symbolic by Symbol, Symbol now implements MST
    • Remove Any restriction on polynomials
    • Add out variance to type parameters of StructureND and its implementations where possible
    • Rename DifferentiableMstExpression to KotlingradExpression
    • FeatureSet now accepts only Feature. It is possible to override keys and use interfaces.
    • Use Symbol factory function instead of StringSymbol
    • New discoverability pattern: <Type>.algebra.<nd/etc>
    • Adjusted commons-math API for linear solvers to match conventions.
    • Buffer algebra does not require size anymore
    • Operations -> Ops
    • Default Buffer and ND algebras are now Ops and lack neutral elements (0, 1) as well as algebra-level shapes.
    • Tensor algebra takes read-only structures as input and inherits AlgebraND
    • UnivariateDistribution renamed to Distribution1D
    • Rework of histograms.
    • UnivariateFunction -> Function1D, MultivariateFunction -> FunctionND

    Deprecated

    • Specialized DoubleBufferAlgebra

    Removed

    • Nearest in Domain. To be implemented in geometry package.
    • Number multiplication and division in main Algebra chain
    • contentEquals from Buffer. It moved to the companion.
    • MSTExpression
    • Expression algebra builders
    • Complex and Quaternion no longer are elements.
    • Second generic from DifferentiableExpression
    • Algebra elements are completely removed. Use algebra contexts instead.

    Fixed

    • Ring inherits RingOperations, not GroupOperations
    • Univariate histogram filling
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0-dev-18(Feb 13, 2022)

    Added

    • ScaleOperations interface
    • Field extends ScaleOperations
    • Basic integration API
    • Basic MPP distributions and samplers
    • bindSymbolOrNull
    • Blocking chains and Statistics
    • Multiplatform integration
    • Integration for any Field element
    • Extended operations for ND4J fields
    • Jupyter Notebook integration module (kmath-jupyter)
    • @PerformancePitfall annotation to mark possibly slow API
    • Unified architecture for Integration and Optimization using features.
    • BigInt operation performance improvement and fixes by @zhelenskiy (#328)
    • Integration between MST and Symja IExpr
    • Complex power
    • Separate methods for UInt, Int and Number powers. NaN safety.
    • Tensorflow prototype

    Changed

    • Exponential operations merged with hyperbolic functions
    • Space is replaced by Group. Space is reserved for vector spaces.
    • VectorSpace is now a vector space
    • Buffer factories for primitives moved to MutableBuffer.Companion
    • Rename NDStructure and NDAlgebra to StructureND and AlgebraND respectively
    • Real -> Double
    • DataSets are moved from functions to core
    • Redesign advanced Chain API
    • Redesign MST. Remove MstExpression.
    • Move MST to core
    • Separated benchmarks and examples
    • Rewrite kmath-ejml without ejml-simple artifact, support sparse matrices
    • Promote stability of kmath-ast and kmath-kotlingrad to EXPERIMENTAL.
    • ColumnarData returns nullable column
    • MST is made sealed interface
    • Replace MST.Symbolic by Symbol, Symbol now implements MST
    • Remove Any restriction on polynomials
    • Add out variance to type parameters of StructureND and its implementations where possible
    • Rename DifferentiableMstExpression to KotlingradExpression
    • FeatureSet now accepts only Feature. It is possible to override keys and use interfaces.
    • Use Symbol factory function instead of StringSymbol
    • New discoverability pattern: <Type>.algebra.<nd/etc>
    • Adjusted commons-math API for linear solvers to match conventions.
    • Buffer algebra does not require size anymore
    • Operations -> Ops
    • Default Buffer and ND algebras are now Ops and lack neutral elements (0, 1) as well as algebra-level shapes.
    • Tensor algebra takes read-only structures as input and inherits AlgebraND

    Deprecated

    • Specialized DoubleBufferAlgebra

    Removed

    • Nearest in Domain. To be implemented in geometry package.
    • Number multiplication and division in main Algebra chain
    • contentEquals from Buffer. It moved to the companion.
    • MSTExpression
    • Expression algebra builders
    • Complex and Quaternion no longer are elements.
    • Second generic from DifferentiableExpression
    • Algebra elements are completely removed. Use algebra contexts instead.

    Fixed

    • Ring inherits RingOperations, not GroupOperations
    • Univariate histogram filling
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0-dev-8(May 8, 2021)

    Added

    • ScaleOperations interface
    • Field extends ScaleOperations
    • Basic integration API
    • Basic MPP distributions and samplers
    • bindSymbolOrNull
    • Blocking chains and Statistics
    • Multiplatform integration
    • Integration for any Field element
    • Extended operations for ND4J fields
    • Jupyter Notebook integration module (kmath-jupyter)

    Changed

    • Exponential operations merged with hyperbolic functions
    • Space is replaced by Group. Space is reserved for vector spaces.
    • VectorSpace is now a vector space
    • Buffer factories for primitives moved to MutableBuffer.Companion
    • NDStructure and NDAlgebra to StructureND and AlgebraND respectively
    • Real -> Double
    • DataSets are moved from functions to core
    • Redesign advanced Chain API
    • Redesign MST. Remove MSTExpression.
    • Move MST to core
    • Separated benchmarks and examples
    • Rewritten EJML module without ejml-simple

    Deprecated

    Removed

    • Nearest in Domain. To be implemented in geometry package.
    • Number multiplication and division in main Algebra chain
    • contentEquals from Buffer. It moved to the companion.
    • MSTExpression
    • Expression algebra builders
    • Comples and Quaternion no longer are elements.

    Fixed

    • Ring inherits RingOperations, not GroupOperations
    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Feb 21, 2021)

    [0.2.0]

    Added

    • fun annotation for SAM interfaces in library
    • Explicit public visibility for all public APIs
    • Better trigonometric and hyperbolic functions for AutoDiffField (https://github.com/mipt-npm/kmath/pull/140)
    • Automatic README generation for features (#139)
    • Native support for memory, core and dimensions
    • kmath-ejml to supply EJML SimpleMatrix wrapper (https://github.com/mipt-npm/kmath/pull/136)
    • A separate Symbol entity, which is used for global unbound symbol.
    • A Symbol indexing scope.
    • Basic optimization API for Commons-math.
    • Chi squared optimization for array-like data in CM
    • Fitting utility object in prob/stat
    • ND4J support module submitting NDStructure and NDAlgebra over INDArray
    • Coroutine-deterministic Monte-Carlo scope with a random number generator
    • Some minor utilities to kmath-for-real
    • Generic operation result parameter to MatrixContext
    • New MatrixFeature interfaces for matrix decompositions
    • Basic Quaternion vector support in kmath-complex.

    Changed

    • Package changed from scientifik to space.kscience
    • Gradle version: 6.6 -> 6.8.2
    • Minor exceptions refactor (throwing IllegalArgumentException by argument checks instead of IllegalStateException)
    • Polynomial secondary constructor made function
    • Kotlin version: 1.3.72 -> 1.4.30
    • kmath-ast doesn't depend on heavy kotlin-reflect library
    • Full autodiff refactoring based on Symbol
    • kmath-prob renamed to kmath-stat
    • Grid generators moved to kmath-for-real
    • Use Point<Double> instead of specialized type in kmath-for-real
    • Optimized dot product for buffer matrices moved to kmath-for-real
    • EjmlMatrix context is an object
    • Matrix LUP inverse renamed to inverseWithLup
    • NumericAlgebra moved outside of regular algebra chain (Ring no longer implements it).
    • Features moved to NDStructure and became transparent.
    • Capitalization of LUP in many names changed to Lup.
    • Refactored NDStructure algebra to be more simple, preferring under-the-hood conversion to explicit NDStructure types
    • Refactor histograms. They are marked as prototype
    • Complex and related features moved to a separate module kmath-complex
    • Refactor AlgebraElement
    • symbol method in Algebra renamed to bindSymbol to avoid ambiguity
    • Add out projection to Buffer generic

    Deprecated

    Removed

    • kmath-koma module because it doesn't support Kotlin 1.4.
    • Support of legacy JS backend (we will support only IR)
    • toGrid method.
    • Public visibility of BufferAccessor2D
    • Real class

    Fixed

    • symbol method in MstExtendedField (https://github.com/mipt-npm/kmath/pull/140)
    Source code(tar.gz)
    Source code(zip)
  • v0.2.0-dev-5(Jan 20, 2021)

    Added

    • fun annotation for SAM interfaces in library
    • Explicit public visibility for all public APIs
    • Better trigonometric and hyperbolic functions for AutoDiffField (https://github.com/mipt-npm/kmath/pull/140)
    • Automatic README generation for features (#139)
    • Native support for memory, core and dimensions
    • kmath-ejml to supply EJML SimpleMatrix wrapper (https://github.com/mipt-npm/kmath/pull/136)
    • A separate Symbol entity, which is used for global unbound symbol.
    • A Symbol indexing scope.
    • Basic optimization API for Commons-math.
    • Chi squared optimization for array-like data in CM
    • Fitting utility object in prob/stat
    • ND4J support module submitting NDStructure and NDAlgebra over INDArray
    • Coroutine-deterministic Monte-Carlo scope with a random number generator
    • Some minor utilities to kmath-for-real
    • Generic operation result parameter to MatrixContext
    • New MatrixFeature interfaces for matrix decompositions

    Changed

    • Package changed from scientifik to kscience.kmath
    • Gradle version: 6.6 -> 6.8
    • Minor exceptions refactor (throwing IllegalArgumentException by argument checks instead of IllegalStateException)
    • Polynomial secondary constructor made function
    • Kotlin version: 1.3.72 -> 1.4.21
    • kmath-ast doesn't depend on heavy kotlin-reflect library
    • Full autodiff refactoring based on Symbol
    • kmath-prob renamed to kmath-stat
    • Grid generators moved to kmath-for-real
    • Use Point<Double> instead of specialized type in kmath-for-real
    • Optimized dot product for buffer matrices moved to kmath-for-real
    • EjmlMatrix context is an object
    • Matrix LUP inverse renamed to inverseWithLUP
    • NumericAlgebra moved outside of regular algebra chain (Ring no longer implements it).
    • Features moved to NDStructure and became transparent.

    Deprecated

    Removed

    • kmath-koma module because it doesn't support Kotlin 1.4.
    • Support of legacy JS backend (we will support only IR)
    • toGrid method.
    • Public visibility of BufferAccessor2D

    Fixed

    • symbol method in MstExtendedField (https://github.com/mipt-npm/kmath/pull/140)

    Security

    Source code(tar.gz)
    Source code(zip)
  • v0.2.0-dev-2(Sep 27, 2020)

    Added

    • fun annotation for SAM interfaces in library
    • Explicit public visibility for all public APIs
    • Better trigonometric and hyperbolic functions for AutoDiffField (https://github.com/mipt-npm/kmath/pull/140).
    • Automatic README generation for features (#139)

    Changed

    • Package changed from scientifik to kscience.kmath.
    • Gradle version: 6.6 -> 6.6.1
    • Minor exceptions refactor (throwing IllegalArgumentException by argument checks instead of IllegalStateException)
    • Polynomial secondary constructor made function.
    • Kotlin version: 1.3.72 -> 1.4.20-M1

    Deprecated

    Removed

    • kmath-koma module because it doesn't support Kotlin 1.4.

    Fixed

    • symbol method in MstExtendedField (https://github.com/mipt-npm/kmath/pull/140)
    Source code(tar.gz)
    Source code(zip)
  • v0.1.4(Sep 14, 2020)

    Added

    • Functional Expressions API
    • Mathematical Syntax Tree, its interpreter and API
    • String to MST parser (https://github.com/mipt-npm/kmath/pull/120)
    • MST to JVM bytecode translator (https://github.com/mipt-npm/kmath/pull/94)
    • FloatBuffer (specialized MutableBuffer over FloatArray)
    • FlaggedBuffer to associate primitive numbers buffer with flags (to mark values infinite or missing, etc.)
    • Specialized builder functions for all primitive buffers like IntBuffer(25) { it + 1 } (https://github.com/mipt-npm/kmath/pull/125)
    • Interface NumericAlgebra where number operation is available to convert numbers to algebraic elements
    • Inverse trigonometric functions support in ExtendedField (asin, acos, atan) (https://github.com/mipt-npm/kmath/pull/114)
    • New space extensions: average and averageWith
    • Local coding conventions
    • Geometric Domains API in kmath-core
    • Blocking chains in kmath-coroutines
    • Full hyperbolic functions support and default implementations within ExtendedField
    • Norm support for Complex

    Changed

    • readAsMemory now has throws IOException in JVM signature.
    • Several functions taking functional types were made inline.
    • Several functions taking functional types now have callsInPlace contracts.
    • BigInteger and BigDecimal algebra: JBigDecimalField has companion object with default math context; minor optimizations
    • power(T, Int) extension function has preconditions and supports Field<T>
    • Memory objects have more preconditions (overflow checking)
    • tg function is renamed to tan (https://github.com/mipt-npm/kmath/pull/114)
    • Gradle version: 6.3 -> 6.6
    • Moved probability distributions to commons-rng and to kmath-prob

    Fixed

    • Missing copy method in Memory implementation on JS (https://github.com/mipt-npm/kmath/pull/106)
    • D3.dim value in kmath-dimensions
    • Multiplication in integer rings in kmath-core (https://github.com/mipt-npm/kmath/pull/101)
    • Commons RNG compatibility (https://github.com/mipt-npm/kmath/issues/93)
    • Multiplication of BigInt by scalar
    Source code(tar.gz)
    Source code(zip)
  • 0.1.4-dev-8(Jun 27, 2020)

  • 0.1.4-dev-4(Apr 30, 2020)

    • Experimental type-safe dimensions
    • Viktor integration
    • Kmath-for-real module for those who want simple access to real (Double) world without writing contexts
    • Interpolation API
    • BigInteger
    • Basic statistics
    Source code(tar.gz)
    Source code(zip)
  • 0.1.3(Jun 26, 2019)

  • 0.1.2(May 31, 2019)

    • Refactored build. Proper bintray artifacts.
    • Streaming processing with Flow API.
    • Vectors are deprecated. To be removed in next release. Use context operations instead.
    Source code(tar.gz)
    Source code(zip)
  • 0.1.0(Feb 22, 2019)

  • 0.1.0-dev(Feb 21, 2019)

  • 0.0.2-dev-1(Dec 11, 2018)

Owner
MIPT-NPM
MIPT nuclear physics methods lab
MIPT-NPM
Show worldwide headline. API/Glide library/recycler view/volley library/kotlin/xml/ chrome custom tabs

Show worldwide headline. API/Glide library/recycler view/volley library/kotlin/xml/ chrome custom tabs. -> you can click on headline and it will open an article of that news in the app(no need to go to chrome or any browser)

SUMIT KUMAR 5 Nov 28, 2022
A general purpose kotlin library that use kotlin coroutines, flows and channels to provide timer features with the most easy and efficient way

Timer Timer is a general purpose kotlin library that use kotlin coroutines, flows and channels to provide timer features with the most easy and effici

Amr Saraya 3 Jul 11, 2022
To Do List App is built in Kotlin using Material 3, Data Binding, Navigation Component Graphs, Room persistence library, Kotlin coroutines, LiveData, Dagger Hilt, and Notifications following MVVM Architecture.

ToDoListApp ToDoList App demonstrates modern Android development with Hilt, Coroutines, LiveData, Jetpack (Room, ViewModel), and Material 3 Design bas

Naman Garg 10 Jan 8, 2023
A music picker library for React Native. Provides access to the system's UI for selecting songs from the phone's music library.

Expo Music Picker A music picker library for React Native. Provides access to the system's UI for selecting songs from the phone's music library. Supp

Bartłomiej Klocek 60 Dec 29, 2022
Utility Android app for generating color palettes of images using the Palette library. Written in Kotlin.

Palette Helper is a simple utility app made to generate color palettes of images using Google's fantastic Palette library. It's mostly a for-fun pet p

Zac Sweers 154 Nov 18, 2022
Utility Android app for generating color palettes of images using the Palette library. Written in Kotlin.

Palette Helper is a simple utility app made to generate color palettes of images using Google's fantastic Palette library. It's mostly a for-fun pet p

Zac Sweers 154 Nov 18, 2022
An library to help android developers working easly with activities and fragments (Kotlin version)

AFM An library to help android developer working easly with activities and fragments (Kotlin) Motivation Accelerate the process and abstract the logic

Massive Disaster 12 Oct 3, 2022
This is a open source library on kotlin for Solana protocol.

Solana + RxSolana This is a open source library on kotlin for Solana protocol. The objective is to create a cross platform, fully functional, highly t

Arturo Jamaica 48 Jan 9, 2023
Kotlin Android app for cataloging books off home/office library.

MyLibrary App Kotlin Android app for cataloging books off home/office library. Features: Searching COBISS, Google Books and OpenLibrary by scanning IS

Marko Đorđević 0 Nov 29, 2021
Android Contacts API Library written in Kotlin with Java interoperability.

Android Contacts API Library written in Kotlin with Java interoperability. No more ContentProviders and cursors. Say goodbye to ContactsContract. Build your own contacts app!

Vandolf Estrellado 463 Jan 2, 2023
This little project provides Kotlin bindings for the popular tree-sitter library

kotlintree This little project provides Kotlin bindings for the popular tree-sitter library. Currently it only supports the Kotlin JVM target, but Kot

Christian Banse 23 Nov 28, 2022
Brazilian Holidays: a Kotlin/Java library that provides resources to consult Brazilian holidays and business days

Leia esta documentação em Português. Brazilian Holidays Brazilian Holidays is a

Quantis 2 Oct 3, 2022
Spantastic - an Android library that provides a simple and Kotlin fluent API for creating Android Spannable

Spantastic is an Android library that provides a simple and Kotlin fluent API for creating Android Spannable. This library wrappers SpannableStringBuilder and add methods to easily decorate the text with multiple spans.

Wellington Cabral da Silva 12 Nov 27, 2022
Open-source Kotlin library to connect Alsat pardakht peyment API (Core)

Alsat IPG Core با استفاده از این کتابخانه میتوانید پروژه جاوا یا کاتلین خودتون رو به شبکه پرداخت آل‌سات پرداخت وصل کنید و به راحتی محصولات خودتون رو د

Alsat Pardakht 4 Mar 14, 2022
A Kotlin/JVM based library for BitShares blockchain.

A Kotlin/JVM based library for BitShares blockchain. It implements most functions of BitShares Core including objects (de)serialization, transactions sign/broadcast, wallet create/restore, and more.

Husk 1 Apr 9, 2022
A Kotlin binding to webview, a tiny cross-platform webview library, supports Java and Native.

webviewko provides a Kotlin/JVM and a Kotlin/Native(experimental) binding to webview, a tiny cross-platform webview library to build modern cross-platform GUIs using WebView2, WebKit and WebKitGTK.

Winterreisender 17 Dec 30, 2022
Samples demonstrating the features and use of Koala Plot, a Compose Multiplatform based charting and plotting library written in Kotlin.

Koala Plot Samples This repository houses samples demonstrating the use and features of Koala Plot libraries. How to run Build koalaplot-core with the

Koala Plot 6 Oct 18, 2022
Bindings to the JNI library on Android for Kotlin/Native

JNI Utils using this library: implementation("io.github.landrynorris:jni-utils:0.0.1-alpha01") This library provides bindings to the JNI library on An

Landry Norris 6 Sep 27, 2022
MachOParser is a Kotlin library to parse Mach-O files

MachOParser MachOParser is a Kotlin library to parse Mach-O files Mach-O is a file format for executables, shared libraries and related binaries. This

mobile.dev 5 Nov 21, 2022