Hi Ted, Thanks for taking this discussion back alive. It's true, as Sebestian mentioned, equality checking for matrices is an expensive task and Ted has come up with a smart one liner here(even though a considerable amount of computational complexity is hidden somewhere). But don't you think (at least for the sake of completeness) that we should have an implementation of this?
Btw, this thread has turned into a developers discussion, so I'm not sure whether we should continue this on the developers list. Best Regards, On Mon, Dec 30, 2013 at 4:05 AM, Ted Dunning <[email protected]> wrote: > On Sun, Dec 29, 2013 at 9:17 AM, Tharindu Rusira > <[email protected]>wrote: > > > Thanks Chameera and Sebestian for sharing your expertise :) > > Just wanted to know the reason behind the absence of an equality check > for > > Matrices. > > > > > For what it is worth, here is the one liner that does this comparison: > > a.minus(b).aggregate(Functions.MAX, Functions.ABS) > > This gives you a value which is the magnitude of the largest absolute > difference between elements of matrix a and matrix b. > > For vectors, you can economize a little on typing with this: > > a.minus(b).norm(1) > > This is the sum of the absolute values of the differences. > -- M.P. Tharindu Rusira Kumara Department of Computer Science and Engineering, University of Moratuwa, Sri Lanka. +94757033733 www.tharindu-rusira.blogspot.com
