Returns the transpose of the matrix
778870
function() {
    var rows = this.elements.length, cols = this.elements[0].length;
    var elements = [], ni = cols, i, nj, j;
    do { i = cols - ni;
      elements[i] = [];
      nj = rows;
      do { j = rows - nj;
        elements[i][j] = this.elements[j][i];
      } while (--nj);
    } while (--ni);
    return Matrix.create(elements);
  }
1138019
public static void transpose(DMatrixSparseCSC A , DMatrixSparseCSC C , @Nullable IGrowArray gw ) {
        int []work = adjust(gw,A.numRows,A.numRows);
        C.reshape(A.numCols,A.numRows,A.nz_length);

        // compute the histogram for each row in 'a'
        int idx0 = A.col_idx[0];
        for (int j = 1; j <= A.numCols; j++) {
            int idx1 = A.col_idx[j];
            for (int i = idx0; i < idx1; i++) {
                if( A.nz_rows.length <= i)
                    throw new RuntimeException("Egads");
                work[A.nz_rows[i]]++;
            }
            idx0 = idx1;
        }

        // construct col_idx in the transposed matrix
        C.histogramToStructure(work);
        System.arraycopy(C.col_idx,0,work,0,C.numCols);

        // fill in the row indexes
        idx0 = A.col_idx[0];
        for (int j = 1; j <= A.numCols; j++) {
            int col = j-1;
            int idx1 = A.col_idx[j];
            for (int i = idx0; i < idx1; i++) {
                int row = A.nz_rows[i];
                int index = work[row]++;
                C.nz_rows[index] = col;
                C.nz_values[index] = A.nz_values[i];
            }
            idx0 = idx1;
        }
    }
326048
def convertToRateMatrix(self, Q):
        
        rowSums             = Q.sum(axis=1).getA1()
        idxRange            = np.arange(Q.shape[0])
        Qdiag               = coo_matrix((rowSums,(idxRange,idxRange)),shape=Q.shape).tocsr()
        return Q-Qdiag
450239
function transpose (M) {
	return (
		[[M[0][0], M[1][0], M[2][0]],
		 [M[0][1], M[1][1], M[2][1]],
		 [M[0][2], M[1][2], M[2][2]]]
	);
}
701965
public static double[][] transposeTimes(final double[] v1, final double[][] m2) {
    assert m2.length == v1.length : ERR_MATRIX_INNERDIM;
    final int columndimension = m2[0].length;
    final double[][] re = new double[1][columndimension];
    for(int j = 0; j < columndimension; j++) {
      double s = 0;
      for(int k = 0; k < v1.length; k++) {
        s += v1[k] * m2[k][j];
      }
      re[0][j] = s;
    }
    return re;
  }
599517
public AbstractMatrix transpose()
    {
        int m = rows();
        int n = columns();
        AbstractMatrix tr = getInstance(n, m, cls);
        for (int i = 0; i < m; i++)
        {
            for (int j = 0; j < n; j++)
            {
                Array.set(tr.array, M.at(j, i), Array.get(array, M.at(i, j)));
            }
        }
        return tr;
    }
1293528
public Matrix transposeMultiply(Matrix B)
    {
        Matrix C = new DenseMatrix(this.cols(), B.cols());
        transposeMultiply(B, C);
        return C;
    }
405829
function transpose(out, a) {
  // If we are transposing ourselves we can skip a few steps but have to cache some values
  if (out === a) {
    var a1 = a[1]
    out[1] = a[2]
    out[2] = a1
  } else {
    out[0] = a[0]
    out[1] = a[2]
    out[2] = a[1]
    out[3] = a[3]
  }

  return out
}
37046
function() {
                var rows = this.elements.length, i, cols = this.elements[0].length, j;
            	var elements = [], i = cols;
            	while (i--) {
            	    j = rows;
            	    elements[i] = [];
            	    while (j--) {
            		elements[i][j] = this.elements[j][i];
            	    }
            	}
            	return Matrix$b.create(elements);
                }
