void IMutableIncidenceGraph <TVertex, TEdge> .ClearOutEdges(TVertex v)
 {
     IMutableIncidenceGraph <TVertex, TEdge> ithis = this;
     //Contract.Requires(v != null);
     //Contract.Requires(ithis.ContainsVertex(v));
     //Contract.Ensures(ithis.OutDegree(v) == 0);
 }
Ejemplo n.º 2
0
		public void RemoveOutEdgeIf(IMutableIncidenceGraph g)
		{
			IVertex u = g.AddVertex();
			IVertex v = g.AddVertex();
			IVertex w = g.AddVertex();
			IEdge e = g.AddEdge(u,v);
			g.AddEdge(u,w);

			g.RemoveOutEdgeIf(u,new DummyEdgeEqualPredicate(e,false));
			g.RemoveOutEdgeIf(u,new DummyEdgeEqualPredicate(e,true));
		}
Ejemplo n.º 3
0
        public void RemoveOutEdgeIf(IMutableIncidenceGraph g)
        {
            IVertex u = g.AddVertex();
            IVertex v = g.AddVertex();
            IVertex w = g.AddVertex();
            IEdge   e = g.AddEdge(u, v);

            g.AddEdge(u, w);

            g.RemoveOutEdgeIf(u, new DummyEdgeEqualPredicate(e, false));
            g.RemoveOutEdgeIf(u, new DummyEdgeEqualPredicate(e, true));
        }
Ejemplo n.º 4
0
        int IMutableIncidenceGraph <TVertex, TEdge> .RemoveOutEdgeIf(
            TVertex v,
            EdgePredicate <TVertex, TEdge> predicate)
        {
            IMutableIncidenceGraph <TVertex, TEdge> ithis = this;

            Contract.Requires(v != null);
            Contract.Requires(ithis.ContainsVertex(v));
            Contract.Requires(predicate != null);
            Contract.Ensures(Contract.Result <int>() == Contract.OldValue(ithis.OutEdges(v).Count(ve => predicate(ve))));
            Contract.Ensures(ithis.OutEdges(v).All(ve => !predicate(ve)));

            return(default(int));
        }