public bool Add(int source, int target, DependencyKinds kinds, out Edge edge) { edge = null; var value = m_Matrix[source, target]; if (value == kinds) return false; m_Matrix[source, target] = value | kinds; edge = new Edge(source, target, kinds); return true; }
public static IEnumerable <DependencyKinds> Flatten(this DependencyKinds kinds) { foreach (DependencyKind kind in Enum.GetValues(typeof(DependencyKind))) { var mask = kind.ToFlags(); var matches = kinds & mask; if (matches == DependencyKinds.None) { continue; } yield return(mask); } }
public bool Add(int source, int target, DependencyKinds kinds, out Edge edge) { edge = null; var value = m_Matrix[source, target]; if (value == kinds) { return(false); } m_Matrix[source, target] = value | kinds; edge = new Edge(source, target, kinds); return(true); }
public Edge(int source, int target, DependencyKinds kinds) { m_Source = source; m_Target = target; m_Kinds = kinds; }