xref: /petsc/src/mat/impls/baij/seq/baij.h (revision 70f55243aafb320636e2a54ff30cab5d1e8d3d7b)
1*70f55243SBarry Smith /* $Id: baij.h,v 1.7 1996/07/08 12:44:09 curfman Exp bsmith $ */
22593348eSBarry Smith 
3*70f55243SBarry Smith #include "src/mat/matimpl.h"
42593348eSBarry Smith #include <math.h>
52593348eSBarry Smith 
635aab85fSBarry Smith #if !defined(__BAIJ_H)
735aab85fSBarry Smith #define __BAIJ_H
82593348eSBarry Smith 
92593348eSBarry Smith /*
1035aab85fSBarry Smith   MATSEQBAIJ format - Block compressed row storage. The i[] and j[]
1135aab85fSBarry Smith   arrays start at 1, or 0, depending on the value of shift.
1235aab85fSBarry Smith   For example, in Fortran  j[i[k]+p+shift] is the pth column in row k.
132593348eSBarry Smith */
142593348eSBarry Smith 
152593348eSBarry Smith typedef struct {
162593348eSBarry Smith   int              sorted;       /* if true, rows are sorted by increasing columns */
172593348eSBarry Smith   int              roworiented;  /* if true, row-oriented input, default */
182593348eSBarry Smith   int              nonew;        /* if true, don't allow new elements to be added */
192593348eSBarry Smith   int              singlemalloc; /* if true a, i, and j have been obtained with
202593348eSBarry Smith                                         one big malloc */
212593348eSBarry Smith   int              m,n;          /* rows, columns */
222a90d852SSatish Balay   int              bs,bs2;       /* block size, square of block size */
2335aab85fSBarry Smith   int              mbs,nbs;      /* rows/bs, columns/bs */
242593348eSBarry Smith   int              nz,maxnz;     /* nonzeros, allocated nonzeros */
252593348eSBarry Smith   int              *diag;        /* pointers to diagonal elements */
262593348eSBarry Smith   int              *i;           /* pointer to beginning of each row */
272593348eSBarry Smith   int              *imax;        /* maximum space allocated for each row */
282593348eSBarry Smith   int              *ilen;        /* actual length of each row */
292593348eSBarry Smith   int              *j;           /* column values: j + i[k] - 1 is start of row k */
302593348eSBarry Smith   Scalar           *a;           /* nonzero elements */
312593348eSBarry Smith   IS               row,col;      /* index sets, used for reorderings */
322593348eSBarry Smith   Scalar           *solve_work;  /* work space used in MatSolve */
332593348eSBarry Smith   void             *spptr;       /* pointer for special library like SuperLU */
342593348eSBarry Smith   int              reallocs;     /* number of mallocs done during MatSetValues()
3547b4a8eaSLois Curfman McInnes                                     as more values are set then were preallocated */
364eeb42bcSBarry Smith   Scalar           *mult_work;   /* work array for matrix vector product*/
3735aab85fSBarry Smith } Mat_SeqBAIJ;
382593348eSBarry Smith 
3935aab85fSBarry Smith extern int MatILUFactorSymbolic_SeqBAIJ(Mat,IS,IS,double,int,Mat *);
4035aab85fSBarry Smith extern int MatConvert_SeqBAIJ(Mat,MatType,Mat *);
4135aab85fSBarry Smith extern int MatConvertSameType_SeqBAIJ(Mat, Mat*,int);
4235aab85fSBarry Smith extern int MatMarkDiag_SeqBAIJ(Mat);
432593348eSBarry Smith 
442593348eSBarry Smith 
452593348eSBarry Smith #endif
46