Ejemplo n.º 1
0
        TEdge IImplicitGraph <TVertex, TEdge> .OutEdge(TVertex v, int index)
        {
            IImplicitGraph <TVertex, TEdge> ithis = this;

            Contract.Requires(v != null);
            Contract.Requires(ithis.ContainsVertex(v));
            Contract.Ensures(Enumerable.Any(ithis.OutEdges(v), e => e.Equals(Contract.Result <TEdge>())));

            return(default(TEdge));
        }
Ejemplo n.º 2
0
        int IImplicitGraph <TVertex, TEdge> .OutDegree(TVertex v)
        {
            IImplicitGraph <TVertex, TEdge> ithis = this;

            Contract.Requires(v != null);
            Contract.Requires(ithis.ContainsVertex(v));
            Contract.Ensures(Contract.Result <int>() == Enumerable.Count <TEdge>(ithis.OutEdges(v)));

            return(default(int));
        }
Ejemplo n.º 3
0
        bool IImplicitGraph <TVertex, TEdge> .IsOutEdgesEmpty(TVertex v)
        {
            IImplicitGraph <TVertex, TEdge> ithis = this;

            Contract.Requires(v != null);
            Contract.Requires(ithis.ContainsVertex(v));
            Contract.Ensures(Contract.Result <bool>() == (ithis.OutDegree(v) == 0));

            return(default(bool));
        }
Ejemplo n.º 4
0
        IEnumerable <TEdge> IImplicitGraph <TVertex, TEdge> .OutEdges(TVertex v)
        {
            IImplicitGraph <TVertex, TEdge> ithis = this;

            Contract.Requires(v != null);
            Contract.Requires(ithis.ContainsVertex(v));
            Contract.Ensures(Contract.Result <IEnumerable <TEdge> >() != null);
            Contract.Ensures(Enumerable.All(Contract.Result <IEnumerable <TEdge> >(), e => e.Source.Equals(v)));

            return(default(IEnumerable <TEdge>));
        }
Ejemplo n.º 5
0
        TEdge IImplicitGraph <TVertex, TEdge> .OutEdge(TVertex v, int index)
        {
            IImplicitGraph <TVertex, TEdge> ithis = this;

            Contract.Requires(v != null);
            Contract.Requires(ithis.ContainsVertex(v));
            Contract.Requires(index >= 0 && index < ithis.OutDegree(v));
            Contract.Ensures(
                Enumerable.ElementAt(ithis.OutEdges(v), index).Equals(Contract.Result <TEdge>()));

            return(default(TEdge));
        }
Ejemplo n.º 6
0
 public bool ContainsVertex(Vertex vertex)
 {
     return(_impl.ContainsVertex(vertex));
 }