Satsuma
a delicious .NET graph library
|
Adaptor for storing a matching 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) |
void | Clear () |
Reverts the object to its default state. More... | |
void | Enable (Arc arc, bool enabled) |
Enables/disables an arc (adds/removes it from the matching). More... | |
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... | |
Arc | MatchedArc (Node node) |
Gets the matching arc which contains the given node. More... | |
Matching (IGraph graph) | |
int | NodeCount () |
Returns the total number of nodes in O(1) time. More... | |
IEnumerable< Node > | Nodes () |
Returns all nodes of the graph. More... | |
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... | |
Properties | |
IGraph | Graph [get, set] |
Adaptor for storing a matching of an underlying graph.
The Node and Arc set of the adaptor is a subset of that of the original graph. The underlying graph can be modified while using this adaptor, as long as no matched nodes and matching arcs are deleted.
Definition at line 29 of file Matching.cs.
Satsuma.Matching.Matching | ( | IGraph | graph | ) |
Definition at line 37 of file Matching.cs.
int Satsuma.Matching.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 145 of file Matching.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 150 of file Matching.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 156 of file Matching.cs.
Returns all arcs of the graph satisfying a given filter.
filter | Cannot be ArcType.Forward/ArcType.Backward.
|
Implements Satsuma.IGraph.
Definition at line 110 of file Matching.cs.
Returns all arcs adjacent to a specific node satisfying a given filter.
filter |
|
Implements Satsuma.IGraph.
Definition at line 125 of file Matching.cs.
Returns all arcs adjacent to two nodes satisfying a given filter.
filter |
|
Implements Satsuma.IGraph.
Definition at line 131 of file Matching.cs.
void Satsuma.Matching.Clear | ( | ) |
Reverts the object to its default state.
Implements Satsuma.IClearable.
Definition at line 47 of file Matching.cs.
void Satsuma.Matching.Enable | ( | Arc | arc, |
bool | enabled | ||
) |
Enables/disables an arc (adds/removes it from the matching).
If the arc is already enabled/disabled, does nothing.
arc | An arc of Graph. |
ArgumentException | Trying to enable an illegal arc. |
Definition at line 58 of file Matching.cs.
bool Satsuma.Matching.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 171 of file Matching.cs.
bool Satsuma.Matching.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 166 of file Matching.cs.
bool Satsuma.Matching.IsEdge | ( | Arc | arc | ) |
Returns whether the arc is undirected (true
) or directed (false
).
Implements Satsuma.IArcLookup.
Definition at line 100 of file Matching.cs.
Gets the matching arc which contains the given node.
Equivalent to Arcs(node).FirstOrDefault()
, but should be faster.
node | A node of Graph. |
Implements Satsuma.IMatching.
Definition at line 84 of file Matching.cs.
int Satsuma.Matching.NodeCount | ( | ) |
Returns the total number of nodes in O(1) time.
Implements Satsuma.IGraph.
Definition at line 140 of file Matching.cs.
IEnumerable<Node> Satsuma.Matching.Nodes | ( | ) |
Returns all nodes of the graph.
Implements Satsuma.IGraph.
Definition at line 105 of file Matching.cs.
Returns the first node of an arc. Directed arcs point from U to V.
Implements Satsuma.IArcLookup.
Definition at line 90 of file Matching.cs.
Returns the second node of an arc. Directed arcs point from U to V.
Implements Satsuma.IArcLookup.
Definition at line 95 of file Matching.cs.
|
getset |
Definition at line 31 of file Matching.cs.