[Top][All Lists]

[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)


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 ?


Pascal pwdiff.m  

View this message in context:
Sent from the Octave - General mailing list archive at

reply via email to

[Prev in Thread] Current Thread [Next in Thread]