OK, a small announcement. I've been working with optimization of matrix inversion logic for generic multiplatform code (I took commons-math algorithm and adopted it for generics). Today I finally got the result, I am satisfied with. The code is here:
https://github.com/mipt-npm/kmath/blob/dev/kmath-core/src/commonMain/kotlin/scientifik/kmath/linear/LUPDecomposition.kt, test is here:
https://github.com/mipt-npm/kmath/blob/dev/kmath-core/src/commonTest/kotlin/scientifik/kmath/linear/RealLUSolverTest.kt and performance comparison is here:
https://github.com/mipt-npm/kmath/blob/dev/benchmarks/src/main/kotlin/scientifik/kmath/linear/LinearAlgebraBenchmark.kt
In short, I managed to create a multiplatform generic (!) copy of commons-math LUP decomposition without code specialization (meaning I do not have to copy code for each primitive type). The performance is only 2x times worse than koma-ejml implementation and only 3x times worse than commons-math specialized implementation on latest graal preview (a little bit worse on JDK-11). It probably could be further improved by tweaking the algorithm to be more friendly with memory layout, but currently it is not my goal to get super-high generic performance (one can use commons-math just as easily with the same syntax using appropriate connector). Currently the code is suitable for everyday use. The documentation is still not the best, but I am gradually working on it, and of course I need some input from guys actually using linear algebra.
So I plan to move to polishing other features. The next big task (after I check if anything needs tidying up) is probably probability distributions, Monte-Carlo chains improvement (using new
Flow
support). I will wrap up the documentation and push the release to bintray in a few days.