Package com.intel.hadoop.graphbuilder.graph.glgraph

Examples of com.intel.hadoop.graphbuilder.graph.glgraph.SparseGraphStruct


    testEmptyGraph(100);
    testSmallGraph();
  }

  public void testEmptyGraph(int numVertices) {
    SparseGraphStruct tester = new SparseGraphStruct(numVertices);
    assertEquals("Num edges", 0, tester.numEdges());
    assertEquals("Num vertices", numVertices, tester.numVertices());
  }
View Full Code Here


  public void testSmallGraph() {
    ArrayList<Integer> source = new ArrayList<Integer>(Arrays.asList(0, 0, 0,
        2, 3));
    ArrayList<Integer> target = new ArrayList<Integer>(Arrays.asList(1, 3, 6,
        3, 4));
    SparseGraphStruct myCSR = new SparseGraphStruct(7, source, target);
    ArrayList<Integer> rowIndexExpect = new ArrayList<Integer>(Arrays.asList(0,
        -1, 3, 4, -1, -1, -1));
    ArrayList<Integer> colIndexExpect = new ArrayList<Integer>(Arrays.asList(1,
        3, 6, 3, 4));
    assertEquals("CSR row", rowIndexExpect, myCSR.getRowIndex());
    assertEquals("CSR col", colIndexExpect, myCSR.getColIndex());

    source = new ArrayList<Integer>(Arrays.asList(0, 0, 2, 3, 0));
    target = new ArrayList<Integer>(Arrays.asList(1, 3, 3, 4, 6));
    SparseGraphStruct myCSC = new SparseGraphStruct(7, target, source);
    rowIndexExpect = new ArrayList<Integer>(Arrays.asList(-1, 0, -1, 1, 3, -1,
        4));
    colIndexExpect = new ArrayList<Integer>(Arrays.asList(0, 0, 2, 3, 0));
    assertEquals("CSC row", rowIndexExpect, myCSC.getRowIndex());
    assertEquals("CSC col", colIndexExpect, myCSC.getColIndex());
  }
View Full Code Here

TOP

Related Classes of com.intel.hadoop.graphbuilder.graph.glgraph.SparseGraphStruct

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.