Exemplo n.º 1
0
 public TestPair(DatabaseIndex probe, DatabaseIndex candidate)
 {
     Probe     = probe;
     Candidate = candidate;
 }
Exemplo n.º 2
0
 public IEnumerable <TestPair> GetAllPairs(DatabaseIndex probe)
 {
     return(GetMatchingPairs(probe).Concat(GetNonMatchingPairs(probe)));
 }
Exemplo n.º 3
0
 public View this[DatabaseIndex index]
 {
     get { return(Fingers[index.Finger].Views[index.View]); }
 }
Exemplo n.º 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));
 }
Exemplo n.º 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));
 }
Exemplo n.º 6
0
 public IEnumerable <TestPair> GetMatchingPairs(DatabaseIndex probe)
 {
     return((from candidate in GetConsequentViews(probe)
             select new TestPair(probe, candidate)).Take(MatchingPerProbe));
 }
Exemplo n.º 7
0
 public IEnumerable <DatabaseIndex> GetConsequentViews(DatabaseIndex probe)
 {
     return(GetSelfAndConsequentViews(probe).Skip(1));
 }
Exemplo n.º 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));
 }