public void testToCCS() { SparseMatrixLil A = sprand(10, 10); SparseMatrixLil B = A.toCCS().toLil(); assertTrue(A.equals(B)); A = sprand(thousandconstant, thousandconstant); B = A.toCCS().toLil(); assertTrue(A.equals(B)); A = A.t(); B = A.toCCS().toLil(); assertTrue(A.equals(B)); }
public void testCCsGetNonZeros() { SparseMatrixLil A = spzeros(3, 3); A.append(1, 0, 5); A.append(0, 1, 7); A.append(0, 0, 11); SparseMatrixCCS B = A.toCCS(); assertEquals(3, B.nonZeros()); assertEquals(2, B.nonZeros(0)); assertEquals(1, B.nonZeros(1)); assertEquals(0, B.nonZeros(2)); }