petsc-3.14.6 2021-03-30
Report Typos and Errors

MatPermute

Creates a new matrix with rows and columns permuted from the original.

Synopsis

#include "petscmat.h" 
PetscErrorCode MatPermute(Mat mat,IS row,IS col,Mat *B)
Collective on Mat

Input Parameters

mat - the matrix to permute
row - row permutation, each processor supplies only the permutation for its rows
col - column permutation, each processor supplies only the permutation for its columns

Output Parameters

B - the permuted matrix

Note

The index sets map from row/col of permuted matrix to row/col of original matrix. The index sets should be on the same communicator as Mat and have the same local sizes.

See Also

MatGetOrdering(), ISAllGather()

Level

advanced

Location

src/mat/interface/matrix.c

Examples

src/ksp/ksp/tutorials/ex18.c.html

Implementations

MatPermute_MPIAIJ in src/mat/impls/aij/mpi/mpiaij.c
MatPermute_SeqAIJ in src/mat/impls/aij/seq/aij.c
MatPermute_MPIBAIJ in src/mat/impls/baij/mpi/mpibaij.c

Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages