code: public void update(VectorFunction function) {
          VectorIterator it = iterator();
  
          while (it.hasNext()) {
              double x = it.next();
              int i = it.index();
              it.set(function.evaluate(i, x));
          }
      }
docs: Updates all elements of this vector by applying given {@code function}.
  
  @param function the the vector function