A straight forward transpose.  Good for small non-square matrices.

@param A Original matrix.  Not modified.
@param A_tran Transposed matrix.  Modified.
480324
public static void standard(ZMatrixRMaj A, ZMatrixRMaj A_tran)
    {
        int index = 0;
        int rowStrideTran = A_tran.getRowStride();
        int rowStride = A.getRowStride();
        for( int i = 0; i < A_tran.numRows; i++ ) {
            int index2 = i*2;

            int end = index + rowStrideTran;
            while( index < end ) {
                A_tran.data[index++] = A.data[ index2 ];
                A_tran.data[index++] = A.data[ index2+1 ];
                index2 += rowStride;
            }
        }
    }
1105523
public void applyMatrix()
	{
		transformMatrix.translate(new Vector3f(-0.5F, -0.5F, -0.5F));

		for (Vertex v : vertexes)
			v.applyMatrix(transformMatrix);

		resetMatrix();

		return;
	}
830521
public static Scs cs_transpose(Scs A, boolean values) {
        int p, q, j, Cp[], Ci[], n, m, Ap[], Ai[], w[];
        float Cx[], Ax[];
        Scs C;
        if (!Scs_util.CS_CSC(A))
            return (null); /* check inputs */
        m = A.m;
        n = A.n;
        Ap = A.p;
        Ai = A.i;
        Ax = A.x;
        C = Scs_util.cs_spalloc(n, m, Ap[n], values && (Ax != null), false); /* allocate result */
        w = new int[m]; /* get workspace */
        Cp = C.p;
        Ci = C.i;
        Cx = C.x;
        for (p = 0; p < Ap[n]; p++)
            w[Ai[p]]++; /* row counts */
        Scs_cumsum.cs_cumsum(Cp, w, m); /* row pointers */
        for (j = 0; j < n; j++) {
            for (p = Ap[j]; p < Ap[j + 1]; p++) {
                Ci[q = w[Ai[p]]++] = j; /* place A(i,j) as entry C(j,i) */
                if (Cx != null)
                    Cx[q] = Ax[p];
            }
        }
        return C;
    }
974009
public void applyTranQ( DMatrixRMaj A ) {
        for( int j = 0; j < minLength; j++ ) {
            int diagIndex = j*numRows+j;
            double before = QR.data[diagIndex];
            QR.data[diagIndex] = 1;
            QrHelperFunctions_DDRM.rank1UpdateMultR(A, QR.data, j * numRows, gammas[j], 0, j, numRows, v);
            QR.data[diagIndex] = before;
        }
    }
155603
@Override
    public DoubleMatrix transpose()
    {
        int m = rows();
        int n = columns();
        ItemSupplier s = supplier;
        DoubleMatrix tr = getInstance(n, m);
        ItemConsumer c = tr.consumer;
        for (int i = 0; i < m; i++)
        {
            for (int j = 0; j < n; j++)
            {
                c.set(j, i, s.get(i, j));
            }
        }
        return tr;
    }
858831
public void setTransform(Matrix newTransform) {
    FLog.v(TAG, "setTransform");
    mActiveTransform.set(newTransform);
    onTransformChanged();
  }
959071
public static Dcs cs_transpose(Dcs A, boolean values) {
        int p, q, j, Cp[], Ci[], n, m, Ap[], Ai[], w[];
        double Cx[], Ax[];
        Dcs C;
        if (!Dcs_util.CS_CSC(A))
            return (null); /* check inputs */
        m = A.m;
        n = A.n;
        Ap = A.p;
        Ai = A.i;
        Ax = A.x;
        C = Dcs_util.cs_spalloc(n, m, Ap[n], values && (Ax != null), false); /* allocate result */
        w = new int[m]; /* get workspace */
        Cp = C.p;
        Ci = C.i;
        Cx = C.x;
        for (p = 0; p < Ap[n]; p++)
            w[Ai[p]]++; /* row counts */
        Dcs_cumsum.cs_cumsum(Cp, w, m); /* row pointers */
        for (j = 0; j < n; j++) {
            for (p = Ap[j]; p < Ap[j + 1]; p++) {
                Ci[q = w[Ai[p]]++] = j; /* place A(i,j) as entry C(j,i) */
                if (Cx != null)
                    Cx[q] = Ax[p];
            }
        }
        return C;
    }
