Actual source code: baij.h

  1: /* $Id: baij.h,v 1.35 2001/08/07 03:02:55 balay Exp $ */

 3:  #include src/mat/matimpl.h


  8: /*  
  9:   MATSEQBAIJ format - Block compressed row storage. The i[] and j[] 
 10:   arrays start at 0.
 11: */

 13: typedef struct {
 14:   PetscTruth       sorted;       /* if true, rows are sorted by increasing columns */
 15:   PetscTruth       roworiented;  /* if true, row-oriented input, default */
 16:   int              nonew;        /* 1 don't add new nonzeros, -1 generate error on new */
 17:   PetscTruth       singlemalloc; /* if true a, i, and j have been obtained with
 18:                                         one big malloc */
 19:   int              bs,bs2;       /* block size, square of block size */
 20:   int              mbs,nbs;      /* rows/bs, columns/bs */
 21:   int              nz,maxnz;     /* nonzeros, allocated nonzeros */
 22:   int              *diag;        /* pointers to diagonal elements */
 23:   int              *i;           /* pointer to beginning of each row */
 24:   int              *imax;        /* maximum space allocated for each row */
 25:   int              *ilen;        /* actual length of each row */
 26:   int              *j;           /* column values: j + i[k] - 1 is start of row k */
 27:   MatScalar        *a;           /* nonzero elements */
 28:   IS               row,col,icol; /* index sets, used for reorderings */
 29:   PetscScalar      *solve_work;  /* work space used in MatSolve */
 30:   int              reallocs;     /* number of mallocs done during MatSetValues() 
 31:                                     as more values are set then were preallocated */
 32:   PetscScalar      *mult_work;   /* work array for matrix vector product*/
 33:   PetscScalar      *saved_values;

 35:   PetscTruth       keepzeroedrows; /* if true, MatZeroRows() will not change nonzero structure */

 37: #if defined(PETSC_USE_MAT_SINGLE)
 38:   int              setvalueslen;
 39:   MatScalar        *setvaluescopy; /* area double precision values in MatSetValuesXXX() are copied
 40:                                       before calling MatSetValuesXXX_SeqBAIJ_MatScalar() */
 41: #endif
 42:   PetscTruth       pivotinblocks;  /* pivot inside factorization of each diagonal block */
 43: } Mat_SeqBAIJ;

 45: EXTERN int MatILUFactorSymbolic_SeqBAIJ(Mat,IS,IS,MatILUInfo*,Mat *);
 46: EXTERN int MatDuplicate_SeqBAIJ(Mat,MatDuplicateOption,Mat*);
 47: EXTERN int MatMarkDiagonal_SeqBAIJ(Mat);

 49: EXTERN int MatLUFactorSymbolic_SeqBAIJ(Mat,IS,IS,MatLUInfo*,Mat*);
 50: EXTERN int MatLUFactor_SeqBAIJ(Mat,IS,IS,MatLUInfo*);
 51: EXTERN int MatIncreaseOverlap_SeqBAIJ(Mat,int,IS*,int);
 52: EXTERN int MatGetSubMatrix_SeqBAIJ(Mat,IS,IS,int,MatReuse,Mat*);
 53: EXTERN int MatGetSubMatrices_SeqBAIJ(Mat,int,IS*,IS*,MatReuse,Mat**);
 54: EXTERN int MatMultTranspose_SeqBAIJ(Mat,Vec,Vec);
 55: EXTERN int MatMultTransposeAdd_SeqBAIJ(Mat,Vec,Vec,Vec);
 56: EXTERN int MatScale_SeqBAIJ(PetscScalar*,Mat);
 57: EXTERN int MatNorm_SeqBAIJ(Mat,NormType,PetscReal *);
 58: EXTERN int MatEqual_SeqBAIJ(Mat,Mat,PetscTruth*);
 59: EXTERN int MatGetDiagonal_SeqBAIJ(Mat,Vec);
 60: EXTERN int MatDiagonalScale_SeqBAIJ(Mat,Vec,Vec);
 61: EXTERN int MatGetInfo_SeqBAIJ(Mat,MatInfoType,MatInfo *);
 62: EXTERN int MatZeroEntries_SeqBAIJ(Mat);

 64: EXTERN int MatSeqBAIJ_UpdateFactorNumeric_NaturalOrdering(Mat);
 65: EXTERN int MatSeqBAIJ_UpdateSolvers(Mat);

 67: EXTERN int MatSolve_SeqBAIJ_Update(Mat,Vec,Vec);
 68: EXTERN int MatSolve_SeqBAIJ_1(Mat,Vec,Vec);
 69: EXTERN int MatSolve_SeqBAIJ_1_NaturalOrdering(Mat,Vec,Vec);
 70: EXTERN int MatSolve_SeqBAIJ_2(Mat,Vec,Vec);
 71: EXTERN int MatSolve_SeqBAIJ_2_NaturalOrdering(Mat,Vec,Vec);
 72: EXTERN int MatSolve_SeqBAIJ_3(Mat,Vec,Vec);
 73: EXTERN int MatSolve_SeqBAIJ_3_NaturalOrdering(Mat,Vec,Vec);
 74: EXTERN int MatSolve_SeqBAIJ_4(Mat,Vec,Vec);
 75: EXTERN int MatSolve_SeqBAIJ_4_NaturalOrdering(Mat,Vec,Vec);
 76: #if defined(PETSC_HAVE_SSE)
 77: EXTERN int MatSolve_SeqBAIJ_4_SSE_Demotion(Mat,Vec,Vec);
 78: EXTERN int MatSolve_SeqBAIJ_4_NaturalOrdering_SSE_Demotion(Mat,Vec,Vec);
 79: #endif
 80: EXTERN int MatSolve_SeqBAIJ_5(Mat,Vec,Vec);
 81: EXTERN int MatSolve_SeqBAIJ_5_NaturalOrdering(Mat,Vec,Vec);
 82: EXTERN int MatSolve_SeqBAIJ_6(Mat,Vec,Vec);
 83: EXTERN int MatSolve_SeqBAIJ_6_NaturalOrdering(Mat,Vec,Vec);
 84: EXTERN int MatSolve_SeqBAIJ_7(Mat,Vec,Vec);
 85: EXTERN int MatSolve_SeqBAIJ_7_NaturalOrdering(Mat,Vec,Vec);
 86: EXTERN int MatSolve_SeqBAIJ_N(Mat,Vec,Vec);

 88: EXTERN int MatSolveTranspose_SeqBAIJ_Update(Mat,Vec,Vec);
 89: EXTERN int MatSolveTranspose_SeqBAIJ_1(Mat,Vec,Vec);
 90: EXTERN int MatSolveTranspose_SeqBAIJ_1_NaturalOrdering(Mat,Vec,Vec);
 91: EXTERN int MatSolveTranspose_SeqBAIJ_2(Mat,Vec,Vec);
 92: EXTERN int MatSolveTranspose_SeqBAIJ_2_NaturalOrdering(Mat,Vec,Vec);
 93: EXTERN int MatSolveTranspose_SeqBAIJ_3(Mat,Vec,Vec);
 94: EXTERN int MatSolveTranspose_SeqBAIJ_3_NaturalOrdering(Mat,Vec,Vec);
 95: EXTERN int MatSolveTranspose_SeqBAIJ_4(Mat,Vec,Vec);
 96: EXTERN int MatSolveTranspose_SeqBAIJ_4_NaturalOrdering(Mat,Vec,Vec);
 97: EXTERN int MatSolveTranspose_SeqBAIJ_5(Mat,Vec,Vec);
 98: EXTERN int MatSolveTranspose_SeqBAIJ_5_NaturalOrdering(Mat,Vec,Vec);
 99: EXTERN int MatSolveTranspose_SeqBAIJ_6(Mat,Vec,Vec);
