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

# MatCreateMPIAdj

Creates a sparse matrix representing an adjacency list. The matrix does not have numerical values associated with it, but is intended for ordering (to reduce bandwidth etc) and partitioning.

### Synopsis

    #include "petscmat.h"
    PetscErrorCode  MatCreateMPIAdj(MPI_Comm comm,PetscInt m,PetscInt N,PetscInt *i,PetscInt *j,PetscInt *values,Mat *A)

Collective on MPI_Comm Many br

### Input Parameters

| comm | - MPI communicator Many br
| m | - number of local rows Many br
| N | - number of global columns Many br
| i | - the indices into j for the start of each row Many br
| j | - the column indices for each row (sorted for each row). Many brThe indices in i and j start with zero (NOT with one). Many br
| values | - [optional] edge weights Many br

### Output Parameter

A -the matrix Many br

Many br

Notes: This matrix object does not support most matrix operations, include Many brMatSetValues(). Many brYou must NOT free the ii, values and jj arrays yourself. PETSc will free them Many brwhen the matrix is destroyed; you must allocate them with PetscMalloc(). If you Many brcall from Fortran you need not create the arrays with PetscMalloc(). Many brShould not include the matrix diagonals. Many br

If you already have a matrix, you can create its adjacency matrix by a call Many brto MatConvert, specifying a type of MATMPIADJ. Many br

Possible values for MatSetOption() - MAT_STRUCTURALLY_SYMMETRIC Many br

### See Also

MatCreate(), MatConvert(), MatGetOrdering()

Level:intermediate
Location:src/mat/impls/adj/mpi/mpiadj.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/mat/examples/tutorials/ex11.c.html