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());
}