xref: /petsc/src/mat/impls/aij/seq/aij.h (revision 76dd722b9f5340f7d2cb207df73dc90d5e00a5a5)
1 /* $Id: aij.h,v 1.18 1995/11/06 17:32:56 balay Exp balay $ */
2 
3 #include "matimpl.h"
4 #include <math.h>
5 
6 #if !defined(__AIJ_H)
7 #define __AIJ_H
8 
9 /* Stores info about inodes - no of inodes, and  size of each inode */
10 typedef struct {
11   int node_count;
12   int *size;
13 } Mat_SeqAIJ_Inode;
14 
15 /*
16   MATSEQAIJ format - Compressed row storage (also called Yale sparse matrix
17   format), compatible with Fortran.  The i[] and j[] arrays start at 1,
18   or 0, depending on the value of shift.  For example, in Fortran
19   j[i[k]+p+shift] is the pth column in row k.
20 */
21 
22 typedef struct {
23   int              sorted;           /* if true, rows are sorted by increasing columns */
24   int              roworiented;      /* if true, row-oriented storage */
25   int              nonew;            /* if true, don't allow new elements to be added */
26   int              singlemalloc;     /* if true a, i, and j have been obtained with
27                                         one big malloc */
28   int              assembled;        /* if true, matrix is fully assembled */
29   int              m, n;             /* rows, columns */
30   int              nz, maxnz;        /* nonzeros, allocated nonzeros */
31   int              *diag;            /* pointers to diagonal elements */
32   int              *i;               /* pointer to beginning of each row */
33   int              *imax;            /* maximum space allocated for each row */
34   int              *ilen;            /* actual length of each row */
35   int              *j;               /* column values: j + i[k] - 1 is start of row k */
36   Scalar           *a;               /* nonzero elements */
37   IS               row, col;         /* index sets, used for reorderings */
38   Scalar           *solve_work;      /* work space used in MatSolve */
39   void             *spptr;           /* pointer for special library like SuperLU */
40   int              indexshift;       /* zero or -one for C or Fortran indexing */
41   Mat_SeqAIJ_Inode inode;            /* identical node informaton */
42 } Mat_SeqAIJ;
43 
44 extern int MatILUFactorSymbolic_SeqAIJ(Mat,IS,IS,double,int,Mat *);
45 extern int MatConvert_SeqAIJ(Mat,MatType,Mat *);
46 extern int MatCopyPrivate_SeqAIJ(Mat, Mat*,int);
47 extern int MatMarkDiag_SeqAIJ(Mat);
48 
49 
50 #endif
51