Esempio n. 1
0
  @Test
  public void testSubtractFrom() {
    double[] vals1 = {1, 2, 3, 4, 5, 6, 7, 8};
    DoubleVector vec1 = new DenseDoubleVector(vals1);
    double constant = 10;

    DoubleVector vec3 = vec1.subtractFrom(constant);

    for (int i = 0; i < vals1.length; ++i) {
      assertEquals(constant - vec1.get(i), vec3.get(i), 0.000001);
    }
  }