code: void add(DoubleVector dest, Vector src, int factor) {
          if (src instanceof SparseVector) {
              int[] nonZeros = ((SparseVector) src).getNonZeroIndices();
              for (int i : nonZeros)
                  dest.add(i, factor * src.getValue(i).doubleValue());
          } else {
              for (int i = 0; i < src.length(); ++i)
                  dest.add(i, factor * src.getValue(i).doubleValue());
          }
      }
docs: Accumulates the content of {@code src} into {@code dest} using a scalar
  to adjust the values of {@code src}.