peakml
Interface IPeak.MatchCompare<Type>

Type Parameters:
Type - The type of peak to compare.
Enclosing class:
IPeak

public static interface IPeak.MatchCompare<Type>

This interface defines the setup for the comparison of peaks from two datasets, in order to determine whether they were caused by the same molecule. The method distance has so been called because the method IPeak.match(Vector, double, peakml.IPeak.MatchCompare) attempts minimize the distance between two peaks. This means that the returned value should be something like a distance.


Method Summary
 double distance(Type peak1, Type peak2)
          The function to implement for the calculation of the distance between two peaks.
 

Method Detail

distance

double distance(Type peak1,
                Type peak2)
The function to implement for the calculation of the distance between two peaks. Any distance can apply, such as the distance in scans or more advanced algorithms as are needed. The resulting distance must always be positive, as a negative value causes the algorithm to discard this match.

When -1 is returned the two peaks are considered incomparable and will never be linked.

Parameters:
peak1 - The first peak.
peak2 - The second peak.
Returns:
A positive value defining the distance between the two peaks.