Package org.timepedia.chronoscope.client.util

Examples of org.timepedia.chronoscope.client.util.JavaArray2D.numRows()


    assertEquals(20.0, a2d.get(0, 1));
    assertEquals(30.0, a2d.get(1, 0));
    assertEquals(10.0, a2d.get(0, 0));
   
    // Verify new dimensions
    assertEquals(newRowIdx + 1, a2d.numRows());
    assertEquals(newColIdx + 1, a2d.numColumns(newRowIdx));
  }

  private static double[][] copy(double[][] a) {
    double[][] copy = new double[a.length][];
View Full Code Here


    // make a copy of 'row' to use as expected array to guard against
    // case where JavaArray2D accidentally modifies the input array.
    double[] expectedRow = Util.copyArray(row);
   
    JavaArray2D a = new JavaArray2D(row);
    assertEquals(1, a.numRows());
    assertEquals(3, a.numColumns(0));
    for (int i = 0; i < expectedRow.length; i++) {
      assertEquals(expectedRow[i], a.get(0, i));
    }
  }
View Full Code Here

    row1[0] = 999.0;
    assertEquals(3.0, a.get(1, 0));
   
    // Verify that access to the array elemts via the Array1D interface
    // works as expected
    for (int i = 0; i < a.numRows(); i++) {
      for (int j = 0; j < a.numColumns(i); j++) {
        assertEquals(a.get(i, j), a.getRow(i).get(j));
      }
    }
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.