assertEquals(graph.getOutDegree(nrow), OUTDEGREE[nrow]);
// check edges
Iterator eiter = node.inEdges();
while ( eiter.hasNext() ) {
Edge edge = (Edge)eiter.next();
int erow = edge.getRow();
assertEquals(nrow, edge.getTargetNode().getRow());
assertEquals(nrow, graph.getTargetNode(erow));
}
eiter = node.outEdges();
while ( eiter.hasNext() ) {
Edge edge = (Edge)eiter.next();
int erow = edge.getRow();
assertEquals(nrow, edge.getSourceNode().getRow());
assertEquals(nrow, graph.getSourceNode(erow));
}
}
// check all edges, basic data
Iterator eiter = graph.edges();
while ( eiter.hasNext() ) {
Edge edge = (Edge)eiter.next();
int erow = edge.getRow();
// check data members
for ( int i=0; i<NEDGECOLS; ++i ) {
assertEquals(EDGES[i][erow], edge.get(EHEADERS[i]));
assertEquals(EDGES[i][erow], edges.get(erow, EHEADERS[i]));
}
// check nodes
Node s = edge.getSourceNode();
int srow = s.getRow();
assertEquals(srow, graph.getSourceNode(erow));
int sk = nodes.getInt(srow, NHEADERS[0]);
assertEquals(sk, edges.getInt(erow, EHEADERS[0]));
Node t = edge.getTargetNode();
int trow = t.getRow();
assertEquals(trow, graph.getTargetNode(erow));
int tk = nodes.getInt(trow, NHEADERS[0]);
assertEquals(tk, edges.getInt(erow, EHEADERS[1]));
assertEquals(srow, edge.getAdjacentNode(t).getRow());
assertEquals(trow, edge.getAdjacentNode(s).getRow());
assertEquals(srow, graph.getAdjacentNode(erow, trow));
assertEquals(trow, graph.getAdjacentNode(erow, srow));
}
}