xref: /petsc/src/mat/impls/adj/mpi/mpiadj.h (revision 6a09307c880f3cf726d2c2fd1cfca70c4fcbcfe1)
1 
2 #if !defined(MPIADJ_H)
3 #define MPIADJ_H
4 #include <petsc/private/matimpl.h>
5 #include <petsc/private/hashsetij.h>
6 
7 /*
8   MATMPIAdj format - Compressed row storage for storing adjacency lists, and possibly weights
9                      This is for grid reorderings (to reduce bandwidth)
10                      grid partitionings, etc.
11 */
12 
13 typedef struct {
14   PetscHSetIJ ht;
15 
16   /*
17      once the matrix is assembled (either by calling MatAssemblyBegin/End() or MatMPIAdjSetPreallocation() or MatCreateMPIAdj()
18      then the data structures below are valid and cannot be changed
19   */
20   PetscInt    nz;
21   PetscInt    *diag;                   /* pointers to diagonal elements, if they exist */
22   PetscInt    *i;                      /* pointer to beginning of each row */
23   PetscInt    *j;                      /* column values: j + i[k] is start of row k */
24   PetscInt    *values;                 /* numerical values */
25   PetscBool   useedgeweights;          /* if edge weights are used  */
26   PetscBool   symmetric;               /* user indicates the nonzero structure is symmetric */
27   PetscBool   freeaij;                 /* free a, i,j at destroy */
28   PetscBool   freeaijwithfree;         /* use free() to free i,j instead of PetscFree() */
29   PetscScalar *rowvalues;              /* scalar work space for MatGetRow() */
30   PetscInt    rowvalues_alloc;
31 } Mat_MPIAdj;
32 
33 #endif
34