private static void CalculateDepth(Dictionary <int, HashSet <int> > depths, TransitionElement transEl) { var depthFound = false; var depth = 0; while (!depthFound) { depthFound = !depths.ContainsKey(depth) || !depths[depth].Any(d => transEl.A <= d && d < transEl.B); if (!depthFound) { depth++; } } transEl.Depth = depth; if (!depths.ContainsKey(transEl.Depth)) { depths[transEl.Depth] = new HashSet <int>(); } depths[transEl.Depth].UnionWith(Enumerable.Range(transEl.A, transEl.B - transEl.A)); }
private static void CalculateDepth(Dictionary<int, HashSet<int>> depths, TransitionElement transEl) { var depthFound = false; var depth = 0; while (!depthFound) { depthFound = !depths.ContainsKey(depth) || !depths[depth].Any(d => transEl.A <= d && d < transEl.B); if (!depthFound) depth++; } transEl.Depth = depth; if (!depths.ContainsKey(transEl.Depth)) depths[transEl.Depth] = new HashSet<int>(); depths[transEl.Depth].UnionWith(Enumerable.Range(transEl.A, transEl.B - transEl.A)); }