xref: /petsc/src/mat/impls/baij/seq/baij.h (revision e24b481b4a15e258c09dabebcc19da3246e723e1)
1*e24b481bSBarry Smith /* $Id: baij.h,v 1.11 1998/10/09 19:22:47 bsmith Exp bsmith $ */
22593348eSBarry Smith 
370f55243SBarry 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[]
11*e24b481bSBarry Smith   arrays start at 0.
122593348eSBarry Smith */
132593348eSBarry Smith 
142593348eSBarry Smith typedef struct {
152593348eSBarry Smith   int              sorted;       /* if true, rows are sorted by increasing columns */
162593348eSBarry Smith   int              roworiented;  /* if true, row-oriented input, default */
173369ce9aSBarry Smith   int              nonew;        /* 1 don't add new nonzeros, -1 generate error on new */
182593348eSBarry Smith   int              singlemalloc; /* if true a, i, and j have been obtained with
192593348eSBarry Smith                                         one big malloc */
202593348eSBarry Smith   int              m,n;          /* rows, columns */
212a90d852SSatish Balay   int              bs,bs2;       /* block size, square of block size */
2235aab85fSBarry Smith   int              mbs,nbs;      /* rows/bs, columns/bs */
232593348eSBarry Smith   int              nz,maxnz;     /* nonzeros, allocated nonzeros */
242593348eSBarry Smith   int              *diag;        /* pointers to diagonal elements */
252593348eSBarry Smith   int              *i;           /* pointer to beginning of each row */
262593348eSBarry Smith   int              *imax;        /* maximum space allocated for each row */
272593348eSBarry Smith   int              *ilen;        /* actual length of each row */
282593348eSBarry Smith   int              *j;           /* column values: j + i[k] - 1 is start of row k */
292593348eSBarry Smith   Scalar           *a;           /* nonzero elements */
30e51c0b9cSSatish Balay   IS               row,col,icol; /* index sets, used for reorderings */
312593348eSBarry Smith   Scalar           *solve_work;  /* work space used in MatSolve */
322593348eSBarry Smith   void             *spptr;       /* pointer for special library like SuperLU */
332593348eSBarry Smith   int              reallocs;     /* number of mallocs done during MatSetValues()
3447b4a8eaSLois Curfman McInnes                                     as more values are set then were preallocated */
354eeb42bcSBarry Smith   Scalar           *mult_work;   /* work array for matrix vector product*/
3635aab85fSBarry Smith } Mat_SeqBAIJ;
372593348eSBarry Smith 
3835aab85fSBarry Smith extern int MatILUFactorSymbolic_SeqBAIJ(Mat,IS,IS,double,int,Mat *);
3935aab85fSBarry Smith extern int MatConvert_SeqBAIJ(Mat,MatType,Mat *);
402e8a6d31SBarry Smith extern int MatDuplicate_SeqBAIJ(Mat,MatDuplicateOption, Mat*);
4135aab85fSBarry Smith extern int MatMarkDiag_SeqBAIJ(Mat);
42*e24b481bSBarry Smith extern int MatLUFactorNumeric_SeqBAIJ_4_NaturalOrdering(Mat,Mat*);
43*e24b481bSBarry Smith extern int MatSolve_SeqBAIJ_4_NaturalOrdering(Mat,Vec,Vec);
44*e24b481bSBarry Smith extern int MatLUFactorNumeric_SeqBAIJ_5_NaturalOrdering(Mat,Mat*);
45*e24b481bSBarry Smith extern int MatSolve_SeqBAIJ_5_NaturalOrdering(Mat,Vec,Vec);
462593348eSBarry Smith 
472593348eSBarry Smith 
482593348eSBarry Smith #endif
49