code: public static void transpose( ZMatrixRMaj mat ) {
          if( mat.numCols == mat.numRows ){
              TransposeAlgs_ZDRM.square(mat);
          } else {
              ZMatrixRMaj b = new ZMatrixRMaj(mat.numCols,mat.numRows);
              transpose(mat, b);
              mat.reshape(b.numRows, b.numCols);
              mat.set(b);
          }
      }
docs: <p>Performs an "in-place" transpose.</p>
  
  <p>
  For square matrices the transpose is truly in-place and does not require
  additional memory.  For non-square matrices, internally a temporary matrix is declared and
  {@link #transpose(ZMatrixRMaj, ZMatrixRMaj)} is invoked.
  </p>
  
  @param mat The matrix that is to be transposed. Modified.