예제 #1
0
        public void CleanXBasedOnY(BinaryString[] X, HashSet <BinaryString> Y, int matchingThreshold)
        {
            cleanedSet = new HashSet <BinaryString>(X);

            //for (int i = 0; i < Y.Count; i++)
            //{
            //    for (int j = 0; j < cleanedSet.Count; )
            //    {

            //        if (MatchingMachine.HammingDisWithThreshold(Y.ElementAt(i), cleanedSet.ElementAt(j), matchingThreshold))
            //        {
            //            cleanedSet.Remove(cleanedSet.ElementAt(j));
            //        }
            //        else
            //            j++;

            //    }
            //}
            foreach (var Yelement in Y)
            {
                for (int j = 0; j < cleanedSet.Count;)
                {
                    if (MatchingMachine.HammingDisWithThreshold(Yelement, cleanedSet.ElementAt(j), matchingThreshold))
                    {
                        cleanedSet.Remove(cleanedSet.ElementAt(j));
                    }
                    else
                    {
                        j++;
                    }
                }
            }
        }
 public void Computing(BinaryString[] detectorSet, BinaryString sample)
 {
     for (int i = 0; i < detectorSet.Length; i++)
     {
         Detector_Aff temp = new Detector_Aff()
         {
             Detector = detectorSet[i], Sample = sample, Distance = MatchingMachine.GetHammingDis(detectorSet[i], sample)
         };
         result.Add(temp);
     }
 }
예제 #3
0
 private double GetHA(BinaryString item1, BinaryString item2)
 {
     return(MatchingMachine.GetHammingDis(item1, item2));
 }