public int Compare(ICompareDescriptor other) { if (other == null) { return(1); } return(Intensity.CompareTo((other as Tempogram).Intensity)); }
/// <summary> /// Compare 2 peaks, for sorting by intensity. Follow Sort() call with a Reverse() call to get sorted by descending /// intensity /// </summary> /// <param name="obj"></param> /// <returns></returns> /// <remarks> /// Used by the sort algorithms to sort List of peaks in descending order of mdbl_intensity. /// Function used to sort peaks in a descending order. /// </remarks> public int CompareTo(Peak obj) { var result = Intensity.CompareTo(obj.Intensity); if (result == 0) { result = Mz.CompareTo(obj.Mz); } return(result); }
/// <summary> /// Compare the object with another instance of this class. /// </summary> /// /// <param name="value">Object to compare with.</param> /// /// <returns><para>A signed number indicating the relative values of this instance and <b>value</b>: 1) greater than zero - /// this instance is greater than <b>value</b>; 2) zero - this instance is equal to <b>value</b>; /// 3) greater than zero - this instance is less than <b>value</b>.</para> /// /// <para><note>The sort order is descending.</note></para></returns> /// /// <remarks> /// <para><note>Object are compared using their <see cref="Intensity">intensity</see> value.</note></para> /// </remarks> /// public int CompareTo(object value) { return(-Intensity.CompareTo(((HoughLine)value).Intensity)); }