コード例 #1
0
        public override bool Equals(object o)
        {
            ModificationWithMass m = o as ModificationWithMass;

            return(m != null &&
                   base.Equals(m) &&
                   ApproxSequenceEqual(diagnosticIons, m.diagnosticIons, tolForEquality) &&
                   ApproxSequenceEqual(neutralLosses, m.neutralLosses, tolForEquality) &&
                   Math.Abs(monoisotopicMass - m.monoisotopicMass) < tolForEquality);
        }
コード例 #2
0
ファイル: ModificationWithMass.cs プロジェクト: NRTDP/mzLib
        public override bool Equals(object o)
        {
            ModificationWithMass m = o as ModificationWithMass;

            return(m == null ? false :

                   base.Equals(m)

                   && ((this.diagnosticIons == null || this.diagnosticIons.Count() == 0) && (m.diagnosticIons == null || m.diagnosticIons.Count() == 0) ||
                       this.diagnosticIons != null && m.diagnosticIons != null &&
                       this.diagnosticIons.OrderBy(x => x).SequenceEqual(m.diagnosticIons.OrderBy(x => x))) &&
                   (this.neutralLosses.OrderBy(x => x).SequenceEqual(m.neutralLosses.OrderBy(x => x))) &&
                   Math.Abs(this.monoisotopicMass - m.monoisotopicMass) < 1e-9);
        }