kyonifer / koma

A scientific computing library for Kotlin. https://kyonifer.github.io/koma
Other
270 stars 23 forks source link

Lots of new functions on NDArrays #78

Closed peastman closed 5 years ago

peastman commented 5 years ago

This implements #74.

For the moment, mean() and sum() are only implemented as functions, not methods. So you can write sum(x), but not x.sum(). Once the codegen issues are figured out, that will be easy to change.

For all the reduction funtions (min(), argMin(), sum(), etc.) I've included two versions. There's one that works over the whole array, and a second one that does the reduction over a single axis. I modelled the API on Numpy.

kyonifer commented 5 years ago

Thanks for looking into this. I like the idea overall-- I have a few comments on the implementation.

peastman commented 5 years ago

Ok, I think I've made all the changes.

kyonifer commented 5 years ago

Looks good now, thanks!