[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## compute all pairwise diffs

**From**: |
CdeMills |

**Subject**: |
compute all pairwise diffs |

**Date**: |
Fri, 8 Jul 2011 01:35:38 -0700 (PDT) |

Hello,
I faced the problem of finding in a vector if all components are distinct. I
found an idea with the help of google, and implemented it in the enclosed
file. I tried to model it as closely as possible to diff, with the ability
to choose the dimension to work on for matrices.
The result for a N dim object is a N+1 dim object, where all matrices are
anti-symmetric and contains NaN on the main diagonal, in order to detect
without trickery the smallest non-null difference. The algorithm is
redundant, as the resulting matrix must be antisymetric, so only one half
has to be computed. But I suppose that using a loop will be slower than
performing twice the computations.
Comments ? Suggestion ? Could it be incorporated somewhere ?
Regards
Pascal
http://octave.1599824.n4.nabble.com/file/n3653504/pwdiff.m pwdiff.m
--
View this message in context:
http://octave.1599824.n4.nabble.com/compute-all-pairwise-diffs-tp3653504p3653504.html
Sent from the Octave - General mailing list archive at Nabble.com.

**compute all pairwise diffs**,
*CdeMills* **<=**