title: How to find number of unique elements in each row of a matrix?
body: <p>I'm trying to implement some sort of interpolation algorithm. <code>I</code> is an N*4 matrix, holding indices of surrounding points of <code>N</code> other points. But elements in each row of <code>I</code> may not be unique, meaning two or more of them may refer to an individual point. I want to know how many unique indices are available in each row, and I want to do it as fast as possible since <code>N</code> is big!</p>