kyonifer / koma

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

Inner/outer products for NDArray #95

Closed peastman closed 5 years ago

peastman commented 5 years ago

Following up on one of the issues discussed in #83, I've been thinking about how to implement inner and outer products for NDArrays. Numpy has a ton of different functions for variations on this: dot(), vdot(), tensordot(), inner(), outer(), matmul(), einsum(), etc. In my opinion that is kind of excessive. I suggest adding three functions which will cover most common cases.

All these functions should support infix notation.

kyonifer commented 5 years ago

Sounds like a good approach to me. Re: naming, my preference would be for inner, outer, and dot, as mul or 'multiplication' is an overloaded term.

peastman commented 5 years ago

Sounds good. I'll get started on it. I don't see any alternative to having 36 versions of each function for all possible combinations of input types. That's a bit awkward but I think it's necessary.

kyonifer commented 5 years ago

Closed in #96.