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.