xref: /petsc/src/mat/impls/aij/seq/aij.h (revision ec8511de82ec98b283fd006bf3680df2e1c57a57)
1*ec8511deSBarry Smith /* $Id: aij.h,v 1.11 1995/08/17 01:31:13 curfman Exp bsmith $ */
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*ec8511deSBarry Smith   MATSEQAIJ format - Compressed row storage (also called Yale sparse matrix
11d35516d3SLois Curfman McInnes   format), compatible with Fortran.  The i[] and j[] arrays start at 1,
12d35516d3SLois Curfman McInnes   not zero, to support Fortran 77.  For example, in Fortran
13d35516d3SLois Curfman McInnes   j[i[k]+p-1] is the pth column in row k.
142d40f771SBarry Smith */
15d35516d3SLois Curfman McInnes 
16b8a66259SBarry Smith typedef struct {
17d35516d3SLois Curfman McInnes   int    sorted;           /* if true, rows are sorted by increasing columns */
18d35516d3SLois Curfman McInnes   int    roworiented;      /* if true, row-oriented storage */
19d35516d3SLois Curfman McInnes   int    nonew;            /* if true, don't allow new elements to be added */
20d35516d3SLois Curfman McInnes   int    singlemalloc;     /* if true a, i, and j have been obtained with
21d35516d3SLois Curfman McInnes                                one big malloc */
22d35516d3SLois Curfman McInnes   int    assembled;        /* if true, matrix is fully assembled */
231a1c3055SLois Curfman McInnes   int    m, n;             /* rows, columns */
2480b4ade8SLois Curfman McInnes   int    nz, maxnz;        /* nonzeros, allocated nonzeros */
25d35516d3SLois Curfman McInnes   int    *diag;            /* pointers to diagonal elements */
26d35516d3SLois Curfman McInnes   int    *i;               /* pointer to beginning of each row */
27d35516d3SLois Curfman McInnes   int    *imax;            /* maximum space allocated for each row */
28d35516d3SLois Curfman McInnes   int    *ilen;            /* actual length of each row */
29d35516d3SLois Curfman McInnes   int    *j;               /* column values: j + i[k] - 1 is start of row k */
30d35516d3SLois Curfman McInnes   Scalar *a;               /* nonzero elements */
31d35516d3SLois Curfman McInnes   IS     row, col;         /* index sets, used for reorderings */
324e10411dSBarry Smith   Scalar *solve_work;      /* work space used in MatSolve_AIJ */
33*ec8511deSBarry Smith } Mat_SeqAIJ;
34b8a66259SBarry Smith 
352d40f771SBarry Smith #endif
36