code: public IVector getVectorFromDiagonal() {
          int size = Math.min(rows, columns);
          IVector result = new IVector(size);
          for (int i = 0; i < rows; i++) {
              result.realvector[i] = realmatrix[i][i];
              result.imagvector[i] = imagmatrix[i][i];
          }
          return result;
      }
docs: Creates a vector with the content of the diagonal elements from this matrix