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