1 /* $Id: aij.h,v 1.32 1998/10/09 19:22:05 bsmith Exp bsmith $ */ 2 3 #include "src/mat/matimpl.h" 4 5 #if !defined(__AIJ_H) 6 #define __AIJ_H 7 8 /* Info about i-nodes (identical nodes) */ 9 typedef struct { 10 int node_count; /* number of inodes */ 11 int *size; /* size of each inode */ 12 int limit; /* inode limit */ 13 int max_limit; /* maximum supported inode limit */ 14 } Mat_SeqAIJ_Inode; 15 16 /* 17 MATSEQAIJ format - Compressed row storage (also called Yale sparse matrix 18 format), compatible with Fortran. The i[] and j[] arrays start at 1, 19 or 0, depending on the value of shift. For example, in Fortran 20 j[i[k]+p+shift] is the pth column in row k. Note that the diagonal 21 matrix elements are stored with the rest of the nonzeros (not separately). 22 */ 23 24 typedef struct { 25 int sorted; /* if true, rows are sorted by increasing columns */ 26 int roworiented; /* if true, row-oriented input, default */ 27 int nonew; /* 1 don't add new nonzeros, -1 generate error on new */ 28 int singlemalloc; /* if true a, i, and j have been obtained with 29 one big malloc */ 30 int m, n; /* rows, columns */ 31 int nz, maxnz; /* nonzeros, allocated nonzeros */ 32 int *diag; /* pointers to diagonal elements */ 33 int *i; /* pointer to beginning of each row */ 34 int *imax; /* maximum space allocated for each row */ 35 int *ilen; /* actual length of each row */ 36 int *j; /* column values: j + i[k] - 1 is start of row k */ 37 Scalar *a; /* nonzero elements */ 38 IS row, col, icol; /* index sets, used for reorderings */ 39 Scalar *solve_work; /* work space used in MatSolve */ 40 void *spptr; /* pointer for special library like SuperLU */ 41 int indexshift; /* zero or -one for C or Fortran indexing */ 42 Mat_SeqAIJ_Inode inode; /* identical node informaton */ 43 int reallocs; /* number of mallocs done during MatSetValues() 44 as more values are set than were prealloced */ 45 PetscTruth ilu_preserve_row_sums; 46 Scalar *saved_values; /* location for stashing nonzero values of matrix */ 47 } Mat_SeqAIJ; 48 49 extern int MatILUFactorSymbolic_SeqAIJ(Mat,IS,IS,double,int,Mat *); 50 extern int MatConvert_SeqAIJ(Mat,MatType,Mat *); 51 extern int MatDuplicate_SeqAIJ(Mat,MatDuplicateOption, Mat*); 52 extern int MatMarkDiag_SeqAIJ(Mat); 53 54 extern int MatMult_SeqAIJ(Mat A,Vec,Vec); 55 extern int MatMultAdd_SeqAIJ(Mat A,Vec,Vec,Vec); 56 extern int MatMultTrans_SeqAIJ(Mat A,Vec,Vec); 57 extern int MatMultTransAdd_SeqAIJ(Mat A,Vec,Vec,Vec); 58 extern int MatRelax_SeqAIJ(Mat,Vec,double,MatSORType,double,int,Vec); 59 60 #endif 61