[IoId("00000000-51ec-4119-95bc-40ccf7b0142a")] public sealed class Edges : IStorable, IEquatable<Edges>
Maintains an immutable list of Edge instances and associated attributes.

Constructors

Edges

#
public Edges(Edge[] nodes, MetaData[] attributes)
nodes (Edge[])
attributes (MetaData[])

Edges

#
public Edges(IReader reader)
reader (IReader)

Properties

Backwards

#
public IEnumerable<Edge> Backwards { get; }
Enumerate over all nodes in a backwards fashion.

BackwardsWithAttributes

#
public IEnumerable<(Edge edge, MetaData attributes)> BackwardsWithAttributes { get; }
Enumerate over all nodes in a backwards fashion.

Count

#
public int Count { get; }
Gets the number of edges in this collection.

Forwards

#
public IEnumerable<Edge> Forwards { get; }
Enumerate over all nodes in a forwards fashion.

ForwardsWithAttributes

#
public IEnumerable<(Edge edge, MetaData attributes)> ForwardsWithAttributes { get; }
Enumerate over all nodes in a forwards fashion.

Indexers

this[]

#
public (Edge edge, MetaData attributes) this[int index, bool lookupAttributes] { get; }
Gets the edge and its attributes at the given index.
index (int)
lookupAttributes (bool)

this[]

#
public Edge this[int index] { get; }
Gets the edge at the given index.
index (int)

Methods

Attributes

#
public MetaData Attributes(int index)
Gets the attributes associated with the given index. Note; the index here does NOT represent the edge, but the attributes.
index (int)

BothWaysCount

#
public int BothWaysCount(int nodeIndex)
Gets the number of two-way edges that start or end end at the given node index.
nodeIndex (int)

BothWaysEdges

#
public IEnumerable<int> BothWaysEdges(int nodeIndex)
Iterate over the indices of all two-way edges that start or end at the given node index.
nodeIndex (int)

Clean

#
public Edges Clean()
Cleanup this list of edges. This involves removing unused attributes and merging identical attributes.

EdgeLines

#
public IEnumerable<(Line line, MetaData attributes)> EdgeLines(Nodes nodes)
Iterate over all lines implied by the edges.
nodes (Nodes)Nodes indexed by these edges.

Equals

#
public bool Equals(Edges other)
other (Edges)

Equals

#
public override bool Equals(object obj)
obj (object)
Object.Equals

FlipAll

#
public Edges FlipAll(bool flipOneWay = true, bool flipTwoWay = true)
Flip the Edge.A and Edge.B fields of all edges.
flipOneWay (bool = true)
flipTwoWay (bool = true)

GetHashCode

#
public override int GetHashCode()

IncomingCount

#
public int IncomingCount(int nodeIndex)
Gets the number of one-way edges that end at the given node index.
nodeIndex (int)

IncomingEdges

#
public IEnumerable<int> IncomingEdges(int nodeIndex)
Iterate over the indices of all one-way edges that end at the given node index.
nodeIndex (int)

LocalReach

#
public IEnumerable<int> LocalReach(int nodeIndex, int steps)
Enumerate over all node indices which can be reached with N steps from a given node.
nodeIndex (int)
steps (int)

MakeAllOneWay

#
public Edges MakeAllOneWay()
Make all edges one-way.

MakeAllTwoWay

#
public Edges MakeAllTwoWay()
Make all edges two-way.

Merge

#
public static Edges Merge(Edges a, Edges b, int indexBump)
Merge two edge arrays.
a (Edges)First set.
b (Edges)Second set.
indexBump (int)Amount to add to all vertex indices in the B set. Basically this is usually the length of the node list associated with the a set.

OutgoingCount

#
public int OutgoingCount(int nodeIndex)
Gets the number of one-way edges that start at the given node index.
nodeIndex (int)

OutgoingEdges

#
public IEnumerable<int> OutgoingEdges(int nodeIndex)
Iterate over the indices of all one-way edges that start at the given node index.
nodeIndex (int)

Store

#
public void Store(IWriter writer)
writer (IWriter)
Store

ToAttributeArray

#
public MetaData[] ToAttributeArray()
Create a duplicate of the attribute array.

TotalCount

#
public int TotalCount(int nodeIndex)
Gets the total number of edges that start or end end at the given node index.
nodeIndex (int)

TotalEdges

#
public IEnumerable<int> TotalEdges(int nodeIndex)
Iterate over all edge indices which connect to the given node.
nodeIndex (int)

WithoutAttributes

#
public Edges WithoutAttributes()
Remove all attributes from this node list.