private IEnumerable <ulong> CountSubFingerprintMatches(int[] hashes, int thresholdVotes) { var results = new List <ulong> [hashes.Length]; for (int table = 0; table < hashes.Length; ++table) { int hashBin = hashes[table]; results[table] = storage.GetSubFingerprintsByHashTableAndHash(table, hashBin); } return(SubFingerprintGroupingCounter.GroupByAndCount(results, thresholdVotes)); }
public void ShouldGroupAndCountCorrectly() { var tablesCount = 25; var count = 100; var lists = new List <uint> [tablesCount]; for (int i = 0; i < lists.Length; i++) { lists[i] = Enumerable.Range(0, count).ToList().Select(entry => (uint)entry).ToList(); } var groupingResult = SubFingerprintGroupingCounter.GroupByAndCount(lists, 5).ToList(); Assert.AreEqual(count, groupingResult.Count); }
public IEnumerable <uint> GroupByAndCount(List <uint>[] results, int thresholdVotes) { return(SubFingerprintGroupingCounter.GroupByAndCount(results, thresholdVotes)); }