scalala / Scalala

Scalala has been superseded by dlwh/breeze. Scalala is a high performance numeric linear algebra library for Scala, with rich Matlab-like operators on vectors and matrices; a library of numerical routines; support for plotting.
http://groups.google.com/group/scalala
GNU Lesser General Public License v2.1
298 stars 30 forks source link

Library.sum for matrices #45

Open afwlehmann opened 12 years ago

afwlehmann commented 12 years ago

This is really just a repost from the google group but since noone has answered in quite a long time and I feel that this might be an issue, please let me ask the following question:

While I'm probably not seeing the wood for the trees, I'm somehow confused with Library.sum for matrices or, more specifically, its result. For

val foo = DenseMatrix((1,2,3), (4,5,6))

I'd expect

sum(foo, Axis.Horizontal)

to return the sum along the horizontal axis, i.e. some VectorCol(6, 15). The same applies to the vertical sum, only vice versa. However, the horizontal and vertical axes seem to be swapped, hence sum(foo, Axis.Horizontal) returns some VectorRow(5,7,9).

So my question is whether this is the desired behaviour as I would have expected the contrary. Maybe this is due to the fact that English is a foreign language for me and I'm mixing up the meaning of summing "along" the horizontal or vertical axis (not mocking here, I really think I might have misunderstood the meaning)?

Regards, Alexander