xref: /petsc/src/mat/impls/adj/mpi/mpiadj.h (revision e895ccc02404e65fbacee93aeb4f80c54d3f2a09)
1b97cf49bSBarry Smith 
23eda8832SBarry Smith #if !defined(__ADJ_H)
33eda8832SBarry Smith #define __ADJ_H
4af0996ceSBarry Smith #include <petsc/private/matimpl.h>
5da33ede1SBarry Smith 
6b97cf49bSBarry Smith 
7b97cf49bSBarry Smith /*
83eda8832SBarry Smith   MATMPIAdj format - Compressed row storage for storing adjacency lists, and possibly weights
9329f5518SBarry Smith                      This is for grid reorderings (to reduce bandwidth)
10b97cf49bSBarry Smith                      grid partitionings, etc. This is NOT currently a dynamic data-structure.
11b97cf49bSBarry Smith 
12b97cf49bSBarry Smith */
13b97cf49bSBarry Smith 
14b97cf49bSBarry Smith typedef struct {
15b24ad042SBarry Smith   PetscInt  nz;
16b24ad042SBarry Smith   PetscInt  *diag;                   /* pointers to diagonal elements, if they exist */
17b24ad042SBarry Smith   PetscInt  *i;                      /* pointer to beginning of each row */
1879c34000SHong Zhang   PetscInt  *j;                      /* column values: j + i[k] is start of row k */
19b24ad042SBarry Smith   PetscInt  *values;                 /* numerical values */
20*e895ccc0SFande Kong   PetscBool useedgeweights;          /* if edge weights are used  */
21ace3abfcSBarry Smith   PetscBool symmetric;               /* user indicates the nonzero structure is symmetric */
22ace3abfcSBarry Smith   PetscBool freeaij;                 /* free a, i,j at destroy */
23ace3abfcSBarry Smith   PetscBool freeaijwithfree;         /* use free() to free i,j instead of PetscFree() */
242b1d8763SJed Brown   PetscScalar *rowvalues;            /* scalar work space for MatGetRow() */
252b1d8763SJed Brown   PetscInt    rowvalues_alloc;
263eda8832SBarry Smith } Mat_MPIAdj;
27b97cf49bSBarry Smith 
28b97cf49bSBarry Smith #endif
29