Someone (I think it was <@U0BA5R9KL>) asked me to ...
# mathematics
a
Someone (I think it was @breandan) asked me to make an example of how a new algebra is defined in KMath. Here it is: https://github.com/mipt-npm/kmath/blob/refactor/ndalgebra/examples/src/main/kotlin/kscience/kmath/structures/ParallelRealNDField.kt. This is a NDAlgebra on top of RealField for elements. In KMath NDAlgebra preserves the shape of the elements, it means that you can't operate nd-arrays with different dimensions in a single algrbra (so dot products etc are not allowed, we have MatrixContext for that). This particular demonstrator utilized Java DoubleStream automatic parallelization. It actually does not worth the effort (it is a bit faster than plain Kmath or Viktor, but slower than ND4J), so I will keep it just as example. The example of usage could be found in the same directory in NDField demo. The changes are not merged into dev yet, so if you want to play around, be patient or clone the branch.
👍 1