1b97cf49bSBarry Smith 23eda8832SBarry Smith #if !defined(__ADJ_H) 33eda8832SBarry Smith #define __ADJ_H 4b45d2f2cSJed Brown #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 */ 20ace3abfcSBarry Smith PetscBool symmetric; /* user indicates the nonzero structure is symmetric */ 21ace3abfcSBarry Smith PetscBool freeaij; /* free a, i,j at destroy */ 22ace3abfcSBarry Smith PetscBool freeaijwithfree; /* use free() to free i,j instead of PetscFree() */ 23*2b1d8763SJed Brown PetscScalar *rowvalues; /* scalar work space for MatGetRow() */ 24*2b1d8763SJed Brown PetscInt rowvalues_alloc; 253eda8832SBarry Smith } Mat_MPIAdj; 26b97cf49bSBarry Smith 27b97cf49bSBarry Smith #endif 28