# MatTranspose

Computes an in-place or out-of-place transpose of a matrix.

### Synopsis

    #include "petscmat.h"
    PetscErrorCode PETSCMAT_DLLEXPORT MatTranspose(Mat mat,Mat *B)

Collective on Mat

### Input Parameter

mat -the matrix to transpose

### Output Parameters

B -the transpose (or pass in PETSC_NULL for an in-place transpose)

### C++ variants

| Mat MatTranspose(Mat A) |  | -> |  | MatTranspose(A,&t); return t;

### See Also

MatMultTranspose(), MatMultTransposeAdd(), MatIsTranspose()

Level:intermediate
Location:src/mat/interface/matrix.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/ksp/examples/tutorials/ex10.c.html