100: EXTERN int MatSolveTranspose_SeqBAIJ_6_NaturalOrdering(Mat,Vec,Vec);
101: EXTERN int MatSolveTranspose_SeqBAIJ_7(Mat,Vec,Vec);
102: EXTERN int MatSolveTranspose_SeqBAIJ_7_NaturalOrdering(Mat,Vec,Vec);

104: EXTERN int MatLUFactorNumeric_SeqBAIJ_1(Mat,Mat*);
105: EXTERN int MatLUFactorNumeric_SeqBAIJ_2(Mat,Mat*);
106: EXTERN int MatLUFactorNumeric_SeqBAIJ_2_NaturalOrdering(Mat,Mat*);
107: EXTERN int MatLUFactorNumeric_SeqBAIJ_3(Mat,Mat*);
108: EXTERN int MatLUFactorNumeric_SeqBAIJ_3_NaturalOrdering(Mat,Mat*);
109: EXTERN int MatLUFactorNumeric_SeqBAIJ_4(Mat,Mat*);
110: EXTERN int MatLUFactorNumeric_SeqBAIJ_4_NaturalOrdering(Mat,Mat*);
111: #if defined(PETSC_HAVE_SSE)
112: EXTERN int MatLUFactorNumeric_SeqBAIJ_4_NaturalOrdering_SSE(Mat,Mat*);
113: #else
114: #endif
115: EXTERN int MatLUFactorNumeric_SeqBAIJ_5(Mat,Mat*);
116: EXTERN int MatLUFactorNumeric_SeqBAIJ_5_NaturalOrdering(Mat,Mat*);
117: EXTERN int MatLUFactorNumeric_SeqBAIJ_6(Mat,Mat*);
118: EXTERN int MatLUFactorNumeric_SeqBAIJ_6_NaturalOrdering(Mat,Mat*);
119: EXTERN int MatLUFactorNumeric_SeqBAIJ_7(Mat,Mat*);
120: EXTERN int MatLUFactorNumeric_SeqBAIJ_7_NaturalOrdering(Mat,Mat*);
121: EXTERN int MatLUFactorNumeric_SeqBAIJ_N(Mat,Mat*);

