code: public static double[] timesEquals(final double[] v1, final double s) {
      for(int i = 0; i < v1.length; i++) {
        v1[i] *= s;
      }
      return v1;
    }
docs: Multiply component-wise v1 = v1 * s1,
  overwriting the vector v1.
  
  @param v1 original vector
  @param s scalar
  @return v1 = v1 * s1