예제 #1
0
        public static Proportion GetLargest(IEnumerable <Proportion> proportions)
        {
            Proportion max = new Proportion(0, ulong.MaxValue);

            foreach (Proportion p in proportions)
            {
                if (p.AsDouble > max.AsDouble)
                {
                    max = p;
                }
            }
            return(max);
        }
 public FrequencyTrackerResult(MultiperiodFrequencyTracker <TKey> tracker, TKey key, IEnumerable <Proportion> proportions = null)
 {
     Tracker         = tracker;
     Key             = key;
     this.Proportion = new Proportion(0, ulong.MaxValue);
     if (proportions == null)
     {
         return;
     }
     foreach (Proportion proportion in proportions)
     {
         if (proportion.AsDouble > Proportion.AsDouble)
         {
             this.Proportion = proportion;
         }
     }
 }
 public Proportion Get(TKey key)
 {
     return(Proportion.GetLargest(
                PasswordFrequencyEstimatesForDifferentPeriods.Select(
                    (ft) => ft.Get(key))));
 }
 public FrequencyTrackerResult(MultiperiodFrequencyTracker <TKey> tracker, TKey key, Proportion proportion)
 {
     Tracker         = tracker;
     Key             = key;
     this.Proportion = proportion;
 }