1*5768c4f9SLois Curfman McInnes /* $Id: aij.h,v 1.25 1996/02/13 23:29:25 bsmith Exp curfman $ */ 2b8a66259SBarry Smith 3b8a66259SBarry Smith #include "matimpl.h" 40068c123SLois Curfman McInnes #include <math.h> 5b8a66259SBarry Smith 62d40f771SBarry Smith #if !defined(__AIJ_H) 72d40f771SBarry Smith #define __AIJ_H 82d40f771SBarry Smith 9ed2daf61SLois Curfman McInnes /* Info about i-nodes (identical nodes) */ 10957e4c30SSatish Balay typedef struct { 11ed2daf61SLois Curfman McInnes int node_count; /* number of inodes */ 12ed2daf61SLois Curfman McInnes int *size; /* size of each inode */ 13ed2daf61SLois Curfman McInnes int limit; /* inode limit */ 14ed2daf61SLois Curfman McInnes int max_limit; /* maximum supported inode limit */ 1576dd722bSSatish Balay } Mat_SeqAIJ_Inode; 16957e4c30SSatish Balay 172d40f771SBarry Smith /* 18ec8511deSBarry Smith MATSEQAIJ format - Compressed row storage (also called Yale sparse matrix 19d35516d3SLois Curfman McInnes format), compatible with Fortran. The i[] and j[] arrays start at 1, 20d5d45c9bSBarry Smith or 0, depending on the value of shift. For example, in Fortran 21*5768c4f9SLois Curfman McInnes j[i[k]+p+shift] is the pth column in row k. Note that the diagonal 22*5768c4f9SLois Curfman McInnes matrix elements are stored with the rest of the nonzeros (not separately). 232d40f771SBarry Smith */ 24d35516d3SLois Curfman McInnes 25b8a66259SBarry Smith typedef struct { 26d35516d3SLois Curfman McInnes int sorted; /* if true, rows are sorted by increasing columns */ 274096ce27SBarry Smith int roworiented; /* if true, row-oriented input, default */ 28d35516d3SLois Curfman McInnes int nonew; /* if true, don't allow new elements to be added */ 29d35516d3SLois Curfman McInnes int singlemalloc; /* if true a, i, and j have been obtained with 30d35516d3SLois Curfman McInnes one big malloc */ 311a1c3055SLois Curfman McInnes int m, n; /* rows, columns */ 3280b4ade8SLois Curfman McInnes int nz, maxnz; /* nonzeros, allocated nonzeros */ 33d35516d3SLois Curfman McInnes int *diag; /* pointers to diagonal elements */ 34d35516d3SLois Curfman McInnes int *i; /* pointer to beginning of each row */ 35d35516d3SLois Curfman McInnes int *imax; /* maximum space allocated for each row */ 36d35516d3SLois Curfman McInnes int *ilen; /* actual length of each row */ 37d35516d3SLois Curfman McInnes int *j; /* column values: j + i[k] - 1 is start of row k */ 38d35516d3SLois Curfman McInnes Scalar *a; /* nonzero elements */ 39d35516d3SLois Curfman McInnes IS row, col; /* index sets, used for reorderings */ 40f6fb444dSLois Curfman McInnes Scalar *solve_work; /* work space used in MatSolve */ 41dbb450caSBarry Smith void *spptr; /* pointer for special library like SuperLU */ 42dbb450caSBarry Smith int indexshift; /* zero or -one for C or Fortran indexing */ 4376dd722bSSatish Balay Mat_SeqAIJ_Inode inode; /* identical node informaton */ 444fc8c0a5SBarry Smith int reallocs; /* number of mallocs done during MatSetValues() 454fc8c0a5SBarry Smith as more values are set then were prealloced for */ 4635aab85fSBarry Smith PetscTruth ilu_preserve_row_sums; 47ec8511deSBarry Smith } Mat_SeqAIJ; 48b8a66259SBarry Smith 4908480c60SBarry Smith extern int MatILUFactorSymbolic_SeqAIJ(Mat,IS,IS,double,int,Mat *); 5008480c60SBarry Smith extern int MatConvert_SeqAIJ(Mat,MatType,Mat *); 513d1612f7SBarry Smith extern int MatConvertSameType_SeqAIJ(Mat, Mat*,int); 5208480c60SBarry Smith extern int MatMarkDiag_SeqAIJ(Mat); 5308480c60SBarry Smith 5408480c60SBarry Smith 552d40f771SBarry Smith #endif 56