Ejemplo n.º 1
0
        public SEquatableEdge <TVertex> ToVertexPair <TVertex, TEdge>(TEdge edge)
            where TEdge : IEdge <TVertex>
        {
            // TODO: add assertions to method EdgeExtensionsTest.ToVertexPair(IEdge`1<!!0>)
            SEquatableEdge <TVertex> result = EdgeExtensions.ToVertexPair <TVertex, TEdge>(edge);

            return(result);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Indicates whether the current object is equal to another object of the same type.
        /// </summary>
        /// <param name="other">An object to compare with this object.</param>
        /// <returns>
        /// true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.
        /// </returns>
        public bool Equals(SEquatableEdge <TVertex> other)
        {
            //Contract.Ensures(
            //Contract.Result<bool>() ==
            //   (this.Source.Equals(other.Source) &&
            //    this.Target.Equals(other.Target))
            //   );

            return
                (this.source.Equals(other.source) &&
                 this.target.Equals(other.target));
        }
Ejemplo n.º 3
0
        public bool TryGetEdges(
            TVertex source,
            TVertex target,
            out IEnumerable <SEquatableEdge <TVertex> > edges)
        {
            if (this.ContainsEdge(source, target))
            {
                edges = new SEquatableEdge <TVertex>[] { new SEquatableEdge <TVertex>(source, target) };
                return(true);
            }

            edges = null;
            return(false);
        }
Ejemplo n.º 4
0
        public bool TryGetEdge(
            TVertex source,
            TVertex target,
            out SEquatableEdge <TVertex> edge)
        {
            if (this.ContainsEdge(source, target))
            {
                edge = new SEquatableEdge <TVertex>(source, target);
                return(true);
            }

            edge = default(SEquatableEdge <TVertex>);
            return(false);
        }
Ejemplo n.º 5
0
 public bool ContainsEdge(SEquatableEdge <TVertex> edge)
 {
     return(ContainsEdge(edge.Source, edge.Target));
 }