# MatTranspose

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

### Synopsis

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

Collective on Mat

### Input Parameter

mat -the matrix to transpose

### Output Parameters

B -the transpose

### C++ variants

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

### Notes

If you pass in PETSC_NULL for B an in-place transpose in mat will be done

### 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/ksp/examples/tutorials/ex10.c.html