271227
def transpose(matrix):

    

    return [[x[i] for x in matrix] for i in range(len(matrix[0]))]
356918
function() {
            	var matrix_rows = [];
            	var n = this.elements.length;
            	for (var i = 0; i < n; i++) {
            	    matrix_rows.push($V(this.elements[i]).inspect());
            	}
            	return matrix_rows.join('\n');
                }
1329613
def transpose(self):
        '''
        
        '''
        def _t(item):
            if type(item) == list:
                for n, it in enumerate(item):
                    if type(it) == tuple:
                        it = list(it)
                        item[n] = it
                    if type(it) == list:
                        _t(it)
                    if isinstance(it, np.ndarray) and it.shape == s:
                        item[n] = it.T

        s = self.coeffs['shape']

        for item in self.coeffs.values():
            if type(item) == dict:
                for item2 in item.values():
                    _t(item2)
            else:
                _t(item)

        self.coeffs['shape'] = s[::-1]
241017
public Matrix transpose() {
        Matrix result = blankOfShape(columns, rows);
        MatrixIterator it = result.iterator();

        while (it.hasNext()) {
            it.next();
            int i = it.rowIndex();
            int j = it.columnIndex();
            it.set(get(j, i));
        }

        return result;
    }
858998
function transpose(m, dst) {
  dst = dst || new MatType(16);
  if (dst === m) {
    let t;

    t = m[1];
    m[1] = m[4];
    m[4] = t;

    t = m[2];
    m[2] = m[8];
    m[8] = t;

    t = m[3];
    m[3] = m[12];
    m[12] = t;

    t = m[6];
    m[6] = m[9];
    m[9] = t;

    t = m[7];
    m[7] = m[13];
    m[13] = t;

    t = m[11];
    m[11] = m[14];
    m[14] = t;
    return dst;
  }

  const m00 = m[0 * 4 + 0];
  const m01 = m[0 * 4 + 1];
  const m02 = m[0 * 4 + 2];
  const m03 = m[0 * 4 + 3];
  const m10 = m[1 * 4 + 0];
  const m11 = m[1 * 4 + 1];
  const m12 = m[1 * 4 + 2];
  const m13 = m[1 * 4 + 3];
  const m20 = m[2 * 4 + 0];
  const m21 = m[2 * 4 + 1];
  const m22 = m[2 * 4 + 2];
  const m23 = m[2 * 4 + 3];
  const m30 = m[3 * 4 + 0];
  const m31 = m[3 * 4 + 1];
  const m32 = m[3 * 4 + 2];
  const m33 = m[3 * 4 + 3];

  dst[ 0] = m00;
  dst[ 1] = m10;
  dst[ 2] = m20;
  dst[ 3] = m30;
  dst[ 4] = m01;
  dst[ 5] = m11;
  dst[ 6] = m21;
  dst[ 7] = m31;
  dst[ 8] = m02;
  dst[ 9] = m12;
  dst[10] = m22;
  dst[11] = m32;
  dst[12] = m03;
  dst[13] = m13;
  dst[14] = m23;
  dst[15] = m33;

  return dst;
}
1272168
def getTransform(self):
        
        if "transform" in self.info.keys():
            T = self.info["transform"]
            return T
        else:
            T = self.GetMatrix()
            tr = vtk.vtkTransform()
            tr.SetMatrix(T)
            return tr
1068159
@Nonnull
  @ReturnsMutableCopy
  public Matrix getR ()
  {
    final Matrix aNewMatrix = new Matrix (m_nCols, m_nCols);
    final double [] [] aNewArray = aNewMatrix.internalGetArray ();
    for (int nRow = 0; nRow < m_nCols; nRow++)
    {
      final double [] aDstRow = aNewArray[nRow];
      for (int j = 0; j < m_nCols; j++)
      {
        if (nRow < j)
          aDstRow[j] = m_aQR[nRow][j];
        else
          if (nRow == j)
            aDstRow[j] = m_aRdiag[nRow];
          else
            aDstRow[j] = 0.0;
      }
    }
    return aNewMatrix;
  }
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;
    }