code: public void duplicate(IVector result) {
          if (result.size != size) result.reshape(size);
  
          int i;
          for (i = 0; i < size; i++) {
              result.realvector[i] = realvector[i];
              result.imagvector[i] = imagvector[i];
          }
      }
docs: Copy a vector