code: @Override
      public DMatrixRMaj getQ(DMatrixRMaj Q , boolean compact ) {
          if( compact ) {
              if( Q == null ) {
                  Q = CommonOps_DDRM.identity(numRows,minLength);
              } else {
                  if( Q.numRows != numRows || Q.numCols != minLength ) {
                      throw new IllegalArgumentException("Unexpected matrix dimension.");
                  } else {
                      CommonOps_DDRM.setIdentity(Q);
                  }
              }
          } else {
              if( Q == null ) {
                  Q = CommonOps_DDRM.identity(numRows);
              } else {
                  if( Q.numRows != numRows || Q.numCols != numRows ) {
                      throw new IllegalArgumentException("Unexpected matrix dimension.");
                  } else {
                      CommonOps_DDRM.setIdentity(Q);
                  }
              }
          }
  
          for( int j = rank-1; j >= 0; j-- ) {
              double u[] = dataQR[j];
  
              double vv = u[j];
              u[j] = 1;
              QrHelperFunctions_DDRM.rank1UpdateMultR(Q, u, gammas[j], j, j, numRows, v);
              u[j] = vv;
          }
  
          return Q;
      }
docs: Computes the Q matrix from the information stored in the QR matrix.  This
  operation requires about 4(m<sup>2</sup>n-mn<sup>2</sup>+n<sup>3</sup>/3) flops.
  
  @param Q The orthogonal Q matrix.