petsc-3.7.1 2016-05-15
Report Typos and Errors

# MatGetOrdering

Gets a reordering for a matrix to reduce fill or to improve numerical stability of LU factorization.

### Synopsis

    #include "petscmat.h"
    PetscErrorCode  MatGetOrdering(Mat mat,MatOrderingType type,IS *rperm,IS *cperm)

Collective on Mat Many br

### Input Parameters

| mat | - the matrix Many br
| type | - type of reordering, one of the following: Many br

         MATORDERINGNATURAL - Natural

         MATORDERINGND - Nested Dissection

         MATORDERING1WD - One-way Dissection

         MATORDERINGRCM - Reverse Cuthill-McKee

         MATORDERINGQMD - Quotient Minimum Degree

### Output Parameters

| rperm | - row permutation indices Many br
| cperm | - column permutation indices Many br

### Options Database Key

-mat_view_ordering draw -plots matrix nonzero structure in new ordering Many br

Many br

### Notes

This DOES NOT actually reorder the matrix; it merely returns two index sets Many brthat define a reordering. This is usually not used directly, rather use the Many broptions PCFactorSetMatOrderingType() Many br

The user can define additional orderings; see MatOrderingRegister(). Many br

These are generally only implemented for sequential sparse matrices. Many br

The external packages that PETSc can use for direct factorization such as SuperLU do not accept orderings provided by Many brthis call. Many br

### Keywords

matrix, set, ordering, factorization, direct, ILU, LU,
fill, reordering, natural, Nested Dissection, Many brOne-way Dissection, Cholesky, Reverse Cuthill-McKee, Many brQuotient Minimum Degree Many br

### See Also

MatOrderingRegister(), PCFactorSetMatOrderingType()

Level:intermediate
Location:src/mat/order/sorder.c
Index of all MatOrderings routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/mat/examples/tutorials/ex1.c.html
src/ksp/ksp/examples/tutorials/ex18.c.html