dot package:harpie

A generalisation of a dot operation, which is a multiplicative expansion of two arrays and sum contraction along the middle two dimensions. matrix multiplication
>>> pretty $ dot sum (*) m (transpose m)
[[5,14],
[14,50]]
inner product
>>> pretty $ dot sum (*) v v
5
matrix-vector multiplication Note that an Array with shape [3] is neither a row vector nor column vector.
>>> pretty $ dot sum (*) v (transpose m)
[5,14]
>>> pretty $ dot sum (*) m v
[5,14]
A generalisation of a dot operation, which is a multiplicative expansion of two arrays and sum contraction along the middle two dimensions. matrix multiplication
>>> pretty $ dot sum (*) m (transpose m)
[[5,14],
[14,50]]
inner product
>>> pretty $ dot sum (*) v v
5
matrix-vector multiplication Note that an Array with shape [3] is neither a row vector nor column vector.
>>> pretty $ dot sum (*) v (transpose m)
[5,14]
>>> pretty $ dot sum (*) m v
[5,14]