コード例 #1
0
 @Test
 public void test_constructor() {
   for (int l = 0; l < m.nlines(); l++) {
     for (int c = 0; c < m.ncols(); c++) {
       assertArrayEquals(
           new Integer[] {(int) l, (int) c, dok.get(l, c)},
           new Integer[] {(int) l, (int) c, m.get(l, c)});
     }
   }
 }
コード例 #2
0
  @Test
  public void testMultiplyI() {
    DOK1Dint vec = new DOK1Dint(m.ncols());
    vec.set(0, 1);
    vec.set(9, (int) 66.6);
    vec.set(3, (int) 6.9);
    vec.set(3, 0);

    assertEquals(vec, m.multiply(vec));
  }