public <T extends Edge> T getEdgeToward(int index) { T e; elementLock.lock(); e = sg.getEdge(wrappedElement.getEdgeToward(index).getIndex()); elementLock.unlock(); return e; }
public <T extends Edge> T getEdgeToward(String id) { T e; elementLock.lock(); e = sg.getEdge(wrappedElement.getEdgeToward(id).getIndex()); elementLock.unlock(); return e; }
public <T extends Edge> T getEdgeToward(Node n) { T e; elementLock.lock(); e = sg.getEdge(wrappedElement.getEdgeToward(n).getIndex()); elementLock.unlock(); return e; }
public <T extends Edge> T getEdgeToward(Node n) { T e; elementLock.lock(); e = sg.getEdge(wrappedElement.getEdgeToward(n).getIndex()); elementLock.unlock(); return e; }
public <T extends Edge> T getEdgeToward(int index) { T e; elementLock.lock(); e = sg.getEdge(wrappedElement.getEdgeToward(index).getIndex()); elementLock.unlock(); return e; }
public <T extends Edge> T getEdgeToward(String id) { T e; elementLock.lock(); e = sg.getEdge(wrappedElement.getEdgeToward(id).getIndex()); elementLock.unlock(); return e; }
protected void constructNextPath() { if (nodes.isEmpty()) { nextPath = null; return; } nextPath = new Path(); nextPath.setRoot(source); for (int i = nodes.size() - 1; i > 0; i--) nextPath.add(nodes.get(i).getEdgeToward( nodes.get(i - 1).getId())); }
protected void constructNextPath() { if (nodes.isEmpty()) { nextPath = null; return; } nextPath = new Path(); nextPath.setRoot(source); for (int i = nodes.size() - 1; i > 0; i--) nextPath.add(nodes.get(i).getEdgeToward( nodes.get(i - 1).getId())); }
public Path getShortestPathTo(String other) { TargetPath tpath = targets.get(other); // XXX Probably a bug here in the Path class usage. // TODO update this to create an edge path to be compatible with // multi-graphs. if (tpath != null) { Path path = new Path(); // XXX use the Path object directly. ArrayList<Node> nodePath = new ArrayList<Node>(); nodePath.add(source); nodePath.add(tpath.target); // Recursively build the path between the source and target node // by exploring pass-by nodes. expandPath(1, this, tpath, nodePath); // Build a Path object. for (int i = 0; i < nodePath.size() - 1; ++i) { // XXX XXX complicated ? path.add( nodePath.get(i), nodePath.get(i).getEdgeToward( nodePath.get(i + 1).getId())); } return path; } return null; }
public Path getShortestPathTo(String other) { TargetPath tpath = targets.get(other); // XXX Probably a bug here in the Path class usage. // TODO update this to create an edge path to be compatible with // multi-graphs. if (tpath != null) { Path path = new Path(); // XXX use the Path object directly. ArrayList<Node> nodePath = new ArrayList<Node>(); nodePath.add(source); nodePath.add(tpath.target); // Recursively build the path between the source and target node // by exploring pass-by nodes. expandPath(1, this, tpath, nodePath); // Build a Path object. for (int i = 0; i < nodePath.size() - 1; ++i) { // XXX XXX complicated ? path.add( nodePath.get(i), nodePath.get(i).getEdgeToward( nodePath.get(i + 1).getId())); } return path; } return null; }
public <T extends Edge> T removeEdge(Node node1, Node node2) { AbstractEdge edge = node1.getEdgeToward(node2); if (edge == null) { if (strictChecking) throw new ElementNotFoundException( "There is no edge from \"%s\" to \"%s\". Cannot remove it.", node1.getId(), node2.getId()); return null; } return removeEdge(edge); }
public <T extends Edge> T removeEdge(Node node1, Node node2) { AbstractEdge edge = node1.getEdgeToward(node2); if (edge == null) { if (strictChecking) throw new ElementNotFoundException( "There is no edge from \"%s\" to \"%s\". Cannot remove it.", node1.getId(), node2.getId()); return null; } return removeEdge(edge); }
public void compute() { if (graph == null) throw new NotInitializedException(this); int m = graph.getNodeCount(); RealMatrix a = new Array2DRowRealMatrix(m, m); Edge e; for (int idx1 = 0; idx1 < m; idx1++) for (int idx2 = 0; idx2 < m; idx2++) { e = graph.getNode(idx1).getEdgeToward(idx2); a.setEntry(idx1, idx2, e != null ? 1 : 0); } decomposition = new EigenDecomposition(a, 0); }
public void compute() { if (graph == null) throw new NotInitializedException(this); int m = graph.getNodeCount(); RealMatrix a = new Array2DRowRealMatrix(m, m); Edge e; for (int idx1 = 0; idx1 < m; idx1++) for (int idx2 = 0; idx2 < m; idx2++) { e = graph.getNode(idx1).getEdgeToward(idx2); a.setEntry(idx1, idx2, e != null ? 1 : 0); } decomposition = new EigenDecomposition(a, 0); }
for (int j = 0; j < n; ++j) if (j != i) { Edge e = nodes[j].getEdgeToward(nodes[i].getId());
for (int j = 0; j < n; ++j) if (j != i) { Edge e = nodes[j].getEdgeToward(nodes[i].getId());
if (e.hasAttribute(weightMarker)) if (e.isDirected()) { Edge e2 = v.getEdgeToward(u.getId()); if (e2 != null && e2.hasAttribute(weightMarker)) weight = (Double) e.getAttribute(weightMarker)
if (e.hasAttribute(weightMarker)) if (e.isDirected()) { Edge e2 = v.getEdgeToward(u.getId()); if (e2 != null && e2.hasAttribute(weightMarker)) weight = (Double) e.getAttribute(weightMarker)