code: @Override
      public VectorIterator iterator() {
          return new VectorIterator(length) {
              private int i = -1;
  
              @Override
              public int index() {
                  return i;
              }
  
              @Override
              public double get() {
                  return Vector.this.get(i);
              }
  
              @Override
              public void set(double value) {
                  Vector.this.set(i, value);
              }
  
              @Override
              public boolean hasNext() {
                  return i + 1 < length;
              }
  
              @Override
              public Double next() {
                  if(!hasNext()) {
                      throw new NoSuchElementException();
                  }
                  i++;
                  return get();
              }
          };
      }
docs: Returns a vector iterator.
  
  @return a vector iterator.