/** * DOCUMENT ME! * * @return DOCUMENT ME! */ public GraphPerspective getGraphPerspective() { return m_rootGraph.createGraphPerspective(m_rootGraph.getNodeMetaChildIndicesArray(m_rootGraphIndex), m_rootGraph.getEdgeMetaChildIndicesArray(m_rootGraphIndex)); }
public GraphPerspective getGraphPerspective() { return m_rootGraph.createGraphPerspective(m_rootGraph.getNodeMetaChildIndicesArray(m_rootGraphIndex), m_rootGraph.getEdgeMetaChildIndicesArray(m_rootGraphIndex)); }
/** * DOCUMENT ME! * * @param args DOCUMENT ME! */ public static void main(String[] args) { final RootGraph root = FingRootGraphFactory.instantiateRootGraph(); final DynamicGraph dGraph = (DynamicGraph) root; dGraph.nodes(); final GraphPerspective persp = root.createGraphPerspective((int[]) null, (int[]) null); final FixedGraph fGraph = (FixedGraph) persp; fGraph.edges(); } }
/** * 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"); } }
/** * 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(); } } }
System.out.println("creating GraphPerspective"); GraphPerspective persp = root.createGraphPerspective(nodeInx, edgeInx);
if (root.createGraphPerspective(twoNodes, null).getNodeCount() != 2) throw new IllegalStateException("GraphPerspective does not have two nodes"); if (root.createGraphPerspective(null, twoEdges).getEdgeCount() != 2) 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(twoNodes, twoEdges).getEdgeCount() < 2) throw new IllegalStateException("GraphPerspective has less than two edges"); if (root.createGraphPerspective((Node[]) null, (Edge[]) null) == null) throw new IllegalStateException("GraphPerspective is null"); if (root.createGraphPerspective(new Node[0], new Edge[0]) == null) throw new IllegalStateException("GraphPerspective is null"); if (root.createGraphPerspective(new Node[] { root2Node }, null) != null) throw new IllegalStateException("GraphPerspective is not null"); if (root.createGraphPerspective(null, new Edge[] { root2Edge }) != null) throw new IllegalStateException("GraphPerspective is not null"); if (root.createGraphPerspective(new Node[] { twoNodes[0], root2Node }, new Edge[] { twoEdges[0], root2Edge }) != null) throw new IllegalStateException("GraphPerspective is not null"); if (root.createGraphPerspective(twoNodeInx, null).getNodeCount() != 2)
final GraphPerspective persp = root.createGraphPerspective((int[]) null, (int[]) null); int[] nodeInx = new int[5];