code: public static Vector addWithScalars(DoubleVector vector1, double weight1,
                                          DoubleVector vector2, double weight2) {
          if (vector2.length() != vector1.length())
              throw new IllegalArgumentException(
                      "Vectors of different sizes cannot be added");
          int length = vector2.length();
          for (int i = 0; i < length; ++i) {
              double value = vector1.get(i) * weight1 +
                             vector2.get(i) * weight2;
              vector1.set(i, value);
          }
          return vector1;
      }
docs: Adds two {@code DoubleVector}s with some scalar weight for each {@code
  DoubleVector}.
  
  @param vector1 The vector values should be added to.
  @param weight1 The weight of values in {@code vector1}
  @param vector2 The vector values that should be added to {@code vector1}
  @param weight2 The weight of values in {@code vector2}
  
  @param {@code vector1}