xref: /petsc/src/mat/impls/aij/seq/aij.h (revision d35516d39c1fed28a6a4defcd7b62031b49786fd)
1*d35516d3SLois Curfman McInnes /* $Id: aij.h,v 1.9 1995/06/07 17:31:26 bsmith Exp curfman $ */
2b8a66259SBarry Smith 
3b8a66259SBarry Smith #include "matimpl.h"
40068c123SLois Curfman McInnes #include <math.h>
5b8a66259SBarry Smith 
62d40f771SBarry Smith #if !defined(__AIJ_H)
72d40f771SBarry Smith #define __AIJ_H
82d40f771SBarry Smith 
92d40f771SBarry Smith /*
10*d35516d3SLois Curfman McInnes   MATAIJ format - Compressed row storage (also called Yale sparse matrix
11*d35516d3SLois Curfman McInnes   format), compatible with Fortran.  The i[] and j[] arrays start at 1,
12*d35516d3SLois Curfman McInnes   not zero, to support Fortran 77.  For example, in Fortran
13*d35516d3SLois Curfman McInnes   j[i[k]+p-1] is the pth column in row k.
142d40f771SBarry Smith */
15*d35516d3SLois Curfman McInnes 
16b8a66259SBarry Smith typedef struct {
17*d35516d3SLois Curfman McInnes   int    sorted;           /* if true, rows are sorted by increasing columns */
18*d35516d3SLois Curfman McInnes   int    roworiented;      /* if true, row-oriented storage */
19*d35516d3SLois Curfman McInnes   int    nonew;            /* if true, don't allow new elements to be added */
20*d35516d3SLois Curfman McInnes   int    singlemalloc;     /* if true a, i, and j have been obtained with
21*d35516d3SLois Curfman McInnes                                one big malloc */
22*d35516d3SLois Curfman McInnes   int    assembled;        /* if true, matrix is fully assembled */
231a1c3055SLois Curfman McInnes   int    m, n;             /* rows, columns */
241a1c3055SLois Curfman McInnes   int    nz, maxnz, mem;   /* nonzeros, allocated nonzeros, memory */
25*d35516d3SLois Curfman McInnes   int    *diag;            /* pointers to diagonal elements */
26*d35516d3SLois Curfman McInnes   int    *i;               /* pointer to beginning of each row */
27*d35516d3SLois Curfman McInnes   int    *imax;            /* maximum space allocated for each row */
28*d35516d3SLois Curfman McInnes   int    *ilen;            /* actual length of each row */
29*d35516d3SLois Curfman McInnes   int    *j;               /* column values: j + i[k] - 1 is start of row k */
30*d35516d3SLois Curfman McInnes   Scalar *a;               /* nonzero elements */
31*d35516d3SLois Curfman McInnes   IS     row, col;         /* index sets, used for reorderings */
324e10411dSBarry Smith   Scalar *solve_work;      /* work space used in MatSolve_AIJ */
331fb19edaSLois Curfman McInnes } Mat_AIJ;
34b8a66259SBarry Smith 
352d40f771SBarry Smith #endif
36