public class DefaultParallelEdgeIndexFunction<V,E> extends Object implements EdgeIndexFunction<V,E>
v.findEdgeSet(w) for some
v and w.
At this time, users are responsible for resetting the indices
(by calling reset()) if changes to the
graph make it appropriate.
| Modifier and Type | Field and Description |
|---|---|
protected Map<Context<Graph<V,E>,E>,Integer> |
edge_index |
| Modifier and Type | Method and Description |
|---|---|
int |
getIndex(Graph<V,E> graph,
E e)
Returns the index for
e in graph. |
protected int |
getIndex(Graph<V,E> graph,
E e,
V v) |
protected int |
getIndex(Graph<V,E> graph,
E e,
V v,
V u) |
static <V,E> DefaultParallelEdgeIndexFunction<V,E> |
getInstance() |
void |
reset()
Clears all edge indices for all edges in all graphs.
|
void |
reset(Graph<V,E> graph,
E e)
Resets the indices for this edge and its parallel edges.
|
public static <V,E> DefaultParallelEdgeIndexFunction<V,E> getInstance()
V - the vertex typeE - the edge typepublic int getIndex(Graph<V,E> graph, E e)
e in graph.
Calculates the indices for e and for all edges parallel
to e, if they are not already assigned.getIndex in interface EdgeIndexFunction<V,E>graph - the graph with respect to which the index is calculatede - the edge whose index is to be queriede's index in graphpublic void reset(Graph<V,E> graph, E e)
e
has been added or removed.reset in interface EdgeIndexFunction<V,E>graph - the graph for which the indices are to be resete - the edge whose indices are to be resetpublic void reset()
reset in interface EdgeIndexFunction<V,E>Copyright © 2016. All rights reserved.