/// <summary>same as incrementCount(List, double) but as if Object o were at the end of the list</summary> public virtual void IncrementCount(IList <K> l, K o, double count) { if (l.Count != depth - 1) { WrongDepth(); } GeneralizedCounter <K> next = this; foreach (K o2 in l) { next.AddToTotal(count); next = next.ConditionalizeHelper(o2); } next.AddToTotal(count); next.IncrementCount1D(o, count); }
/// <summary> /// Adds to count for the /// <see cref="GeneralizedCounter{K}.Depth()"/> /// -dimensional key /// <paramref name="l"/> /// . /// </summary> public virtual void IncrementCount(IList <K> l, double count) { if (l.Count != depth) { WrongDepth(); } //throws exception GeneralizedCounter <K> next = this; IEnumerator <K> i = l.GetEnumerator(); K o = i.Current; while (i.MoveNext()) { next.AddToTotal(count); next = next.ConditionalizeHelper(o); o = i.Current; } next.IncrementCount1D(o, count); }