123: EXTERN int MatMult_SeqBAIJ_1(Mat,Vec,Vec);
124: EXTERN int MatMult_SeqBAIJ_2(Mat,Vec,Vec);
125: EXTERN int MatMult_SeqBAIJ_3(Mat,Vec,Vec);
126: EXTERN int MatMult_SeqBAIJ_4(Mat,Vec,Vec);
127: EXTERN int MatMult_SeqBAIJ_5(Mat,Vec,Vec);
128: EXTERN int MatMult_SeqBAIJ_6(Mat,Vec,Vec);
129: EXTERN int MatMult_SeqBAIJ_7(Mat,Vec,Vec);
130: EXTERN int MatMult_SeqBAIJ_N(Mat,Vec,Vec);

132: EXTERN int MatMultAdd_SeqBAIJ_1(Mat,Vec,Vec,Vec);
133: EXTERN int MatMultAdd_SeqBAIJ_2(Mat,Vec,Vec,Vec);
134: EXTERN int MatMultAdd_SeqBAIJ_3(Mat,Vec,Vec,Vec);
135: EXTERN int MatMultAdd_SeqBAIJ_4(Mat,Vec,Vec,Vec);
136: EXTERN int MatMultAdd_SeqBAIJ_5(Mat,Vec,Vec,Vec);
137: EXTERN int MatMultAdd_SeqBAIJ_6(Mat,Vec,Vec,Vec);
138: EXTERN int MatMultAdd_SeqBAIJ_7(Mat,Vec,Vec,Vec);
139: EXTERN int MatMultAdd_SeqBAIJ_N(Mat,Vec,Vec,Vec);

141: #endif