예제 #1
0
 public TestPair(DatabaseIndex probe, DatabaseIndex candidate)
 {
     Probe     = probe;
     Candidate = candidate;
 }
예제 #2
0
 public IEnumerable <TestPair> GetAllPairs(DatabaseIndex probe)
 {
     return(GetMatchingPairs(probe).Concat(GetNonMatchingPairs(probe)));
 }
예제 #3
0
 public View this[DatabaseIndex index]
 {
     get { return(Fingers[index.Finger].Views[index.View]); }
 }
예제 #4
0
 public IEnumerable <TestPair> GetNonMatchingPairs(DatabaseIndex probe)
 {
     return((from view in GetSelfAndConsequentViews(probe)
             from candidate in GetConsequentFingers(view)
             select new TestPair(probe, candidate)).Take(NonMatchingPerProbe));
 }
예제 #5
0
 public IEnumerable <DatabaseIndex> GetConsequentFingers(DatabaseIndex probe)
 {
     return(from offset in Enumerable.Range(1, FingerCount - 1)
            select new DatabaseIndex((probe.Finger + offset) % FingerCount, probe.View));
 }
예제 #6
0
 public IEnumerable <TestPair> GetMatchingPairs(DatabaseIndex probe)
 {
     return((from candidate in GetConsequentViews(probe)
             select new TestPair(probe, candidate)).Take(MatchingPerProbe));
 }
예제 #7
0
 public IEnumerable <DatabaseIndex> GetConsequentViews(DatabaseIndex probe)
 {
     return(GetSelfAndConsequentViews(probe).Skip(1));
 }
예제 #8
0
 public IEnumerable <DatabaseIndex> GetSelfAndConsequentViews(DatabaseIndex probe)
 {
     return(from offset in Enumerable.Range(0, ViewCount)
            select new DatabaseIndex(probe.Finger, (probe.View + offset) % ViewCount));
 }