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); }
/// <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)); }
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); }
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); }
public bool ContainsEdge(SEquatableEdge <TVertex> edge) { return(ContainsEdge(edge.Source, edge.Target)); }