1152201
public Matrix transpose()
    {
        double tv[][] = new double[nCols][nRows];  // transposed values

        // Set the values of the transpose.
        for (int r = 0; r < nRows; ++r) {
            for (int c = 0; c < nCols; ++c) {
                tv[c][r] = values[r][c];
            }
        }

        return new Matrix(tv);
    }
468313
public static void transpose( DMatrix6x6 m ) {
        double tmp;
        tmp = m.a12; m.a12 = m.a21; m.a21 = tmp;
        tmp = m.a13; m.a13 = m.a31; m.a31 = tmp;
        tmp = m.a14; m.a14 = m.a41; m.a41 = tmp;
        tmp = m.a15; m.a15 = m.a51; m.a51 = tmp;
        tmp = m.a16; m.a16 = m.a61; m.a61 = tmp;
        tmp = m.a23; m.a23 = m.a32; m.a32 = tmp;
        tmp = m.a24; m.a24 = m.a42; m.a42 = tmp;
        tmp = m.a25; m.a25 = m.a52; m.a52 = tmp;
        tmp = m.a26; m.a26 = m.a62; m.a62 = tmp;
        tmp = m.a34; m.a34 = m.a43; m.a43 = tmp;
        tmp = m.a35; m.a35 = m.a53; m.a53 = tmp;
        tmp = m.a36; m.a36 = m.a63; m.a63 = tmp;
        tmp = m.a45; m.a45 = m.a54; m.a54 = tmp;
        tmp = m.a46; m.a46 = m.a64; m.a64 = tmp;
        tmp = m.a56; m.a56 = m.a65; m.a65 = tmp;
    }
192302
public static void changeSign( DMatrix2 a )
    {
        a.a1 = -a.a1;
        a.a2 = -a.a2;
    }
646640
public static void fill( DMatrix3x3 a , double v  ) {
        a.a11 = v; a.a12 = v; a.a13 = v;
        a.a21 = v; a.a22 = v; a.a23 = v;
        a.a31 = v; a.a32 = v; a.a33 = v;
    }
259553
protected void convertToColumnMajor(DMatrixRMaj A) {
        for( int x = 0; x < numCols; x++ ) {
            double colQ[] = dataQR[x];
            for( int y = 0; y < numRows; y++ ) {
                colQ[y] = A.data[y*A.numCols+x];
            }
        }
    }
1220441
public static double[][] transpose(final double[][] m1) {
    final int rowdim = m1.length, coldim = getColumnDimensionality(m1);
    final double[][] re = new double[coldim][rowdim];
    for(int i = 0; i < rowdim; i++) {
      final double[] row = m1[i];
      for(int j = 0; j < coldim; j++) {
        re[j][i] = row[j];
      }
    }
    return re;
  }
1247897
public static void symmLowerToFull( DMatrixRMaj A )
    {
        if( A.numRows != A.numCols )
            throw new MatrixDimensionException("Must be a square matrix");

        final int cols = A.numCols;

        for (int row = 0; row < A.numRows; row++) {
            for (int col = row+1; col < cols; col++) {
                A.data[row*cols+col] = A.data[col*cols+row];
            }
        }
    }
632848
public static void swapRow(Matrix A, int j, int k)
    {
        swapCol(A, j, k, 0, A.cols());
    }
419208
public Matrix4d transpose(Matrix4d dest) {
        if ((properties & PROPERTY_IDENTITY) != 0)
            return dest.identity();
        return transposeGeneric(dest);
    }
543395
public void addMatrix(double[][] m) {
    assert (m.length == dim);
    assert (m[0].length == dim);

    // reset inverse transformation - needs recomputation.
    inv = null;

    // extend the matrix with an extra row and column
    double[][] ht = new double[dim + 1][dim + 1];
    for(int i = 0; i < dim; i++) {
      for(int j = 0; j < dim; j++) {
        ht[i][j] = m[i][j];
      }
    }
    // the other cells default to identity matrix
    ht[dim][dim] = 1.0;
    // Multiply from left.
    trans = times(ht, trans);
  }