public static void Clearance(NodeHandle a, uint value) { value = Min(15, value); var mask = (NodeEdges)((ulong)value << 32); AllNodes.AddOrUpdate(a, mask, (key, e) => Clearance(e, value)); }
public static bool SetEdge(NodeHandle a, NodeHandle b, bool value) { long d = (long)((ulong)b & handleMask) - (long)((ulong)a & handleMask); if (!whichEdgeBit.ContainsKey(d)) { return(false); } var mask = (NodeEdges)(1ul << whichEdgeBit[d]); if (value) { AllNodes.AddOrUpdate(a, mask, (k, oldValue) => oldValue | mask); } else { AllNodes.AddOrUpdate(a, 0, (k, oldValue) => oldValue & ~mask); } return(true); }
public static void IsCover(NodeHandle a, bool value) => AllNodes.AddOrUpdate(a, value ? NodeEdges.IsCover : 0, (key, e) => IsCover(e, value));