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