private static void printme(RootGraph root, GraphPerspective persp) { System.out.println("in RootGraph: " + root.getNodeCount() + " nodes and " + root.getEdgeCount() + " edges"); System.out.println("in GraphPerspective: " + persp.getNodeCount() + " nodes and " + persp.getEdgeCount() + " edges"); System.out.println(); }
/** * DOCUMENT ME! * * @param args DOCUMENT ME! */ public static void main(String[] args) { final RootGraph root = FingRootGraphFactory.instantiateRootGraph(); final int[] nodeInx = root.createNodes(10000); final int[] edgeInx = new int[100000]; for (int i = 0; i < edgeInx.length; i++) edgeInx[i] = root.createEdge(nodeInx[i % nodeInx.length], nodeInx[(i * 3) % nodeInx.length]); System.out.println("RootGraph node count: " + root.getNodeCount()); System.out.println("RootGraph edge count: " + root.getEdgeCount()); System.out.println(); for (int i = 0; i < 1000; i++) { GraphPerspective persp = root.createGraphPerspective(nodeInx, edgeInx); System.out.println("GraphPerspective node count: " + persp.getNodeCount()); System.out.println("GraphPerspective edge count: " + persp.getEdgeCount()); System.out.println(); } } }
/** * DOCUMENT ME! * * @param args DOCUMENT ME! */ public static void main(String[] args) { final RootGraph root = FingRootGraphFactory.instantiateRootGraph(); final int n1 = root.createNode(); final int n2 = root.createNode(); final int e1 = root.createEdge(n1, n1, /* directed */ true); final GraphPerspective persp = root.createGraphPerspective((int[]) null, (int[]) null); if (persp.restoreEdge(e1) == 0) throw new IllegalStateException("could not restore valid edge"); final GraphPerspective persp2 = root.createGraphPerspective(null, new int[] { e1 }); if (!((persp2.getNodeCount() == 1) && (persp2.getEdgeCount() == 1))) throw new IllegalStateException("bad counts in perspective"); } }
if ((childGP == null) || (childGP.getNodeCount() == 0)) { throw new IllegalStateException("Node " + node.getIdentifier() + " has a non-empty array "
if (root.createGraphPerspective(twoNodes, null).getNodeCount() != 2) throw new IllegalStateException("GraphPerspective does not have two nodes"); throw new IllegalStateException("GraphPerspective does not have two edges"); if (root.createGraphPerspective(twoNodes, twoEdges).getNodeCount() < 2) throw new IllegalStateException("GraphPerspective has less than two nodes"); }; if (root.createGraphPerspective(twoNodeInx, null).getNodeCount() != 2) throw new IllegalStateException("GraphPerspective does not have two nodes"); throw new IllegalStateException("GraphPerspective does not have two edges"); if (root.createGraphPerspective(twoNodeInx, twoEdgeInx).getNodeCount() < 2) throw new IllegalStateException("GraphPerspective has less than two nodes");
if ((persp2.getNodeCount() != persp.getNodeCount()) || (persp2.getEdgeCount() != persp.getEdgeCount())) throw new IllegalStateException("clone has different topology"); throw new IllegalStateException("some edges in clone remaining"); if (persp2.getNodeCount() != persp.getNodeCount()) throw new IllegalStateException("node counts should still be the same"); throw new IllegalStateException("cannot hide node in clone"); if ((persp2.getNodeCount() != 0) || (persp2.getEdgeCount() != 0)) throw new IllegalStateException("nodes or edges remaining"); if (persp.getNodeCount() != 5) throw new IllegalStateException("wrong number of nodes");