xref: /petsc/src/mat/impls/baij/seq/baij.h (revision e7592fafdafd2d48ae4a0483061ac14bd099dfe3)
1*e7592fafSBarry Smith /* $Id: baij.h,v 1.23 2000/04/15 22:53:07 bsmith Exp bsmith $ */
22593348eSBarry Smith 
370f55243SBarry Smith #include "src/mat/matimpl.h"
42593348eSBarry Smith 
535aab85fSBarry Smith #if !defined(__BAIJ_H)
635aab85fSBarry Smith #define __BAIJ_H
72593348eSBarry Smith 
82593348eSBarry Smith /*
935aab85fSBarry Smith   MATSEQBAIJ format - Block compressed row storage. The i[] and j[]
10e24b481bSBarry Smith   arrays start at 0.
112593348eSBarry Smith */
122593348eSBarry Smith 
132593348eSBarry Smith typedef struct {
14c4992f7dSBarry Smith   PetscTruth       sorted;       /* if true, rows are sorted by increasing columns */
15c4992f7dSBarry Smith   PetscTruth       roworiented;  /* if true, row-oriented input, default */
163369ce9aSBarry Smith   int              nonew;        /* 1 don't add new nonzeros, -1 generate error on new */
17c4992f7dSBarry Smith   PetscTruth       singlemalloc; /* if true a, i, and j have been obtained with
182593348eSBarry Smith                                         one big malloc */
192593348eSBarry Smith   int              m,n;          /* rows, columns */
202a90d852SSatish Balay   int              bs,bs2;       /* block size, square of block size */
2135aab85fSBarry Smith   int              mbs,nbs;      /* rows/bs, columns/bs */
222593348eSBarry Smith   int              nz,maxnz;     /* nonzeros, allocated nonzeros */
232593348eSBarry Smith   int              *diag;        /* pointers to diagonal elements */
242593348eSBarry Smith   int              *i;           /* pointer to beginning of each row */
252593348eSBarry Smith   int              *imax;        /* maximum space allocated for each row */
262593348eSBarry Smith   int              *ilen;        /* actual length of each row */
272593348eSBarry Smith   int              *j;           /* column values: j + i[k] - 1 is start of row k */
283f1db9ecSBarry Smith   MatScalar        *a;           /* nonzero elements */
29e51c0b9cSSatish Balay   IS               row,col,icol; /* index sets, used for reorderings */
302593348eSBarry Smith   Scalar           *solve_work;  /* work space used in MatSolve */
312593348eSBarry Smith   void             *spptr;       /* pointer for special library like SuperLU */
322593348eSBarry Smith   int              reallocs;     /* number of mallocs done during MatSetValues()
3347b4a8eaSLois Curfman McInnes                                     as more values are set then were preallocated */
344eeb42bcSBarry Smith   Scalar           *mult_work;   /* work array for matrix vector product*/
357fc3c18eSBarry Smith   Scalar           *saved_values;
36c4992f7dSBarry Smith 
37c4992f7dSBarry Smith   PetscTruth       keepzeroedrows; /* if true, MatZeroRows() will not change nonzero structure */
38a377f70aSBarry Smith 
39a377f70aSBarry Smith #if defined(PETSC_USE_MAT_SINGLE)
40*e7592fafSBarry Smith   int              setvalueslen;
41a377f70aSBarry Smith   MatScalar        *setvaluescopy; /* area double precision values in MatSetValuesXXX() are copied
42a377f70aSBarry Smith                                       before calling MatSetValuesXXX_SeqBAIJ_MatScalar() */
43a377f70aSBarry Smith #endif
4435aab85fSBarry Smith } Mat_SeqBAIJ;
452593348eSBarry Smith 
465ef9f2a5SBarry Smith extern int MatILUFactorSymbolic_SeqBAIJ(Mat,IS,IS,MatILUInfo*,Mat *);
4735aab85fSBarry Smith extern int MatConvert_SeqBAIJ(Mat,MatType,Mat *);
482e8a6d31SBarry Smith extern int MatDuplicate_SeqBAIJ(Mat,MatDuplicateOption,Mat*);
49c4992f7dSBarry Smith extern int MatMarkDiagonal_SeqBAIJ(Mat);
50be3590efSBarry Smith 
517c922b88SBarry Smith extern int MatSolveTranspose_SeqBAIJ_1_NaturalOrdering(Mat,Vec,Vec);
52be3590efSBarry Smith extern int MatLUFactorNumeric_SeqBAIJ_2_NaturalOrdering(Mat,Mat*);
53be3590efSBarry Smith extern int MatSolve_SeqBAIJ_2_NaturalOrdering(Mat,Vec,Vec);
547c922b88SBarry Smith extern int MatSolveTranspose_SeqBAIJ_2_NaturalOrdering(Mat,Vec,Vec);
55be3590efSBarry Smith extern int MatLUFactorNumeric_SeqBAIJ_3_NaturalOrdering(Mat,Mat*);
56be3590efSBarry Smith extern int MatSolve_SeqBAIJ_3_NaturalOrdering(Mat,Vec,Vec);
577c922b88SBarry Smith extern int MatSolveTranspose_SeqBAIJ_3_NaturalOrdering(Mat,Vec,Vec);
58e24b481bSBarry Smith extern int MatLUFactorNumeric_SeqBAIJ_4_NaturalOrdering(Mat,Mat*);
59e24b481bSBarry Smith extern int MatSolve_SeqBAIJ_4_NaturalOrdering(Mat,Vec,Vec);
607c922b88SBarry Smith extern int MatSolveTranspose_SeqBAIJ_4_NaturalOrdering(Mat,Vec,Vec);
61e24b481bSBarry Smith extern int MatLUFactorNumeric_SeqBAIJ_5_NaturalOrdering(Mat,Mat*);
62e24b481bSBarry Smith extern int MatSolve_SeqBAIJ_5_NaturalOrdering(Mat,Vec,Vec);
637c922b88SBarry Smith extern int MatSolveTranspose_SeqBAIJ_5_NaturalOrdering(Mat,Vec,Vec);
64be3590efSBarry Smith extern int MatLUFactorNumeric_SeqBAIJ_6_NaturalOrdering(Mat,Mat*);
65be3590efSBarry Smith extern int MatSolve_SeqBAIJ_6_NaturalOrdering(Mat,Vec,Vec);
667c922b88SBarry Smith extern int MatSolveTranspose_SeqBAIJ_6_NaturalOrdering(Mat,Vec,Vec);
67be3590efSBarry Smith extern int MatLUFactorNumeric_SeqBAIJ_7_NaturalOrdering(Mat,Mat*);
68be3590efSBarry Smith extern int MatSolve_SeqBAIJ_7_NaturalOrdering(Mat,Vec,Vec);
697c922b88SBarry Smith extern int MatSolveTranspose_SeqBAIJ_7_NaturalOrdering(Mat,Vec,Vec);
702593348eSBarry Smith 
712593348eSBarry Smith #endif
72