コード例 #1
0
 public static void printSimpleVector(SimpleVector B) {
   int n = B.getLen();
   for (int i = 0; i < n; i++) {
     System.out.print(B.getElement(i) + "\t");
   }
   System.out.print("\n");
 }
コード例 #2
0
  /**
   * @param x
   * @param y
   * @param z
   * @param vec - EigenValue is encoded in length of vector
   */
  public void setVector(int x, int y, int z, SimpleVector vec) {

    // Check for inconsistency (different dimensions)
    assert (vec.getLen() == 3) : new Exception("Dimension of data vector has to be 3.");
    // Loop through every coordinate
    for (int i = 0; i < 3; i++) {
      super.setAtIndex(x, y, z, i, (float) vec.getElement(i));
    }
  }