public void Reset() { // Assumes Reset is called on a truly new Wave. var initial = new EntropyValues(); initial.PlogpSum = 0; initial.Sum = 0; initial.Entropy = 0; for (int pattern = 0; pattern < patternCount; pattern++) { var f = frequencies[pattern]; var v = f > 0 ? f * Math.Log(f) : 0.0; initial.PlogpSum += v; initial.Sum += f; } initial.RecomputeEntropy(); heap.Clear(); for (int index = 0; index < indexCount; index++) { if (mask == null || mask[index]) { var ev = entropyValues[index] = new EntropyValues(initial); ev.Index = index; ev.Tiebreaker = randomDouble() * 1e-10; heap.Insert(ev); } } ((ITracker)tracker).Reset(); }
public EntropyValues(EntropyValues other) { PlogpSum = other.PlogpSum; Sum = other.Sum; Entropy = other.Entropy; }