xref: /petsc/src/mat/impls/aij/seq/aij.h (revision 5ed2d596fd9914de76abbaed56c65f4792ae57ae)
1 /* $Id: aij.h,v 1.46 2001/08/07 03:02:47 balay Exp $ */
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   PetscTruth use;
11   int        node_count;                    /* number of inodes */
12   int        *size;                         /* size of each inode */
13   int        limit;                         /* inode limit */
14   int        max_limit;                     /* maximum supported inode limit */
15   PetscTruth checked;                       /* if inodes have been checked for */
16 } Mat_SeqAIJ_Inode;
17 
18 /*
19   MATSEQAIJ format - Compressed row storage (also called Yale sparse matrix
20   format), compatible with Fortran.  The i[] and j[] arrays start at 1,
21   or 0, depending on the value of shift.  For example, in Fortran
22   j[i[k]+p+shift] is the pth column in row k.  Note that the diagonal
23   matrix elements are stored with the rest of the nonzeros (not separately).
24 */
25 
26 typedef struct {
27   PetscTruth       sorted;           /* if true, rows are sorted by increasing columns */
28   PetscTruth       roworiented;      /* if true, row-oriented input, default */
29   int              nonew;            /* 1 don't add new nonzeros, -1 generate error on new */
30   PetscTruth       singlemalloc;     /* if true a, i, and j have been obtained with
31                                           one big malloc */
32   PetscTruth       freedata;        /* free the i,j,a data when the matrix is destroyed; true by default */
33   int              nz,maxnz;        /* nonzeros, allocated nonzeros */
34   int              *diag;            /* pointers to diagonal elements */
35   int              *i;               /* pointer to beginning of each row */
36   int              *imax;            /* maximum space allocated for each row */
37   int              *ilen;            /* actual length of each row */
38   int              *j;               /* column values: j + i[k] - 1 is start of row k */
39   PetscScalar      *a;               /* nonzero elements */
40   IS               row,col,icol;   /* index sets, used for reorderings */
41   PetscScalar      *solve_work;      /* work space used in MatSolve */
42   int              indexshift;       /* zero or -one for C or Fortran indexing */
43   Mat_SeqAIJ_Inode inode;            /* identical node informaton */
44   int              reallocs;         /* number of mallocs done during MatSetValues()
45                                         as more values are set than were prealloced */
46   int              rmax;             /* max nonzeros in any row */
47   PetscTruth       ilu_preserve_row_sums;
48   PetscReal        lu_dtcol;
49   PetscTruth       lu_damp;
50   PetscReal        lu_damping;
51   PetscReal        lu_zeropivot;
52   PetscScalar      *saved_values;    /* location for stashing nonzero values of matrix */
53   PetscScalar      *idiag,*ssor;     /* inverse of diagonal entries; space for eisen */
54 
55   PetscTruth       keepzeroedrows;   /* keeps matrix structure same in calls to MatZeroRows()*/
56   PetscTruth       ignorezeroentries;
57   ISColoring       coloring;         /* set with MatADSetColoring() used by MatADSetValues() */
58 } Mat_SeqAIJ;
59 
60 EXTERN int MatILUFactorSymbolic_SeqAIJ(Mat,IS,IS,MatILUInfo*,Mat *);
61 EXTERN int MatDuplicate_SeqAIJ(Mat,MatDuplicateOption,Mat*);
62 EXTERN int MatMarkDiagonal_SeqAIJ(Mat);
63 
64 EXTERN int MatMult_SeqAIJ(Mat A,Vec,Vec);
65 EXTERN int MatMultAdd_SeqAIJ(Mat A,Vec,Vec,Vec);
66 EXTERN int MatMultTranspose_SeqAIJ(Mat A,Vec,Vec);
67 EXTERN int MatMultTransposeAdd_SeqAIJ(Mat A,Vec,Vec,Vec);
68 EXTERN int MatRelax_SeqAIJ(Mat,Vec,PetscReal,MatSORType,PetscReal,int,int,Vec);
69 
70 EXTERN int MatSetColoring_SeqAIJ(Mat,ISColoring);
71 EXTERN int MatSetValuesAdic_SeqAIJ(Mat,void*);
72 EXTERN int MatSetValuesAdifor_SeqAIJ(Mat,int,void*);
73 
74 #endif
75