


In Multik, the data structures are separate from the implementation of operations over them, and you need to add them as individual dependencies to your project. As a result, we have abandoned that approach and started Multik from scratch. However, this proved cumbersome and introduced unnecessary environmental complexity while providing little benefit to justify the overhead. Initially, we attempted to add Kotlin bindings to existing solutions, such as NumPy. Mk.math.min(b) // array-wise minimum elements Mk.math.log(b) // element-wise natural logarithm Perform mathematical operations over multidimensional arrays Val e = mk.identity(3) // create an identity array of shape (3, 3)Ĭreate a 3-dimensional array (multik supports up to 4 dimensions): Create multidimensional arraysĬreate an identity matrix (ones on the diagonal, the rest is set to 0)

Without further ado, here are some of the things you can do with Multik. The library has a simple and straightforward API and offers optimized performance. Multik offers both multidimensional array data structures and implementations of mathematical operations over them. Today we’d like to share with you the first preview of a library that aims to serve as a foundation for such computations – Multik. The following example demonstrates how you can create a dynamic array list and initialize the same.A lot of data-heavy tasks, as well as optimization problems, boil down to performing computations over multidimensional arrays. Example: Initialize an empty array in Kotlin If a number is provided as the argument, then it will return an arrayList with the given elements. The function definition of arrayList goes like this − fun arrayListOf(): ArrayList An ArrayList is an ordered sequence of elements, however, unlike simple arrays, an ArrayList can contain data of multiple data types. It would be a dynamic array which means it will automatically expand as we add data into it. Kotlin ArrayList class can be used in order to create an empty arrayList.
