Actual source code: mpiadj.h

  1: #pragma once

  3: #include <petsc/private/matimpl.h>
  4: #include <petsc/private/hashsetij.h>

  6: /*
  7:   MATMPIAdj format - Compressed row storage for storing adjacency lists, and possibly weights
  8:                      This is for grid reorderings (to reduce bandwidth)
  9:                      grid partitionings, etc.
 10: */

 12: typedef struct {
 13:   PetscHSetIJ ht;

 15:   /*
 16:      once the matrix is assembled (either by calling MatAssemblyBegin/End() or MatMPIAdjSetPreallocation() or MatCreateMPIAdj()
 17:      then the data structures below are valid and cannot be changed
 18:   */
 19:   PetscInt     nz;
 20:   PetscInt    *diag;            /* pointers to diagonal elements, if they exist */
 21:   PetscInt    *i;               /* pointer to beginning of each row */
 22:   PetscInt    *j;               /* column values: j + i[k] is start of row k */
 23:   PetscInt    *values;          /* numerical values */
 24:   PetscBool    useedgeweights;  /* if edge weights are used  */
 25:   PetscBool    symmetric;       /* user indicates the nonzero structure is symmetric */
 26:   PetscBool    freeaij;         /* free a, i,j at destroy */
 27:   PetscBool    freeaijwithfree; /* use free() to free i,j instead of PetscFree() */
 28:   PetscScalar *rowvalues;       /* scalar work space for MatGetRow() */
 29:   PetscInt     rowvalues_alloc;
 30: } Mat_MPIAdj;