Satsuma
a delicious .NET graph library
|
Adaptor for reversing all arcs of an underlying graph. More...
Public Member Functions | |
int | ArcCount (ArcFilter filter=ArcFilter.All) |
Returns the total number of arcs satisfying a given filter. More... | |
int | ArcCount (Node u, ArcFilter filter=ArcFilter.All) |
Returns the number of arcs adjacent to a specific node satisfying a given filter. More... | |
int | ArcCount (Node u, Node v, ArcFilter filter=ArcFilter.All) |
Returns the number of arcs adjacent to two nodes satisfying a given filter. More... | |
IEnumerable< Arc > | Arcs (ArcFilter filter=ArcFilter.All) |
IEnumerable< Arc > | Arcs (Node u, ArcFilter filter=ArcFilter.All) |
IEnumerable< Arc > | Arcs (Node u, Node v, ArcFilter filter=ArcFilter.All) |
bool | HasArc (Arc arc) |
Returns whether the given arc is contained in the graph. More... | |
bool | HasNode (Node node) |
Returns whether the given node is contained in the graph. More... | |
bool | IsEdge (Arc arc) |
Returns whether the arc is undirected (true ) or directed (false ). More... | |
int | NodeCount () |
Returns the total number of nodes in O(1) time. More... | |
IEnumerable< Node > | Nodes () |
Returns all nodes of the graph. More... | |
ReverseGraph (IGraph graph) | |
Node | U (Arc arc) |
Returns the first node of an arc. Directed arcs point from U to V. More... | |
Node | V (Arc arc) |
Returns the second node of an arc. Directed arcs point from U to V. More... | |
Static Public Member Functions | |
static ArcFilter | Reverse (ArcFilter filter) |
Returns the opposite of an arc filter. More... | |
Adaptor for reversing all arcs of an underlying graph.
Node and Arc objects are interchangeable between the adaptor and the original graph. The underlying graph can be freely modified while using this adaptor.
Definition at line 34 of file ReverseGraph.cs.
Satsuma.ReverseGraph.ReverseGraph | ( | IGraph | graph | ) |
Definition at line 46 of file ReverseGraph.cs.
int Satsuma.ReverseGraph.ArcCount | ( | ArcFilter | filter = ArcFilter.All | ) |
Returns the total number of arcs satisfying a given filter.
filter | Detailed description: see Arcs(ArcFilter). |
Implements Satsuma.IGraph.
Definition at line 91 of file ReverseGraph.cs.
Returns the number of arcs adjacent to a specific node satisfying a given filter.
filter | Detailed description: see Arcs(Node, ArcFilter). |
Implements Satsuma.IGraph.
Definition at line 96 of file ReverseGraph.cs.
Returns the number of arcs adjacent to two nodes satisfying a given filter.
filter | Detailed description: see Arcs(Node, Node, ArcFilter). |
Implements Satsuma.IGraph.
Definition at line 101 of file ReverseGraph.cs.
Returns all arcs of the graph satisfying a given filter.
filter | Cannot be ArcType.Forward/ArcType.Backward.
|
Implements Satsuma.IGraph.
Definition at line 71 of file ReverseGraph.cs.
Returns all arcs adjacent to a specific node satisfying a given filter.
filter |
|
Implements Satsuma.IGraph.
Definition at line 76 of file ReverseGraph.cs.
Returns all arcs adjacent to two nodes satisfying a given filter.
filter |
|
Implements Satsuma.IGraph.
Definition at line 81 of file ReverseGraph.cs.
bool Satsuma.ReverseGraph.HasArc | ( | Arc | arc | ) |
Returns whether the given arc is contained in the graph.
Must return the same value as Arcs().Contains
in all implementations, but faster if possible.
true
may be returned for arcs coming from another graph as well, if those arcs encapsulate an identifier which is valid for this graph, too. Implements Satsuma.IGraph.
Definition at line 111 of file ReverseGraph.cs.
bool Satsuma.ReverseGraph.HasNode | ( | Node | node | ) |
Returns whether the given node is contained in the graph.
Must return the same value as Nodes().Contains
in all implementations, but faster if possible.
true
may be returned for nodes coming from another graph as well, if those nodes encapsulate an identifier which is valid for this graph, too. Implements Satsuma.IGraph.
Definition at line 106 of file ReverseGraph.cs.
bool Satsuma.ReverseGraph.IsEdge | ( | Arc | arc | ) |
Returns whether the arc is undirected (true
) or directed (false
).
Implements Satsuma.IArcLookup.
Definition at line 61 of file ReverseGraph.cs.
int Satsuma.ReverseGraph.NodeCount | ( | ) |
Returns the total number of nodes in O(1) time.
Implements Satsuma.IGraph.
Definition at line 86 of file ReverseGraph.cs.
IEnumerable<Node> Satsuma.ReverseGraph.Nodes | ( | ) |
Returns all nodes of the graph.
Implements Satsuma.IGraph.
Definition at line 66 of file ReverseGraph.cs.
Returns the opposite of an arc filter.
Definition at line 39 of file ReverseGraph.cs.
Returns the first node of an arc. Directed arcs point from U to V.
Implements Satsuma.IArcLookup.
Definition at line 51 of file ReverseGraph.cs.
Returns the second node of an arc. Directed arcs point from U to V.
Implements Satsuma.IArcLookup.
Definition at line 56 of file ReverseGraph.cs.