xref: /petsc/include/petscmat.h (revision efcf0fc353b705cc10d937cc67ff6a314bf622fa)
173f4d377SMatthew Knepley /* $Id: petscmat.h,v 1.228 2001/09/07 20:09:08 bsmith Exp $ */
22eac72dbSBarry Smith /*
32eac72dbSBarry Smith      Include file for the matrix component of PETSc
42eac72dbSBarry Smith */
50a835dfdSSatish Balay #ifndef __PETSCMAT_H
60a835dfdSSatish Balay #define __PETSCMAT_H
70a835dfdSSatish Balay #include "petscvec.h"
8e9fa29b7SSatish Balay PETSC_EXTERN_CXX_BEGIN
92eac72dbSBarry Smith 
10d9274352SBarry Smith /*S
11d9274352SBarry Smith      Mat - Abstract PETSc matrix object
122eac72dbSBarry Smith 
13d91e6319SBarry Smith    Level: beginner
14d91e6319SBarry Smith 
15d9274352SBarry Smith   Concepts: matrix; linear operator
16d9274352SBarry Smith 
17d9274352SBarry Smith .seealso:  MatCreate(), MatType, MatSetType()
18d9274352SBarry Smith S*/
19d9274352SBarry Smith typedef struct _p_Mat*           Mat;
20d9274352SBarry Smith 
21d9274352SBarry Smith /*E
22d9274352SBarry Smith     MatType - String with the name of a PETSc matrix or the creation function
23d9274352SBarry Smith        with an optional dynamic library name, for example
24d9274352SBarry Smith        http://www.mcs.anl.gov/petsc/lib.a:mymatcreate()
25d9274352SBarry Smith 
26d9274352SBarry Smith    Level: beginner
27d9274352SBarry Smith 
28d9274352SBarry Smith .seealso: MatSetType(), Mat
29d91e6319SBarry Smith E*/
30273d9f13SBarry Smith #define MATSAME            "same"
31273d9f13SBarry Smith #define MATSEQMAIJ         "seqmaij"
32273d9f13SBarry Smith #define MATMPIMAIJ         "mpimaij"
33209238afSKris Buschelman #define MATMAIJ            "maij"
34273d9f13SBarry Smith #define MATIS              "is"
35273d9f13SBarry Smith #define MATMPIROWBS        "mpirowbs"
36273d9f13SBarry Smith #define MATSEQAIJ          "seqaij"
37273d9f13SBarry Smith #define MATMPIAIJ          "mpiaij"
38209238afSKris Buschelman #define MATAIJ             "aij"
39273d9f13SBarry Smith #define MATSHELL           "shell"
40273d9f13SBarry Smith #define MATSEQBDIAG        "seqbdiag"
41273d9f13SBarry Smith #define MATMPIBDIAG        "mpibdiag"
42209238afSKris Buschelman #define MATBDIAG           "bdiag"
43209238afSKris Buschelman #define MATSEQDENSE        "seqdense"
44273d9f13SBarry Smith #define MATMPIDENSE        "mpidense"
45209238afSKris Buschelman #define MATDENSE           "dense"
46273d9f13SBarry Smith #define MATSEQBAIJ         "seqbaij"
47273d9f13SBarry Smith #define MATMPIBAIJ         "mpibaij"
48209238afSKris Buschelman #define MATBAIJ            "baij"
49273d9f13SBarry Smith #define MATMPIADJ          "mpiadj"
50273d9f13SBarry Smith #define MATSEQSBAIJ        "seqsbaij"
51273d9f13SBarry Smith #define MATMPISBAIJ        "mpisbaij"
52209238afSKris Buschelman #define MATSBAIJ           "sbaij"
53cebc7f6cSBarry Smith #define MATDAAD            "daad"
54cebc7f6cSBarry Smith #define MATMFFD            "mffd"
556d88219bSBarry Smith #define MATESI             "esi"
566d88219bSBarry Smith #define MATPETSCESI        "petscesi"
57c8a8475eSBarry Smith #define MATNORMAL          "normal"
58b3a1e11cSKris Buschelman #define MATSEQAIJSPOOLES   "seqaijspooles"
59d10c748bSKris Buschelman #define MATMPIAIJSPOOLES   "mpiaijspooles"
609abb65ffSKris Buschelman #define MATSEQSBAIJSPOOLES "seqsbaijspooles"
6122191285SKris Buschelman #define MATMPISBAIJSPOOLES "mpisbaijspooles"
6214b396bbSKris Buschelman #define MATSUPERLU         "superlu"
631d96aa28SKris Buschelman #define MATSUPERLU_DIST    "superlu_dist"
641677d0b8SKris Buschelman #define MATUMFPACK         "umfpack"
65e8aa55a4SKris Buschelman #define MATESSL            "essl"
664eb8e494SKris Buschelman #define MATLUSOL           "lusol"
67397b6df1SKris Buschelman #define MATAIJMUMPS        "aijmumps"
68397b6df1SKris Buschelman #define MATSBAIJMUMPS      "sbaijmumps"
698da957c5SKris Buschelman #define MATDSCPACK         "dscpack"
70273d9f13SBarry Smith typedef char* MatType;
71d91e6319SBarry Smith 
72c06d978dSMatthew Knepley #define MAT_SER_SEQAIJ_BINARY "seqaij_binary"
73c06d978dSMatthew Knepley #define MAT_SER_MPIAIJ_BINARY "mpiaij_binary"
74c06d978dSMatthew Knepley typedef char *MatSerializeType;
75c06d978dSMatthew Knepley 
76c06d978dSMatthew Knepley /* Logging support */
77552e946dSBarry Smith #define    MAT_FILE_COOKIE 1211216    /* used to indicate matrices in binary files */
78c06d978dSMatthew Knepley extern int MAT_COOKIE;
7971d41ebeSBarry Smith extern int MATSNESMFCTX_COOKIE;
80c06d978dSMatthew Knepley extern int MAT_FDCOLORING_COOKIE;
818ba1e511SMatthew Knepley extern int MAT_PARTITIONING_COOKIE;
828ba1e511SMatthew Knepley extern int MAT_NULLSPACE_COOKIE;
83d59c15a7SBarry Smith extern int MAT_Mult, MAT_MultMatrixFree, MAT_Mults, MAT_MultConstrained, MAT_MultAdd, MAT_MultTranspose;
84d59c15a7SBarry Smith extern int MAT_MultTransposeConstrained, MAT_MultTransposeAdd, MAT_Solve, MAT_Solves, MAT_SolveAdd, MAT_SolveTranspose;
85d5ba7fb7SMatthew Knepley extern int MAT_SolveTransposeAdd, MAT_Relax, MAT_ForwardSolve, MAT_BackwardSolve, MAT_LUFactor, MAT_LUFactorSymbolic;
86d5ba7fb7SMatthew Knepley extern int MAT_LUFactorNumeric, MAT_CholeskyFactor, MAT_CholeskyFactorSymbolic, MAT_CholeskyFactorNumeric, MAT_ILUFactor;
87d5ba7fb7SMatthew Knepley extern int MAT_ILUFactorSymbolic, MAT_ICCFactorSymbolic, MAT_Copy, MAT_Convert, MAT_Scale, MAT_AssemblyBegin;
88d5ba7fb7SMatthew Knepley extern int MAT_AssemblyEnd, MAT_SetValues, MAT_GetValues, MAT_GetRow, MAT_GetSubMatrices, MAT_GetColoring, MAT_GetOrdering;
89d5ba7fb7SMatthew Knepley extern int MAT_IncreaseOverlap, MAT_Partitioning, MAT_ZeroEntries, MAT_Load, MAT_View, MAT_AXPY, MAT_FDColoringCreate;
9066f9b7ceSBarry Smith extern int MAT_FDColoringApply, MAT_Transpose, MAT_FDColoringFunction;
91c06d978dSMatthew Knepley 
928ba1e511SMatthew Knepley EXTERN int MatInitializePackage(char *);
93c06d978dSMatthew Knepley 
94273d9f13SBarry Smith EXTERN int MatCreate(MPI_Comm,int,int,int,int,Mat*);
95273d9f13SBarry Smith EXTERN int MatSetType(Mat,MatType);
96273d9f13SBarry Smith EXTERN int MatSetFromOptions(Mat);
97273d9f13SBarry Smith EXTERN int MatSetUpPreallocation(Mat);
98273d9f13SBarry Smith EXTERN int MatRegisterAll(char*);
99273d9f13SBarry Smith EXTERN int MatRegister(char*,char*,char*,int(*)(Mat));
100c06d978dSMatthew Knepley EXTERN int MatSerializeRegister(const char [], const char [], const char [], int (*)(MPI_Comm, Mat *, PetscViewer, PetscTruth));
10130de9b25SBarry Smith 
10230de9b25SBarry Smith /*MC
10330de9b25SBarry Smith    MatRegisterDynamic - Adds a new matrix type
10430de9b25SBarry Smith 
10530de9b25SBarry Smith    Synopsis:
10630de9b25SBarry Smith    int MatRegisterDynamic(char *name,char *path,char *name_create,int (*routine_create)(Mat))
10730de9b25SBarry Smith 
10830de9b25SBarry Smith    Not Collective
10930de9b25SBarry Smith 
11030de9b25SBarry Smith    Input Parameters:
11130de9b25SBarry Smith +  name - name of a new user-defined matrix type
11230de9b25SBarry Smith .  path - path (either absolute or relative) the library containing this solver
11330de9b25SBarry Smith .  name_create - name of routine to create method context
11430de9b25SBarry Smith -  routine_create - routine to create method context
11530de9b25SBarry Smith 
11630de9b25SBarry Smith    Notes:
11730de9b25SBarry Smith    MatRegisterDynamic() may be called multiple times to add several user-defined solvers.
11830de9b25SBarry Smith 
11930de9b25SBarry Smith    If dynamic libraries are used, then the fourth input argument (routine_create)
12030de9b25SBarry Smith    is ignored.
12130de9b25SBarry Smith 
12230de9b25SBarry Smith    Sample usage:
12330de9b25SBarry Smith .vb
12430de9b25SBarry Smith    MatRegisterDynamic("my_mat",/home/username/my_lib/lib/libO/solaris/mylib.a,
12530de9b25SBarry Smith                "MyMatCreate",MyMatCreate);
12630de9b25SBarry Smith .ve
12730de9b25SBarry Smith 
12830de9b25SBarry Smith    Then, your solver can be chosen with the procedural interface via
12930de9b25SBarry Smith $     MatSetType(Mat,"my_mat")
13030de9b25SBarry Smith    or at runtime via the option
13130de9b25SBarry Smith $     -mat_type my_mat
13230de9b25SBarry Smith 
13330de9b25SBarry Smith    Level: advanced
13430de9b25SBarry Smith 
13530de9b25SBarry Smith    Notes: ${PETSC_ARCH} and ${BOPT} occuring in pathname will be replaced with appropriate values.
13630de9b25SBarry Smith          If your function is not being put into a shared library then use VecRegister() instead
13730de9b25SBarry Smith 
13830de9b25SBarry Smith .keywords: Mat, register
13930de9b25SBarry Smith 
14030de9b25SBarry Smith .seealso: MatRegisterAll(), MatRegisterDestroy()
14130de9b25SBarry Smith 
14230de9b25SBarry Smith M*/
143273d9f13SBarry Smith #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
144273d9f13SBarry Smith #define MatRegisterDynamic(a,b,c,d) MatRegister(a,b,c,0)
145273d9f13SBarry Smith #else
146273d9f13SBarry Smith #define MatRegisterDynamic(a,b,c,d) MatRegister(a,b,c,d)
14730de9b25SBarry Smith #endif
14830de9b25SBarry Smith 
14930de9b25SBarry Smith #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
15030de9b25SBarry Smith #define MatSerializeRegisterDynamic(a,b,c,d) MatSerializeRegister(a,b,c,0)
15130de9b25SBarry Smith #else
152c06d978dSMatthew Knepley #define MatSerializeRegisterDynamic(a,b,c,d) MatSerializeRegister(a,b,c,d)
153273d9f13SBarry Smith #endif
15430de9b25SBarry Smith 
155273d9f13SBarry Smith extern PetscTruth MatRegisterAllCalled;
156b0a32e0cSBarry Smith extern PetscFList MatList;
15728988994SBarry Smith 
158c06d978dSMatthew Knepley EXTERN PetscFList MatSerializeList;
159c06d978dSMatthew Knepley EXTERN int MatSerializeRegisterAll(const char []);
16065804fbbSSatish Balay EXTERN int MatSerializeRegisterDestroy(void);
161c06d978dSMatthew Knepley EXTERN int MatSerializeRegisterAllCalled;
162c06d978dSMatthew Knepley EXTERN int MatSerialize(MPI_Comm, Mat *, PetscViewer, PetscTruth);
163c06d978dSMatthew Knepley EXTERN int MatSetSerializeType(Mat, MatSerializeType);
164c06d978dSMatthew Knepley 
165ca01db9bSBarry Smith EXTERN int MatCreateSeqDense(MPI_Comm,int,int,PetscScalar[],Mat*);
166ca01db9bSBarry Smith EXTERN int MatCreateMPIDense(MPI_Comm,int,int,int,int,PetscScalar[],Mat*);
167ca01db9bSBarry Smith EXTERN int MatCreateSeqAIJ(MPI_Comm,int,int,int,const int[],Mat*);
168ca01db9bSBarry Smith EXTERN int MatCreateMPIAIJ(MPI_Comm,int,int,int,int,int,const int[],int,const int[],Mat*);
169ca01db9bSBarry Smith EXTERN int MatCreateMPIRowbs(MPI_Comm,int,int,int,const int[],Mat*);
170ca01db9bSBarry Smith EXTERN int MatCreateSeqBDiag(MPI_Comm,int,int,int,int,const int[],PetscScalar*[],Mat*);
171ca01db9bSBarry Smith EXTERN int MatCreateMPIBDiag(MPI_Comm,int,int,int,int,int,const int[],PetscScalar*[],Mat*);
172ca01db9bSBarry Smith EXTERN int MatCreateSeqBAIJ(MPI_Comm,int,int,int,int,const int[],Mat*);
173ca01db9bSBarry Smith EXTERN int MatCreateMPIBAIJ(MPI_Comm,int,int,int,int,int,int,const int[],int,const int[],Mat*);
174ca01db9bSBarry Smith EXTERN int MatCreateMPIAdj(MPI_Comm,int,int,int[],int[],int[],Mat*);
175ca01db9bSBarry Smith EXTERN int MatCreateSeqSBAIJ(MPI_Comm,int,int,int,int,const int[],Mat*);
176ca01db9bSBarry Smith EXTERN int MatCreateMPISBAIJ(MPI_Comm,int,int,int,int,int,int,const int[],int,const int[],Mat*);
177ca44d042SBarry Smith EXTERN int MatCreateShell(MPI_Comm,int,int,int,int,void *,Mat*);
1783a7fca6bSBarry Smith EXTERN int MatCreateAdic(MPI_Comm,int,int,int,int,int,void (*)(void),Mat*);
179c8a8475eSBarry Smith EXTERN int MatCreateNormal(Mat,Mat*);
180435da068SBarry Smith EXTERN int MatDestroy(Mat);
18121c89e3eSBarry Smith 
182ca44d042SBarry Smith EXTERN int MatPrintHelp(Mat);
1838a124369SBarry Smith EXTERN int MatGetPetscMaps(Mat,PetscMap*,PetscMap*);
184ec0117caSBarry Smith 
1858ed539a5SBarry Smith /* ------------------------------------------------------------*/
186f15d580aSBarry Smith EXTERN int MatSetValues(Mat,int,const int[],int,const int[],const PetscScalar[],InsertMode);
187f15d580aSBarry Smith EXTERN int MatSetValuesBlocked(Mat,int,const int[],int,const int[],const PetscScalar[],InsertMode);
18884cb2905SBarry Smith 
1892ef4de8bSBarry Smith /*S
1902ef4de8bSBarry Smith      MatStencil - Data structure (C struct) for storing information about a single row or
1912ef4de8bSBarry Smith         column of a matrix as index on an associated grid.
1922ef4de8bSBarry Smith 
1932ef4de8bSBarry Smith    Level: beginner
1942ef4de8bSBarry Smith 
1952ef4de8bSBarry Smith   Concepts: matrix; linear operator
1962ef4de8bSBarry Smith 
1972ef4de8bSBarry Smith .seealso:  MatSetValuesStencil(), MatSetStencil()
1982ef4de8bSBarry Smith S*/
199435da068SBarry Smith typedef struct {
200435da068SBarry Smith   int k,j,i,c;
201435da068SBarry Smith } MatStencil;
2022ef4de8bSBarry Smith 
203f15d580aSBarry Smith EXTERN int MatSetValuesStencil(Mat,int,const MatStencil[],int,const MatStencil[],const PetscScalar[],InsertMode);
204f15d580aSBarry Smith EXTERN int MatSetValuesBlockedStencil(Mat,int,const MatStencil[],int,const MatStencil[],const PetscScalar[],InsertMode);
205f15d580aSBarry Smith EXTERN int MatSetStencil(Mat,int,const int[],const int[],int);
206435da068SBarry Smith 
2073a7fca6bSBarry Smith EXTERN int MatSetColoring(Mat,ISColoring);
2083a7fca6bSBarry Smith EXTERN int MatSetValuesAdic(Mat,void*);
2093a7fca6bSBarry Smith EXTERN int MatSetValuesAdifor(Mat,int,void*);
2103a7fca6bSBarry Smith 
211d91e6319SBarry Smith /*E
212d91e6319SBarry Smith     MatAssemblyType - Indicates if the matrix is now to be used, or if you plan
213d91e6319SBarry Smith      to continue to add values to it
214d91e6319SBarry Smith 
215d91e6319SBarry Smith     Level: beginner
216d91e6319SBarry Smith 
217d91e6319SBarry Smith .seealso: MatAssemblyBegin(), MatAssemblyEnd()
218d91e6319SBarry Smith E*/
2196d4a8577SBarry Smith typedef enum {MAT_FLUSH_ASSEMBLY=1,MAT_FINAL_ASSEMBLY=0} MatAssemblyType;
220ca44d042SBarry Smith EXTERN int MatAssemblyBegin(Mat,MatAssemblyType);
221ca44d042SBarry Smith EXTERN int MatAssemblyEnd(Mat,MatAssemblyType);
222ca44d042SBarry Smith EXTERN int MatAssembled(Mat,PetscTruth*);
2234f9c727eSBarry Smith 
22430de9b25SBarry Smith /*MC
22530de9b25SBarry Smith    MatSetValue - Set a single entry into a matrix.
22630de9b25SBarry Smith 
22730de9b25SBarry Smith    Synopsis:
22830de9b25SBarry Smith    int MatSetValue(Mat m,int row,int col,PetscScalar value,InsertMode mode);
22930de9b25SBarry Smith 
23030de9b25SBarry Smith    Not collective
23130de9b25SBarry Smith 
23230de9b25SBarry Smith    Input Parameters:
23330de9b25SBarry Smith +  m - the matrix
23430de9b25SBarry Smith .  row - the row location of the entry
23530de9b25SBarry Smith .  col - the column location of the entry
23630de9b25SBarry Smith .  value - the value to insert
23730de9b25SBarry Smith -  mode - either INSERT_VALUES or ADD_VALUES
23830de9b25SBarry Smith 
23930de9b25SBarry Smith    Notes:
24030de9b25SBarry Smith    For efficiency one should use MatSetValues() and set several or many
24130de9b25SBarry Smith    values simultaneously if possible.
24230de9b25SBarry Smith 
24330de9b25SBarry Smith    Note that MatSetValue() does NOT return an error code (since this
24430de9b25SBarry Smith    is checked internally).
24530de9b25SBarry Smith 
24630de9b25SBarry Smith    Level: beginner
24730de9b25SBarry Smith 
24830de9b25SBarry Smith .seealso: MatSetValues(), MatSetValueLocal()
24930de9b25SBarry Smith M*/
250b951964fSBarry Smith #define MatSetValue(v,i,j,va,mode) \
251ea709b57SSatish Balay 0; {int _ierr,_row = i,_col = j; PetscScalar _va = va; \
252b951964fSBarry Smith   _ierr = MatSetValues(v,1,&_row,1,&_col,&_va,mode);CHKERRQ(_ierr); \
253b951964fSBarry Smith }
25430de9b25SBarry Smith 
255ea06a074SBarry Smith #define MatGetValue(v,i,j,va) \
256d91e6319SBarry Smith 0; {int _ierr,_row = i,_col = j; \
257ea06a074SBarry Smith   _ierr = MatGetValues(v,1,&_row,1,&_col,&va);CHKERRQ(_ierr); \
258ea06a074SBarry Smith }
25930de9b25SBarry Smith 
260d91e6319SBarry Smith #define MatSetValueLocal(v,i,j,va,mode) \
261ea709b57SSatish Balay 0; {int _ierr,_row = i,_col = j; PetscScalar _va = va; \
262d91e6319SBarry Smith   _ierr = MatSetValuesLocal(v,1,&_row,1,&_col,&_va,mode);CHKERRQ(_ierr); \
263d91e6319SBarry Smith }
26430de9b25SBarry Smith 
265d91e6319SBarry Smith /*E
266d91e6319SBarry Smith     MatOption - Options that may be set for a matrix and its behavior or storage
267d91e6319SBarry Smith 
268d91e6319SBarry Smith     Level: beginner
269d91e6319SBarry Smith 
2700a835dfdSSatish Balay    Any additions/changes here MUST also be made in include/finclude/petscmat.h
271d91e6319SBarry Smith 
272d91e6319SBarry Smith .seealso: MatSetOption()
273d91e6319SBarry Smith E*/
2746d4a8577SBarry Smith typedef enum {MAT_ROW_ORIENTED=1,MAT_COLUMN_ORIENTED=2,MAT_ROWS_SORTED=4,
2756d4a8577SBarry Smith               MAT_COLUMNS_SORTED=8,MAT_NO_NEW_NONZERO_LOCATIONS=16,
2766d4a8577SBarry Smith               MAT_YES_NEW_NONZERO_LOCATIONS=32,MAT_SYMMETRIC=64,
2776ca9ecd3SBarry Smith               MAT_STRUCTURALLY_SYMMETRIC=65,MAT_NO_NEW_DIAGONALS=66,
2786ca9ecd3SBarry Smith               MAT_YES_NEW_DIAGONALS=67,MAT_INODE_LIMIT_1=68,MAT_INODE_LIMIT_2=69,
2796ca9ecd3SBarry Smith               MAT_INODE_LIMIT_3=70,MAT_INODE_LIMIT_4=71,MAT_INODE_LIMIT_5=72,
2806ca9ecd3SBarry Smith               MAT_IGNORE_OFF_PROC_ENTRIES=73,MAT_ROWS_UNSORTED=74,
2814787f768SSatish Balay               MAT_COLUMNS_UNSORTED=75,MAT_NEW_NONZERO_LOCATION_ERR=76,
2827c922b88SBarry Smith               MAT_NEW_NONZERO_ALLOCATION_ERR=77,MAT_USE_HASH_TABLE=78,
2832bad1931SBarry Smith               MAT_KEEP_ZEROED_ROWS=79,MAT_IGNORE_ZERO_ENTRIES=80,MAT_USE_INODES=81,
284*efcf0fc3SBarry Smith               MAT_DO_NOT_USE_INODES=82,MAT_NOT_SYMMETRIC=83,MAT_HERMITIAN=84,
285*efcf0fc3SBarry Smith               MAT_NOT_STRUCTURALLY_SYMMETRIC=85,MAT_NOT_HERMITIAN=86} MatOption;
286ca44d042SBarry Smith EXTERN int MatSetOption(Mat,MatOption);
287273d9f13SBarry Smith EXTERN int MatGetType(Mat,MatType*);
28884cb2905SBarry Smith 
289f15d580aSBarry Smith EXTERN int MatGetValues(Mat,int,const int[],int,const int[],PetscScalar[]);
290f15d580aSBarry Smith EXTERN int MatGetRow(Mat,int,int *,int *[],PetscScalar*[]);
291f15d580aSBarry Smith EXTERN int MatRestoreRow(Mat,int,int *,int *[],PetscScalar*[]);
2924e7234bfSBarry Smith EXTERN int MatGetColumn(Mat,int,int *,int *[],PetscScalar*[]);
2934e7234bfSBarry Smith EXTERN int MatRestoreColumn(Mat,int,int *,int *[],PetscScalar*[]);
294ca44d042SBarry Smith EXTERN int MatGetColumnVector(Mat,Vec,int);
2954e7234bfSBarry Smith EXTERN int MatGetArray(Mat,PetscScalar *[]);
2964e7234bfSBarry Smith EXTERN int MatRestoreArray(Mat,PetscScalar *[]);
297ca44d042SBarry Smith EXTERN int MatGetBlockSize(Mat,int *);
2987b80b807SBarry Smith 
299ca44d042SBarry Smith EXTERN int MatMult(Mat,Vec,Vec);
300ca44d042SBarry Smith EXTERN int MatMultAdd(Mat,Vec,Vec,Vec);
301ca44d042SBarry Smith EXTERN int MatMultTranspose(Mat,Vec,Vec);
3025fbd3699SBarry Smith EXTERN int MatIsTranspose(Mat,Mat,PetscTruth*);
303ca44d042SBarry Smith EXTERN int MatMultTransposeAdd(Mat,Vec,Vec,Vec);
304c06d978dSMatthew Knepley EXTERN int MatMultConstrained(Mat,Vec,Vec);
3056d0dc95fSMatthew Knepley EXTERN int MatMultTransposeConstrained(Mat,Vec,Vec);
3062eac72dbSBarry Smith 
307d91e6319SBarry Smith /*E
308d91e6319SBarry Smith     MatDuplicateOption - Indicates if a duplicated sparse matrix should have
309d91e6319SBarry Smith   its numerical values copied over or just its nonzero structure.
310d91e6319SBarry Smith 
311d91e6319SBarry Smith     Level: beginner
312d91e6319SBarry Smith 
313d91e6319SBarry Smith    Any additions/changes here MUST also be made in include/finclude/petscmat.h
314d91e6319SBarry Smith 
315d91e6319SBarry Smith .seealso: MatDuplicate()
316d91e6319SBarry Smith E*/
3172e8a6d31SBarry Smith typedef enum {MAT_DO_NOT_COPY_VALUES,MAT_COPY_VALUES} MatDuplicateOption;
3182e8a6d31SBarry Smith 
319273d9f13SBarry Smith EXTERN int MatConvertRegister(char*,char*,char*,int (*)(Mat,MatType,Mat*));
320273d9f13SBarry Smith #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
321273d9f13SBarry Smith #define MatConvertRegisterDynamic(a,b,c,d) MatConvertRegister(a,b,c,0)
322273d9f13SBarry Smith #else
323273d9f13SBarry Smith #define MatConvertRegisterDynamic(a,b,c,d) MatConvertRegister(a,b,c,d)
324273d9f13SBarry Smith #endif
325273d9f13SBarry Smith EXTERN int        MatConvertRegisterAll(char*);
326273d9f13SBarry Smith EXTERN int        MatConvertRegisterDestroy(void);
327273d9f13SBarry Smith extern PetscTruth MatConvertRegisterAllCalled;
328b0a32e0cSBarry Smith extern PetscFList MatConvertList;
329ca44d042SBarry Smith EXTERN int        MatConvert(Mat,MatType,Mat*);
330ca44d042SBarry Smith EXTERN int        MatDuplicate(Mat,MatDuplicateOption,Mat*);
33194a9d846SBarry Smith 
332d91e6319SBarry Smith /*E
333d91e6319SBarry Smith     MatStructure - Indicates if the matrix has the same nonzero structure
334d91e6319SBarry Smith 
335d91e6319SBarry Smith     Level: beginner
336d91e6319SBarry Smith 
337d91e6319SBarry Smith    Any additions/changes here MUST also be made in include/finclude/petscmat.h
338d91e6319SBarry Smith 
339d91e6319SBarry Smith .seealso: MatCopy(), SLESSetOperators(), PCSetOperators()
340d91e6319SBarry Smith E*/
341c537a176SHong Zhang typedef enum {SAME_NONZERO_PATTERN,DIFFERENT_NONZERO_PATTERN,SAME_PRECONDITIONER,SUBSET_NONZERO_PATTERN} MatStructure;
342cb5b572fSBarry Smith 
343ca44d042SBarry Smith EXTERN int MatCopy(Mat,Mat,MatStructure);
344b0a32e0cSBarry Smith EXTERN int MatView(Mat,PetscViewer);
345273d9f13SBarry Smith 
346b0a32e0cSBarry Smith EXTERN int MatLoad(PetscViewer,MatType,Mat*);
34751dd7536SBarry Smith EXTERN int MatMerge(MPI_Comm,Mat,Mat*);
3487b80b807SBarry Smith 
3494e7234bfSBarry Smith EXTERN int MatGetRowIJ(Mat,int,PetscTruth,int*,int *[],int *[],PetscTruth *);
3504e7234bfSBarry Smith EXTERN int MatRestoreRowIJ(Mat,int,PetscTruth,int *,int *[],int *[],PetscTruth *);
3514e7234bfSBarry Smith EXTERN int MatGetColumnIJ(Mat,int,PetscTruth,int*,int *[],int *[],PetscTruth *);
3524e7234bfSBarry Smith EXTERN int MatRestoreColumnIJ(Mat,int,PetscTruth,int *,int *[],int *[],PetscTruth *);
353d4fbbf0eSBarry Smith 
354d91e6319SBarry Smith /*S
355d91e6319SBarry Smith      MatInfo - Context of matrix information, used with MatGetInfo()
356d91e6319SBarry Smith 
357d91e6319SBarry Smith    In Fortran this is simply a double precision array of dimension MAT_INFO_SIZE
358d91e6319SBarry Smith 
359d91e6319SBarry Smith    Level: intermediate
360d91e6319SBarry Smith 
361d91e6319SBarry Smith   Concepts: matrix^nonzero information
362d91e6319SBarry Smith 
363d9274352SBarry Smith .seealso:  MatGetInfo(), MatInfoType
364d91e6319SBarry Smith S*/
3654e220ebcSLois Curfman McInnes typedef struct {
366b0a32e0cSBarry Smith   PetscLogDouble rows_global,columns_global;         /* number of global rows and columns */
367b0a32e0cSBarry Smith   PetscLogDouble rows_local,columns_local;           /* number of local rows and columns */
368b0a32e0cSBarry Smith   PetscLogDouble block_size;                         /* block size */
369b0a32e0cSBarry Smith   PetscLogDouble nz_allocated,nz_used,nz_unneeded;   /* number of nonzeros */
370b0a32e0cSBarry Smith   PetscLogDouble memory;                             /* memory allocated */
371b0a32e0cSBarry Smith   PetscLogDouble assemblies;                         /* number of matrix assemblies called */
372b0a32e0cSBarry Smith   PetscLogDouble mallocs;                            /* number of mallocs during MatSetValues() */
373b0a32e0cSBarry Smith   PetscLogDouble fill_ratio_given,fill_ratio_needed; /* fill ratio for LU/ILU */
374b0a32e0cSBarry Smith   PetscLogDouble factor_mallocs;                     /* number of mallocs during factorization */
3754e220ebcSLois Curfman McInnes } MatInfo;
3764e220ebcSLois Curfman McInnes 
377d9274352SBarry Smith /*E
378d9274352SBarry Smith     MatInfoType - Indicates if you want information about the local part of the matrix,
379d9274352SBarry Smith      the entire parallel matrix or the maximum over all the local parts.
380d9274352SBarry Smith 
381d9274352SBarry Smith     Level: beginner
382d9274352SBarry Smith 
383d9274352SBarry Smith    Any additions/changes here MUST also be made in include/finclude/petscmat.h
384d9274352SBarry Smith 
385d9274352SBarry Smith .seealso: MatGetInfo(), MatInfo
386d9274352SBarry Smith E*/
3877b80b807SBarry Smith typedef enum {MAT_LOCAL=1,MAT_GLOBAL_MAX=2,MAT_GLOBAL_SUM=3} MatInfoType;
388ca44d042SBarry Smith EXTERN int MatGetInfo(Mat,MatInfoType,MatInfo*);
389ca44d042SBarry Smith EXTERN int MatValid(Mat,PetscTruth*);
390ca44d042SBarry Smith EXTERN int MatGetDiagonal(Mat,Vec);
391273d9f13SBarry Smith EXTERN int MatGetRowMax(Mat,Vec);
392ca44d042SBarry Smith EXTERN int MatTranspose(Mat,Mat*);
393ca44d042SBarry Smith EXTERN int MatPermute(Mat,IS,IS,Mat *);
394bf1d55d4SSatish Balay EXTERN int MatPermuteSparsify(Mat,int,PetscReal,PetscReal,IS,IS,Mat *);
395ca44d042SBarry Smith EXTERN int MatDiagonalScale(Mat,Vec,Vec);
39606ef90c2SBarry Smith EXTERN int MatDiagonalSet(Mat,Vec,InsertMode);
397ca44d042SBarry Smith EXTERN int MatEqual(Mat,Mat,PetscTruth*);
3987b80b807SBarry Smith 
39987828ca2SBarry Smith EXTERN int MatNorm(Mat,NormType,PetscReal *);
400ca44d042SBarry Smith EXTERN int MatZeroEntries(Mat);
401268466fbSBarry Smith EXTERN int MatZeroRows(Mat,IS,const PetscScalar*);
402268466fbSBarry Smith EXTERN int MatZeroColumns(Mat,IS,const PetscScalar*);
4037b80b807SBarry Smith 
404ca44d042SBarry Smith EXTERN int MatUseScaledForm(Mat,PetscTruth);
405ca44d042SBarry Smith EXTERN int MatScaleSystem(Mat,Vec,Vec);
406ca44d042SBarry Smith EXTERN int MatUnScaleSystem(Mat,Vec,Vec);
4075ef9f2a5SBarry Smith 
408ca44d042SBarry Smith EXTERN int MatGetSize(Mat,int*,int*);
409ca44d042SBarry Smith EXTERN int MatGetLocalSize(Mat,int*,int*);
410ca44d042SBarry Smith EXTERN int MatGetOwnershipRange(Mat,int*,int*);
4117b80b807SBarry Smith 
412d91e6319SBarry Smith /*E
413d91e6319SBarry Smith     MatReuse - Indicates if matrices obtained from a previous call to MatGetSubMatrices()
414d91e6319SBarry Smith      or MatGetSubMatrix() are to be reused to store the new matrix values.
415d91e6319SBarry Smith 
416d91e6319SBarry Smith     Level: beginner
417d91e6319SBarry Smith 
418d91e6319SBarry Smith    Any additions/changes here MUST also be made in include/finclude/petscmat.h
419d91e6319SBarry Smith 
420d91e6319SBarry Smith .seealso: MatGetSubMatrices(), MatGetSubMatrix(), MatDestroyMatrices()
421d91e6319SBarry Smith E*/
4227b2a1423SBarry Smith typedef enum {MAT_INITIAL_MATRIX,MAT_REUSE_MATRIX} MatReuse;
423268466fbSBarry Smith EXTERN int MatGetSubMatrices(Mat,int,const IS[],const IS[],MatReuse,Mat *[]);
424268466fbSBarry Smith EXTERN int MatDestroyMatrices(int,Mat *[]);
425ca44d042SBarry Smith EXTERN int MatGetSubMatrix(Mat,IS,IS,int,MatReuse,Mat *);
4268efafbd8SBarry Smith 
427268466fbSBarry Smith EXTERN int MatIncreaseOverlap(Mat,int,IS[],int);
4287b80b807SBarry Smith 
429268466fbSBarry Smith EXTERN int MatAXPY(const PetscScalar *,Mat,Mat,MatStructure);
430268466fbSBarry Smith EXTERN int MatAYPX(const PetscScalar *,Mat,Mat);
431ca44d042SBarry Smith EXTERN int MatCompress(Mat);
4327b80b807SBarry Smith 
433268466fbSBarry Smith EXTERN int MatScale(const PetscScalar *,Mat);
434268466fbSBarry Smith EXTERN int MatShift(const PetscScalar *,Mat);
435052efed2SBarry Smith 
436ca44d042SBarry Smith EXTERN int MatSetLocalToGlobalMapping(Mat,ISLocalToGlobalMapping);
437ca44d042SBarry Smith EXTERN int MatSetLocalToGlobalMappingBlock(Mat,ISLocalToGlobalMapping);
438268466fbSBarry Smith EXTERN int MatZeroRowsLocal(Mat,IS,const PetscScalar*);
439f15d580aSBarry Smith EXTERN int MatSetValuesLocal(Mat,int,const int[],int,const int[],const PetscScalar[],InsertMode);
440f15d580aSBarry Smith EXTERN int MatSetValuesBlockedLocal(Mat,int,const int[],int,const int[],const PetscScalar[],InsertMode);
44190f02eecSBarry Smith 
442ca44d042SBarry Smith EXTERN int MatSetStashInitialSize(Mat,int,int);
443649db694SBarry Smith 
444ca44d042SBarry Smith EXTERN int MatInterpolateAdd(Mat,Vec,Vec,Vec);
445ca44d042SBarry Smith EXTERN int MatInterpolate(Mat,Vec,Vec);
446ca44d042SBarry Smith EXTERN int MatRestrict(Mat,Vec,Vec);
4477c922b88SBarry Smith 
448bd481603SBarry Smith 
449bd481603SBarry Smith /*MC
450bd481603SBarry Smith    MatPreallocInitialize - Begins the block of code that will count the number of nonzeros per
451bd481603SBarry Smith        row in a matrix providing the data that one can use to correctly preallocate the matrix.
452bd481603SBarry Smith 
453bd481603SBarry Smith    Synopsis:
454bd481603SBarry Smith    int MatPreallocateInitialize(MPI_Comm comm, int nrows, int ncols, int *dnz, int *onz)
455bd481603SBarry Smith 
456bd481603SBarry Smith    Collective on MPI_Comm
457bd481603SBarry Smith 
458bd481603SBarry Smith    Input Parameters:
459bd481603SBarry Smith +  comm - the communicator that will share the eventually allocated matrix
460bd481603SBarry Smith .  nrows - the number of rows in the matrix
461bd481603SBarry Smith -  ncols - the number of columns in the matrix
462bd481603SBarry Smith 
463bd481603SBarry Smith    Output Parameters:
464bd481603SBarry Smith +  dnz - the array that will be passed to the matrix preallocation routines
465bd481603SBarry Smith -  ozn - the other array passed to the matrix preallocation routines
466bd481603SBarry Smith 
467bd481603SBarry Smith 
468bd481603SBarry Smith    Level: intermediate
469bd481603SBarry Smith 
470bd481603SBarry Smith    Notes:
471bd481603SBarry Smith    See the chapter in the users manual on performance for more details
472bd481603SBarry Smith 
473bd481603SBarry Smith    Do not malloc or free dnz and onz that is handled internally by these routines
474bd481603SBarry Smith 
475bd481603SBarry Smith    Use MatPreallocateInitializeSymmetric() for symmetric matrices (MPISBAIJ matrices)
476bd481603SBarry Smith 
477bd481603SBarry Smith   Concepts: preallocation^Matrix
478bd481603SBarry Smith 
479bd481603SBarry Smith .seealso: MatPreallocateFinalize(), MatPreallocateSet(), MatPreallocateSymmetricSet(), MatPreallocateSetLocal(),
480bd481603SBarry Smith           MatPreallocateInitializeSymmetric(), MatPreallocateSymmetricSetLocal()
481bd481603SBarry Smith M*/
482c4f061fbSSatish Balay #define MatPreallocateInitialize(comm,nrows,ncols,dnz,onz) 0; \
4837c922b88SBarry Smith { \
484ef66eb69SBarry Smith   int _4_ierr,__tmp = (nrows),__ctmp = (ncols),__rstart,__start,__end; \
485ef66eb69SBarry Smith   _4_ierr = PetscMalloc(2*__tmp*sizeof(int),&dnz);CHKERRQ(_4_ierr);onz = dnz + __tmp;\
486ef66eb69SBarry Smith   _4_ierr = PetscMemzero(dnz,2*__tmp*sizeof(int));CHKERRQ(_4_ierr);\
487ef66eb69SBarry Smith   _4_ierr = MPI_Scan(&__ctmp,&__end,1,MPI_INT,MPI_SUM,comm);CHKERRQ(_4_ierr); __start = __end - __ctmp;\
488ef66eb69SBarry Smith   _4_ierr = MPI_Scan(&__tmp,&__rstart,1,MPI_INT,MPI_SUM,comm);CHKERRQ(_4_ierr); __rstart = __rstart - __tmp;
4897c922b88SBarry Smith 
490bd481603SBarry Smith /*MC
491bd481603SBarry Smith    MatPreallocSymmetricInitialize - Begins the block of code that will count the number of nonzeros per
492bd481603SBarry Smith        row in a matrix providing the data that one can use to correctly preallocate the matrix.
493bd481603SBarry Smith 
494bd481603SBarry Smith    Synopsis:
495bd481603SBarry Smith    int MatPreallocateSymmetricInitialize(MPI_Comm comm, int nrows, int ncols, int *dnz, int *onz)
496bd481603SBarry Smith 
497bd481603SBarry Smith    Collective on MPI_Comm
498bd481603SBarry Smith 
499bd481603SBarry Smith    Input Parameters:
500bd481603SBarry Smith +  comm - the communicator that will share the eventually allocated matrix
501bd481603SBarry Smith .  nrows - the number of rows in the matrix
502bd481603SBarry Smith -  ncols - the number of columns in the matrix
503bd481603SBarry Smith 
504bd481603SBarry Smith    Output Parameters:
505bd481603SBarry Smith +  dnz - the array that will be passed to the matrix preallocation routines
506bd481603SBarry Smith -  ozn - the other array passed to the matrix preallocation routines
507bd481603SBarry Smith 
508bd481603SBarry Smith 
509bd481603SBarry Smith    Level: intermediate
510bd481603SBarry Smith 
511bd481603SBarry Smith    Notes:
512bd481603SBarry Smith    See the chapter in the users manual on performance for more details
513bd481603SBarry Smith 
514bd481603SBarry Smith    Do not malloc or free dnz and onz that is handled internally by these routines
515bd481603SBarry Smith 
516bd481603SBarry Smith   Concepts: preallocation^Matrix
517bd481603SBarry Smith 
518bd481603SBarry Smith .seealso: MatPreallocateFinalize(), MatPreallocateSet(), MatPreallocateSymmetricSet(), MatPreallocateSetLocal(),
519bd481603SBarry Smith           MatPreallocateInitialize(), MatPreallocateSymmetricSetLocal()
520bd481603SBarry Smith M*/
521222b16d4SBarry Smith #define MatPreallocateSymmetricInitialize(comm,nrows,ncols,dnz,onz) 0; \
522222b16d4SBarry Smith { \
523222b16d4SBarry Smith   int _4_ierr,__tmp = (nrows),__ctmp = (ncols),__rstart,__end; \
524222b16d4SBarry Smith   _4_ierr = PetscMalloc(2*__tmp*sizeof(int),&dnz);CHKERRQ(_4_ierr);onz = dnz + __tmp;\
525222b16d4SBarry Smith   _4_ierr = PetscMemzero(dnz,2*__tmp*sizeof(int));CHKERRQ(_4_ierr);\
526222b16d4SBarry Smith   _4_ierr = MPI_Scan(&__ctmp,&__end,1,MPI_INT,MPI_SUM,comm);CHKERRQ(_4_ierr);\
527222b16d4SBarry Smith   _4_ierr = MPI_Scan(&__tmp,&__rstart,1,MPI_INT,MPI_SUM,comm);CHKERRQ(_4_ierr); __rstart = __rstart - __tmp;
528222b16d4SBarry Smith 
529bd481603SBarry Smith /*MC
530bd481603SBarry Smith    MatPreallocateSetLocal - Indicates the locations (rows and columns) in the matrix where nonzeros will be
531bd481603SBarry Smith        inserted using a local number of the rows and columns
532bd481603SBarry Smith 
533bd481603SBarry Smith    Synopsis:
534bd481603SBarry Smith    int MatPreallocateSetLocal(ISLocalToGlobalMappping map,int nrows, int *rows,int ncols, int *cols,int *dnz, int *onz)
535bd481603SBarry Smith 
536bd481603SBarry Smith    Not Collective
537bd481603SBarry Smith 
538bd481603SBarry Smith    Input Parameters:
539bd481603SBarry Smith +  map - the mapping between local numbering and global numbering
540bd481603SBarry Smith .  nrows - the number of rows indicated
541bd481603SBarry Smith .  rows - the indices of the rows (these will be mapped in the
542bd481603SBarry Smith .  ncols - the number of columns in the matrix
543bd481603SBarry Smith .  cols - the columns indicated
544bd481603SBarry Smith .  dnz - the array that will be passed to the matrix preallocation routines
545bd481603SBarry Smith -  ozn - the other array passed to the matrix preallocation routines
546bd481603SBarry Smith 
547bd481603SBarry Smith 
548bd481603SBarry Smith    Level: intermediate
549bd481603SBarry Smith 
550bd481603SBarry Smith    Notes:
551bd481603SBarry Smith    See the chapter in the users manual on performance for more details
552bd481603SBarry Smith 
553bd481603SBarry Smith    Do not malloc or free dnz and onz that is handled internally by these routines
554bd481603SBarry Smith 
555bd481603SBarry Smith   Concepts: preallocation^Matrix
556bd481603SBarry Smith 
557bd481603SBarry Smith .seealso: MatPreallocateFinalize(), MatPreallocateSet(), MatPreallocateSymmetricSet(), MatPreallocateInitialize(),
558bd481603SBarry Smith           MatPreallocateInitialize(), MatPreallocateSymmetricSetLocal()
559bd481603SBarry Smith M*/
560c4f061fbSSatish Balay #define MatPreallocateSetLocal(map,nrows,rows,ncols,cols,dnz,onz) 0;\
561c4f061fbSSatish Balay {\
562c4f061fbSSatish Balay   int __l;\
563ef66eb69SBarry Smith   _4_ierr = ISLocalToGlobalMappingApply(map,nrows,rows,rows);CHKERRQ(_4_ierr);\
564ef66eb69SBarry Smith   _4_ierr = ISLocalToGlobalMappingApply(map,ncols,cols,cols);CHKERRQ(_4_ierr);\
565c4f061fbSSatish Balay   for (__l=0;__l<nrows;__l++) {\
566ef66eb69SBarry Smith     _4_ierr = MatPreallocateSet((rows)[__l],ncols,cols,dnz,onz);CHKERRQ(_4_ierr);\
567c4f061fbSSatish Balay   }\
568c4f061fbSSatish Balay }
569c4f061fbSSatish Balay 
570bd481603SBarry Smith /*MC
571bd481603SBarry Smith    MatPreallocateSymmetricSetLocal - Indicates the locations (rows and columns) in the matrix where nonzeros will be
572bd481603SBarry Smith        inserted using a local number of the rows and columns
573bd481603SBarry Smith 
574bd481603SBarry Smith    Synopsis:
575bd481603SBarry Smith    int MatPreallocateSymmetricSetLocal(ISLocalToGlobalMappping map,int nrows, int *rows,int ncols, int *cols,int *dnz, int *onz)
576bd481603SBarry Smith 
577bd481603SBarry Smith    Not Collective
578bd481603SBarry Smith 
579bd481603SBarry Smith    Input Parameters:
580bd481603SBarry Smith +  map - the mapping between local numbering and global numbering
581bd481603SBarry Smith .  nrows - the number of rows indicated
582bd481603SBarry Smith .  rows - the indices of the rows (these will be mapped in the
583bd481603SBarry Smith .  ncols - the number of columns in the matrix
584bd481603SBarry Smith .  cols - the columns indicated
585bd481603SBarry Smith .  dnz - the array that will be passed to the matrix preallocation routines
586bd481603SBarry Smith -  ozn - the other array passed to the matrix preallocation routines
587bd481603SBarry Smith 
588bd481603SBarry Smith 
589bd481603SBarry Smith    Level: intermediate
590bd481603SBarry Smith 
591bd481603SBarry Smith    Notes:
592bd481603SBarry Smith    See the chapter in the users manual on performance for more details
593bd481603SBarry Smith 
594bd481603SBarry Smith    Do not malloc or free dnz and onz that is handled internally by these routines
595bd481603SBarry Smith 
596bd481603SBarry Smith   Concepts: preallocation^Matrix
597bd481603SBarry Smith 
598bd481603SBarry Smith .seealso: MatPreallocateFinalize(), MatPreallocateSet(), MatPreallocateSymmetricSet(), MatPreallocateInitialize(),
599bd481603SBarry Smith           MatPreallocateInitialize(), MatPreallocateSymmetricSetLocal(), MatPreallocateSetLocal()
600bd481603SBarry Smith M*/
601d3d32019SBarry Smith #define MatPreallocateSymmetricSetLocal(map,nrows,rows,ncols,cols,dnz,onz) 0;\
602d3d32019SBarry Smith {\
603d3d32019SBarry Smith   int __l;\
604d3d32019SBarry Smith   _4_ierr = ISLocalToGlobalMappingApply(map,nrows,rows,rows);CHKERRQ(_4_ierr);\
605d3d32019SBarry Smith   _4_ierr = ISLocalToGlobalMappingApply(map,ncols,cols,cols);CHKERRQ(_4_ierr);\
606d3d32019SBarry Smith   for (__l=0;__l<nrows;__l++) {\
607d3d32019SBarry Smith     _4_ierr = MatPreallocateSymmetricSet((rows)[__l],ncols,cols,dnz,onz);CHKERRQ(_4_ierr);\
608d3d32019SBarry Smith   }\
609d3d32019SBarry Smith }
610d3d32019SBarry Smith 
611bd481603SBarry Smith /*MC
612bd481603SBarry Smith    MatPreallocateSet - Indicates the locations (rows and columns) in the matrix where nonzeros will be
613bd481603SBarry Smith        inserted using a local number of the rows and columns
614bd481603SBarry Smith 
615bd481603SBarry Smith    Synopsis:
616bd481603SBarry Smith    int MatPreallocateSet(int nrows, int *rows,int ncols, int *cols,int *dnz, int *onz)
617bd481603SBarry Smith 
618bd481603SBarry Smith    Not Collective
619bd481603SBarry Smith 
620bd481603SBarry Smith    Input Parameters:
621bd481603SBarry Smith +  nrows - the number of rows indicated
622bd481603SBarry Smith .  rows - the indices of the rows (these will be mapped in the
623bd481603SBarry Smith .  ncols - the number of columns in the matrix
624bd481603SBarry Smith .  cols - the columns indicated
625bd481603SBarry Smith .  dnz - the array that will be passed to the matrix preallocation routines
626bd481603SBarry Smith -  ozn - the other array passed to the matrix preallocation routines
627bd481603SBarry Smith 
628bd481603SBarry Smith 
629bd481603SBarry Smith    Level: intermediate
630bd481603SBarry Smith 
631bd481603SBarry Smith    Notes:
632bd481603SBarry Smith    See the chapter in the users manual on performance for more details
633bd481603SBarry Smith 
634bd481603SBarry Smith    Do not malloc or free dnz and onz that is handled internally by these routines
635bd481603SBarry Smith 
636bd481603SBarry Smith   Concepts: preallocation^Matrix
637bd481603SBarry Smith 
638bd481603SBarry Smith .seealso: MatPreallocateFinalize(), MatPreallocateSet(), MatPreallocateSymmetricSet(), MatPreallocateInitialize(),
639bd481603SBarry Smith           MatPreallocateInitialize(), MatPreallocateSymmetricSetLocal(), MatPreallocateSetLocal()
640bd481603SBarry Smith M*/
641c4f061fbSSatish Balay #define MatPreallocateSet(row,nc,cols,dnz,onz) 0;\
6427c922b88SBarry Smith { int __i; \
6437c922b88SBarry Smith   for (__i=0; __i<nc; __i++) {\
6447c922b88SBarry Smith     if (cols[__i] < __start || cols[__i] >= __end) onz[row - __rstart]++; \
6457c922b88SBarry Smith   }\
6467c922b88SBarry Smith   dnz[row - __rstart] = nc - onz[row - __rstart];\
6477c922b88SBarry Smith }
6487c922b88SBarry Smith 
649bd481603SBarry Smith /*MC
650bd481603SBarry Smith    MatPreallocateSymmetricSet - Indicates the locations (rows and columns) in the matrix where nonzeros will be
651bd481603SBarry Smith        inserted using a local number of the rows and columns
652bd481603SBarry Smith 
653bd481603SBarry Smith    Synopsis:
654bd481603SBarry Smith    int MatPreallocateSymmetricSet(int nrows, int *rows,int ncols, int *cols,int *dnz, int *onz)
655bd481603SBarry Smith 
656bd481603SBarry Smith    Not Collective
657bd481603SBarry Smith 
658bd481603SBarry Smith    Input Parameters:
659bd481603SBarry Smith +  nrows - the number of rows indicated
660bd481603SBarry Smith .  rows - the indices of the rows (these will be mapped in the
661bd481603SBarry Smith .  ncols - the number of columns in the matrix
662bd481603SBarry Smith .  cols - the columns indicated
663bd481603SBarry Smith .  dnz - the array that will be passed to the matrix preallocation routines
664bd481603SBarry Smith -  ozn - the other array passed to the matrix preallocation routines
665bd481603SBarry Smith 
666bd481603SBarry Smith 
667bd481603SBarry Smith    Level: intermediate
668bd481603SBarry Smith 
669bd481603SBarry Smith    Notes:
670bd481603SBarry Smith    See the chapter in the users manual on performance for more details
671bd481603SBarry Smith 
672bd481603SBarry Smith    Do not malloc or free dnz and onz that is handled internally by these routines
673bd481603SBarry Smith 
674bd481603SBarry Smith   Concepts: preallocation^Matrix
675bd481603SBarry Smith 
676bd481603SBarry Smith .seealso: MatPreallocateFinalize(), MatPreallocateSet(), MatPreallocateSymmetricSet(), MatPreallocateInitialize(),
677bd481603SBarry Smith           MatPreallocateInitialize(), MatPreallocateSymmetricSetLocal(), MatPreallocateSetLocal()
678bd481603SBarry Smith M*/
679d3d32019SBarry Smith #define MatPreallocateSymmetricSet(row,nc,cols,dnz,onz) 0;\
680d3d32019SBarry Smith { int __i; \
681d3d32019SBarry Smith   for (__i=0; __i<nc; __i++) {\
682d3d32019SBarry Smith     if (cols[__i] >= __end) onz[row - __rstart]++; \
683d3d32019SBarry Smith     else if (cols[__i] >= row) dnz[row - __rstart]++;\
684d3d32019SBarry Smith   }\
685d3d32019SBarry Smith }
686d3d32019SBarry Smith 
687bd481603SBarry Smith /*MC
688bd481603SBarry Smith    MatPreallocFinalize - Ends the block of code that will count the number of nonzeros per
689bd481603SBarry Smith        row in a matrix providing the data that one can use to correctly preallocate the matrix.
690bd481603SBarry Smith 
691bd481603SBarry Smith    Synopsis:
692bd481603SBarry Smith    int MatPreallocateFinalize(int *dnz, int *onz)
693bd481603SBarry Smith 
694bd481603SBarry Smith    Collective on MPI_Comm
695bd481603SBarry Smith 
696bd481603SBarry Smith    Input Parameters:
697bd481603SBarry Smith +  dnz - the array that will be passed to the matrix preallocation routines
698bd481603SBarry Smith -  ozn - the other array passed to the matrix preallocation routines
699bd481603SBarry Smith 
700bd481603SBarry Smith 
701bd481603SBarry Smith    Level: intermediate
702bd481603SBarry Smith 
703bd481603SBarry Smith    Notes:
704bd481603SBarry Smith    See the chapter in the users manual on performance for more details
705bd481603SBarry Smith 
706bd481603SBarry Smith    Do not malloc or free dnz and onz that is handled internally by these routines
707bd481603SBarry Smith 
708bd481603SBarry Smith   Concepts: preallocation^Matrix
709bd481603SBarry Smith 
710bd481603SBarry Smith .seealso: MatPreallocateInitialize(), MatPreallocateSet(), MatPreallocateSymmetricSet(), MatPreallocateSetLocal(),
711bd481603SBarry Smith           MatPreallocateSymmetricInitialize(), MatPreallocateSymmetricSetLocal()
712bd481603SBarry Smith M*/
713ef66eb69SBarry Smith #define MatPreallocateFinalize(dnz,onz) 0;_4_ierr = PetscFree(dnz);CHKERRQ(_4_ierr);}
7147c922b88SBarry Smith 
715bd481603SBarry Smith 
716bd481603SBarry Smith 
7177b80b807SBarry Smith /* Routines unique to particular data structures */
718435da068SBarry Smith EXTERN int MatShellGetContext(Mat,void **);
719435da068SBarry Smith 
720268466fbSBarry Smith EXTERN int MatBDiagGetData(Mat,int*,int*,int*[],int*[],PetscScalar***);
721ca01db9bSBarry Smith EXTERN int MatSeqAIJSetColumnIndices(Mat,int[]);
722ca01db9bSBarry Smith EXTERN int MatSeqBAIJSetColumnIndices(Mat,int[]);
723ca01db9bSBarry Smith EXTERN int MatCreateSeqAIJWithArrays(MPI_Comm,int,int,int[],int[],PetscScalar[],Mat*);
7247b80b807SBarry Smith 
725ca01db9bSBarry Smith EXTERN int MatSeqBAIJSetPreallocation(Mat,int,int,const int[]);
726ca01db9bSBarry Smith EXTERN int MatSeqSBAIJSetPreallocation(Mat,int,int,const int[]);
727ca01db9bSBarry Smith EXTERN int MatSeqAIJSetPreallocation(Mat,int,const int[]);
728ca01db9bSBarry Smith EXTERN int MatSeqDensePreallocation(Mat,PetscScalar[]);
729ca01db9bSBarry Smith EXTERN int MatSeqBDiagSetPreallocation(Mat,int,int,const int[],PetscScalar*[]);
730ca01db9bSBarry Smith EXTERN int MatSeqDenseSetPreallocation(Mat,PetscScalar[]);
731273d9f13SBarry Smith 
732ca01db9bSBarry Smith EXTERN int MatMPIBAIJSetPreallocation(Mat,int,int,const int[],int,const int[]);
733ca01db9bSBarry Smith EXTERN int MatMPISBAIJSetPreallocation(Mat,int,int,const int[],int,const int[]);
734ca01db9bSBarry Smith EXTERN int MatMPIAIJSetPreallocation(Mat,int,const int[],int,const int[]);
735ca01db9bSBarry Smith EXTERN int MatMPIDensePreallocation(Mat,PetscScalar[]);
736ca01db9bSBarry Smith EXTERN int MatMPIBDiagSetPreallocation(Mat,int,int,const int[],PetscScalar*[]);
737ca01db9bSBarry Smith EXTERN int MatMPIAdjSetPreallocation(Mat,int[],int[],int[]);
738ca01db9bSBarry Smith EXTERN int MatMPIDenseSetPreallocation(Mat,PetscScalar[]);
739ca01db9bSBarry Smith EXTERN int MatMPIRowbsSetPreallocation(Mat,int,const int[]);
740268466fbSBarry Smith EXTERN int MatMPIAIJGetSeqAIJ(Mat,Mat*,Mat*,int*[]);
741268466fbSBarry Smith EXTERN int MatMPIBAIJGetSeqBAIJ(Mat,Mat*,Mat*,int*[]);
7423a7fca6bSBarry Smith EXTERN int MatAdicSetLocalFunction(Mat,void (*)(void));
743273d9f13SBarry Smith 
7441b807ce4Svictorle EXTERN int MatSeqDenseSetLDA(Mat,int);
7451b807ce4Svictorle 
746ca44d042SBarry Smith EXTERN int MatStoreValues(Mat);
747ca44d042SBarry Smith EXTERN int MatRetrieveValues(Mat);
7482e8a6d31SBarry Smith 
7493a7fca6bSBarry Smith EXTERN int MatDAADSetCtx(Mat,void*);
7503a7fca6bSBarry Smith 
7517b80b807SBarry Smith /*
7527b80b807SBarry Smith   These routines are not usually accessed directly, rather solving is
7537b80b807SBarry Smith   done through the SLES, KSP and PC interfaces.
7547b80b807SBarry Smith */
7557b80b807SBarry Smith 
756d9274352SBarry Smith /*E
757d9274352SBarry Smith     MatOrderingType - String with the name of a PETSc matrix ordering or the creation function
758d9274352SBarry Smith        with an optional dynamic library name, for example
759d9274352SBarry Smith        http://www.mcs.anl.gov/petsc/lib.a:orderingcreate()
760d9274352SBarry Smith 
761d9274352SBarry Smith    Level: beginner
762d9274352SBarry Smith 
763d9274352SBarry Smith .seealso: MatGetOrdering()
764d9274352SBarry Smith E*/
765b12f92e5SBarry Smith typedef char* MatOrderingType;
766b12f92e5SBarry Smith #define MATORDERING_NATURAL   "natural"
767b12f92e5SBarry Smith #define MATORDERING_ND        "nd"
768b12f92e5SBarry Smith #define MATORDERING_1WD       "1wd"
769b12f92e5SBarry Smith #define MATORDERING_RCM       "rcm"
770b12f92e5SBarry Smith #define MATORDERING_QMD       "qmd"
771b12f92e5SBarry Smith #define MATORDERING_ROWLENGTH "rowlength"
77262152c8bSBarry Smith #define MATORDERING_DSC_ND    "dsc_nd"
77362152c8bSBarry Smith #define MATORDERING_DSC_MMD   "dsc_mmd"
77462152c8bSBarry Smith #define MATORDERING_DSC_MDF   "dsc_mdf"
775c06d978dSMatthew Knepley #define MATORDERING_CONSTRAINED "constrained"
776c06d978dSMatthew Knepley #define MATORDERING_IDENTITY  "identity"
777c06d978dSMatthew Knepley #define MATORDERING_REVERSE   "reverse"
778b12f92e5SBarry Smith 
779ca44d042SBarry Smith EXTERN int MatGetOrdering(Mat,MatOrderingType,IS*,IS*);
780ca44d042SBarry Smith EXTERN int MatOrderingRegister(char*,char*,char*,int(*)(Mat,MatOrderingType,IS*,IS*));
78130de9b25SBarry Smith 
78230de9b25SBarry Smith /*MC
78330de9b25SBarry Smith    MatOrderingRegisterDynamic - Adds a new sparse matrix ordering to the
78430de9b25SBarry Smith                                matrix package.
78530de9b25SBarry Smith 
78630de9b25SBarry Smith    Synopsis:
78730de9b25SBarry Smith    int MatOrderingRegisterDynamic(char *name_ordering,char *path,char *name_create,int (*routine_create)(MatOrdering))
78830de9b25SBarry Smith 
78930de9b25SBarry Smith    Not Collective
79030de9b25SBarry Smith 
79130de9b25SBarry Smith    Input Parameters:
79230de9b25SBarry Smith +  sname - name of ordering (for example MATORDERING_ND)
79330de9b25SBarry Smith .  path - location of library where creation routine is
79430de9b25SBarry Smith .  name - name of function that creates the ordering type,a string
79530de9b25SBarry Smith -  function - function pointer that creates the ordering
79630de9b25SBarry Smith 
79730de9b25SBarry Smith    Level: developer
79830de9b25SBarry Smith 
79930de9b25SBarry Smith    If dynamic libraries are used, then the fourth input argument (function)
80030de9b25SBarry Smith    is ignored.
80130de9b25SBarry Smith 
80230de9b25SBarry Smith    Sample usage:
80330de9b25SBarry Smith .vb
80430de9b25SBarry Smith    MatOrderingRegisterDynamic("my_order",/home/username/my_lib/lib/libO/solaris/mylib.a,
80530de9b25SBarry Smith                "MyOrder",MyOrder);
80630de9b25SBarry Smith .ve
80730de9b25SBarry Smith 
80830de9b25SBarry Smith    Then, your partitioner can be chosen with the procedural interface via
80930de9b25SBarry Smith $     MatOrderingSetType(part,"my_order)
81030de9b25SBarry Smith    or at runtime via the option
81130de9b25SBarry Smith $     -pc_ilu_mat_ordering_type my_order
81230de9b25SBarry Smith $     -pc_lu_mat_ordering_type my_order
81330de9b25SBarry Smith 
81430de9b25SBarry Smith    ${PETSC_ARCH} and ${BOPT} occuring in pathname will be replaced with appropriate values.
81530de9b25SBarry Smith 
81630de9b25SBarry Smith .keywords: matrix, ordering, register
81730de9b25SBarry Smith 
81830de9b25SBarry Smith .seealso: MatOrderingRegisterDestroy(), MatOrderingRegisterAll()
81930de9b25SBarry Smith M*/
820aa482453SBarry Smith #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
821f1af5d2fSBarry Smith #define MatOrderingRegisterDynamic(a,b,c,d) MatOrderingRegister(a,b,c,0)
822b12f92e5SBarry Smith #else
823f1af5d2fSBarry Smith #define MatOrderingRegisterDynamic(a,b,c,d) MatOrderingRegister(a,b,c,d)
824b12f92e5SBarry Smith #endif
82530de9b25SBarry Smith 
826ca44d042SBarry Smith EXTERN int        MatOrderingRegisterDestroy(void);
827ca44d042SBarry Smith EXTERN int        MatOrderingRegisterAll(char*);
8282bad1931SBarry Smith extern PetscTruth MatOrderingRegisterAllCalled;
829b0a32e0cSBarry Smith extern PetscFList MatOrderingList;
830d4fbbf0eSBarry Smith 
83187828ca2SBarry Smith EXTERN int MatReorderForNonzeroDiagonal(Mat,PetscReal,IS,IS);
832a2ce50c7SBarry Smith 
833d91e6319SBarry Smith /*S
83415e8a5b3SHong Zhang    MatFactorInfo - Data based into the matrix factorization routines
835b00f7748SHong Zhang 
83615e8a5b3SHong Zhang    In Fortran these are simply double precision arrays of size MAT_FACTORINFO_SIZE
837b00f7748SHong Zhang 
83815e8a5b3SHong Zhang    Notes: These are not usually directly used by users, instead use PC type of LU, ILU, CHOLESKY or ICC.
839b00f7748SHong Zhang 
840b00f7748SHong Zhang    Level: developer
841b00f7748SHong Zhang 
842b380c88cSHong Zhang .seealso: MatLUFactorSymbolic(), MatILUFactorSymbolic(), MatCholeskyFactorSymbolic(), MatICCFactorSymbolic(), MatICCFactor()
843b00f7748SHong Zhang 
844b00f7748SHong Zhang S*/
845b00f7748SHong Zhang typedef struct {
84615e8a5b3SHong Zhang   PetscReal     damping;        /* scaling of identity added to matrix to prevent zero pivots */
8472cea7109SBarry Smith   PetscReal     shift;          /* if true, shift until positive pivots */
8482cea7109SBarry Smith   PetscReal     shift_fraction; /* record shift fraction taken */
84915e8a5b3SHong Zhang   PetscReal     diagonal_fill;  /* force diagonal to fill in if initially not filled */
85015e8a5b3SHong Zhang   PetscReal     dt;             /* drop tolerance */
851b00f7748SHong Zhang   PetscReal     dtcol;          /* tolerance for pivoting */
85215e8a5b3SHong Zhang   PetscReal     dtcount;        /* maximum nonzeros to be allowed per row */
853f6275e2eSBarry Smith   PetscReal     fill;           /* expected fill; nonzeros in factored matrix/nonzeros in original matrix*/
854348344bbSBarry Smith   PetscReal     levels;         /* ICC/ILU(levels) */
855bcd9e38bSBarry Smith   PetscReal     pivotinblocks;  /* for BAIJ and SBAIJ matrices pivot in factorization on blocks, default 1.0
856bcd9e38bSBarry Smith                                    factorization may be faster if do not pivot */
85715e8a5b3SHong Zhang   PetscReal     zeropivot;      /* pivot is called zero if less than this */
85815e8a5b3SHong Zhang } MatFactorInfo;
859ffa6d0a5SLois Curfman McInnes 
86015e8a5b3SHong Zhang EXTERN int MatCholeskyFactor(Mat,IS,MatFactorInfo*);
86115e8a5b3SHong Zhang EXTERN int MatCholeskyFactorSymbolic(Mat,IS,MatFactorInfo*,Mat*);
86215e8a5b3SHong Zhang EXTERN int MatCholeskyFactorNumeric(Mat,Mat*);
863b380c88cSHong Zhang EXTERN int MatLUFactor(Mat,IS,IS,MatFactorInfo*);
864b380c88cSHong Zhang EXTERN int MatILUFactor(Mat,IS,IS,MatFactorInfo*);
865b380c88cSHong Zhang EXTERN int MatLUFactorSymbolic(Mat,IS,IS,MatFactorInfo*,Mat*);
866b380c88cSHong Zhang EXTERN int MatILUFactorSymbolic(Mat,IS,IS,MatFactorInfo*,Mat*);
86715e8a5b3SHong Zhang EXTERN int MatICCFactorSymbolic(Mat,IS,MatFactorInfo*,Mat*);
86815e8a5b3SHong Zhang EXTERN int MatICCFactor(Mat,IS,MatFactorInfo*);
869ca44d042SBarry Smith EXTERN int MatLUFactorNumeric(Mat,Mat*);
870b380c88cSHong Zhang EXTERN int MatILUDTFactor(Mat,MatFactorInfo*,IS,IS,Mat *);
8713e0d88b5SBarry Smith EXTERN int MatGetInertia(Mat,int*,int*,int*);
872ca44d042SBarry Smith EXTERN int MatSolve(Mat,Vec,Vec);
873ca44d042SBarry Smith EXTERN int MatForwardSolve(Mat,Vec,Vec);
874ca44d042SBarry Smith EXTERN int MatBackwardSolve(Mat,Vec,Vec);
875ca44d042SBarry Smith EXTERN int MatSolveAdd(Mat,Vec,Vec,Vec);
876ca44d042SBarry Smith EXTERN int MatSolveTranspose(Mat,Vec,Vec);
877ca44d042SBarry Smith EXTERN int MatSolveTransposeAdd(Mat,Vec,Vec,Vec);
878d59c15a7SBarry Smith EXTERN int MatSolves(Mat,Vecs,Vecs);
8798ed539a5SBarry Smith 
880ca44d042SBarry Smith EXTERN int MatSetUnfactored(Mat);
881bb5a7306SBarry Smith 
882d91e6319SBarry Smith /*E
883d91e6319SBarry Smith     MatSORType - What type of (S)SOR to perform
884bb1eb677SSatish Balay 
885d91e6319SBarry Smith     Level: beginner
886d91e6319SBarry Smith 
887d9274352SBarry Smith    May be bitwise ORd together
888d9274352SBarry Smith 
889d91e6319SBarry Smith    Any additions/changes here MUST also be made in include/finclude/petscmat.h
890d91e6319SBarry Smith 
8914e7234bfSBarry Smith    MatSORType may be bitwise ORd together, so do not change the numbers
8924e7234bfSBarry Smith 
893d91e6319SBarry Smith .seealso: MatRelax()
894d91e6319SBarry Smith E*/
895ee50ffe9SBarry Smith typedef enum {SOR_FORWARD_SWEEP=1,SOR_BACKWARD_SWEEP=2,SOR_SYMMETRIC_SWEEP=3,
896ee50ffe9SBarry Smith               SOR_LOCAL_FORWARD_SWEEP=4,SOR_LOCAL_BACKWARD_SWEEP=8,
897ee50ffe9SBarry Smith               SOR_LOCAL_SYMMETRIC_SWEEP=12,SOR_ZERO_INITIAL_GUESS=16,
89884cb2905SBarry Smith               SOR_EISENSTAT=32,SOR_APPLY_UPPER=64,SOR_APPLY_LOWER=128} MatSORType;
899c14dc6b6SHong Zhang EXTERN int MatRelax(Mat,Vec,PetscReal,MatSORType,PetscReal,int,int,Vec);
9008ed539a5SBarry Smith 
901d4fbbf0eSBarry Smith /*
902639f9d9dSBarry Smith     These routines are for efficiently computing Jacobians via finite differences.
903639f9d9dSBarry Smith */
904b12f92e5SBarry Smith 
905d9274352SBarry Smith /*E
906d9274352SBarry Smith     MatColoringType - String with the name of a PETSc matrix coloring or the creation function
907d9274352SBarry Smith        with an optional dynamic library name, for example
908d9274352SBarry Smith        http://www.mcs.anl.gov/petsc/lib.a:coloringcreate()
909d9274352SBarry Smith 
910d9274352SBarry Smith    Level: beginner
911d9274352SBarry Smith 
912d9274352SBarry Smith .seealso: MatGetColoring()
913d9274352SBarry Smith E*/
914b12f92e5SBarry Smith typedef char* MatColoringType;
915b12f92e5SBarry Smith #define MATCOLORING_NATURAL "natural"
916b12f92e5SBarry Smith #define MATCOLORING_SL      "sl"
917b12f92e5SBarry Smith #define MATCOLORING_LF      "lf"
918b12f92e5SBarry Smith #define MATCOLORING_ID      "id"
919b12f92e5SBarry Smith 
920ca44d042SBarry Smith EXTERN int MatGetColoring(Mat,MatColoringType,ISColoring*);
921ca44d042SBarry Smith EXTERN int MatColoringRegister(char*,char*,char*,int(*)(Mat,MatColoringType,ISColoring *));
92230de9b25SBarry Smith 
92330de9b25SBarry Smith /*MC
92430de9b25SBarry Smith    MatColoringRegisterDynamic - Adds a new sparse matrix coloring to the
92530de9b25SBarry Smith                                matrix package.
92630de9b25SBarry Smith 
92730de9b25SBarry Smith    Synopsis:
92830de9b25SBarry Smith    int MatColoringRegisterDynamic(char *name_coloring,char *path,char *name_create,int (*routine_create)(MatColoring))
92930de9b25SBarry Smith 
93030de9b25SBarry Smith    Not Collective
93130de9b25SBarry Smith 
93230de9b25SBarry Smith    Input Parameters:
93330de9b25SBarry Smith +  sname - name of Coloring (for example MATCOLORING_SL)
93430de9b25SBarry Smith .  path - location of library where creation routine is
93530de9b25SBarry Smith .  name - name of function that creates the Coloring type, a string
93630de9b25SBarry Smith -  function - function pointer that creates the coloring
93730de9b25SBarry Smith 
93830de9b25SBarry Smith    Level: developer
93930de9b25SBarry Smith 
94030de9b25SBarry Smith    If dynamic libraries are used, then the fourth input argument (function)
94130de9b25SBarry Smith    is ignored.
94230de9b25SBarry Smith 
94330de9b25SBarry Smith    Sample usage:
94430de9b25SBarry Smith .vb
94530de9b25SBarry Smith    MatColoringRegisterDynamic("my_color",/home/username/my_lib/lib/libO/solaris/mylib.a,
94630de9b25SBarry Smith                "MyColor",MyColor);
94730de9b25SBarry Smith .ve
94830de9b25SBarry Smith 
94930de9b25SBarry Smith    Then, your partitioner can be chosen with the procedural interface via
95030de9b25SBarry Smith $     MatColoringSetType(part,"my_color")
95130de9b25SBarry Smith    or at runtime via the option
95230de9b25SBarry Smith $     -mat_coloring_type my_color
95330de9b25SBarry Smith 
95430de9b25SBarry Smith    $PETSC_ARCH and $BOPT occuring in pathname will be replaced with appropriate values.
95530de9b25SBarry Smith 
95630de9b25SBarry Smith .keywords: matrix, Coloring, register
95730de9b25SBarry Smith 
95830de9b25SBarry Smith .seealso: MatColoringRegisterDestroy(), MatColoringRegisterAll()
95930de9b25SBarry Smith M*/
960aa482453SBarry Smith #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
961f1af5d2fSBarry Smith #define MatColoringRegisterDynamic(a,b,c,d) MatColoringRegister(a,b,c,0)
962b12f92e5SBarry Smith #else
963f1af5d2fSBarry Smith #define MatColoringRegisterDynamic(a,b,c,d) MatColoringRegister(a,b,c,d)
964b12f92e5SBarry Smith #endif
96530de9b25SBarry Smith 
966ca44d042SBarry Smith EXTERN int        MatColoringRegisterAll(char *);
9672bad1931SBarry Smith extern PetscTruth MatColoringRegisterAllCalled;
968ca44d042SBarry Smith EXTERN int        MatColoringRegisterDestroy(void);
9694e7234bfSBarry Smith EXTERN int        MatColoringPatch(Mat,int,int,const ISColoringValue[],ISColoring*);
970639f9d9dSBarry Smith 
971d9274352SBarry Smith /*S
972d9274352SBarry Smith      MatFDColoring - Object for computing a sparse Jacobian via finite differences
973d9274352SBarry Smith         and coloring
974639f9d9dSBarry Smith 
975d9274352SBarry Smith    Level: beginner
976d9274352SBarry Smith 
977d9274352SBarry Smith   Concepts: coloring, sparse Jacobian, finite differences
978d9274352SBarry Smith 
979d9274352SBarry Smith .seealso:  MatFDColoringCreate()
980d9274352SBarry Smith S*/
981e2a1c21fSSatish Balay typedef struct _p_MatFDColoring *MatFDColoring;
982639f9d9dSBarry Smith 
983ca44d042SBarry Smith EXTERN int MatFDColoringCreate(Mat,ISColoring,MatFDColoring *);
984ca44d042SBarry Smith EXTERN int MatFDColoringDestroy(MatFDColoring);
985b0a32e0cSBarry Smith EXTERN int MatFDColoringView(MatFDColoring,PetscViewer);
986ca44d042SBarry Smith EXTERN int MatFDColoringSetFunction(MatFDColoring,int (*)(void),void*);
98787828ca2SBarry Smith EXTERN int MatFDColoringSetParameters(MatFDColoring,PetscReal,PetscReal);
988ca44d042SBarry Smith EXTERN int MatFDColoringSetFrequency(MatFDColoring,int);
989ca44d042SBarry Smith EXTERN int MatFDColoringGetFrequency(MatFDColoring,int*);
990ca44d042SBarry Smith EXTERN int MatFDColoringSetFromOptions(MatFDColoring);
991ca44d042SBarry Smith EXTERN int MatFDColoringApply(Mat,MatFDColoring,Vec,MatStructure*,void *);
99287828ca2SBarry Smith EXTERN int MatFDColoringApplyTS(Mat,MatFDColoring,PetscReal,Vec,MatStructure*,void *);
99362152c8bSBarry Smith EXTERN int MatFDColoringSetRecompute(MatFDColoring);
9943a7fca6bSBarry Smith EXTERN int MatFDColoringSetF(MatFDColoring,Vec);
9954e7234bfSBarry Smith EXTERN int MatFDColoringGetPerturbedColumns(MatFDColoring,int*,int*[]);
996639f9d9dSBarry Smith /*
9970752156aSBarry Smith     These routines are for partitioning matrices: currently used only
9983eda8832SBarry Smith   for adjacency matrix, MatCreateMPIAdj().
9990752156aSBarry Smith */
1000ca161407SBarry Smith 
1001d9274352SBarry Smith /*S
1002d9274352SBarry Smith      MatPartitioning - Object for managing the partitioning of a matrix or graph
1003d9274352SBarry Smith 
1004d9274352SBarry Smith    Level: beginner
1005d9274352SBarry Smith 
1006d9274352SBarry Smith   Concepts: partitioning
1007d9274352SBarry Smith 
1008743a1026Svictorle .seealso:  MatPartitioningCreate(), MatPartitioningType
1009d9274352SBarry Smith S*/
101091e9ee9fSBarry Smith typedef struct _p_MatPartitioning *MatPartitioning;
1011d9274352SBarry Smith 
1012d9274352SBarry Smith /*E
10135bc6e7ccSvictorle     MatPartitioningType - String with the name of a PETSc matrix partitioning or the creation function
1014d9274352SBarry Smith        with an optional dynamic library name, for example
1015d9274352SBarry Smith        http://www.mcs.anl.gov/petsc/lib.a:partitioningcreate()
1016d9274352SBarry Smith 
1017d9274352SBarry Smith    Level: beginner
1018d9274352SBarry Smith 
1019b547a13bSvictorle .seealso: MatPartitioningCreate(), MatPartitioning
1020d9274352SBarry Smith E*/
10212aabb6bbSBarry Smith typedef char* MatPartitioningType;
10228ba1e511SMatthew Knepley #define MAT_PARTITIONING_CURRENT  "current"
10238ba1e511SMatthew Knepley #define MAT_PARTITIONING_PARMETIS "parmetis"
1024ca161407SBarry Smith 
1025ca44d042SBarry Smith EXTERN int MatPartitioningCreate(MPI_Comm,MatPartitioning*);
1026ca44d042SBarry Smith EXTERN int MatPartitioningSetType(MatPartitioning,MatPartitioningType);
10275bc6e7ccSvictorle EXTERN int MatPartitioningSetNParts(MatPartitioning,int);
1028ca44d042SBarry Smith EXTERN int MatPartitioningSetAdjacency(MatPartitioning,Mat);
10294e7234bfSBarry Smith EXTERN int MatPartitioningSetVertexWeights(MatPartitioning,const int[]);
10304e7234bfSBarry Smith EXTERN int MatPartitioningSetPartitionWeights(MatPartitioning,const PetscReal []);
1031ca44d042SBarry Smith EXTERN int MatPartitioningApply(MatPartitioning,IS*);
1032ca44d042SBarry Smith EXTERN int MatPartitioningDestroy(MatPartitioning);
10332aabb6bbSBarry Smith 
1034ca44d042SBarry Smith EXTERN int MatPartitioningRegister(char*,char*,char*,int(*)(MatPartitioning));
103530de9b25SBarry Smith 
103630de9b25SBarry Smith /*MC
103730de9b25SBarry Smith    MatPartitioningRegisterDynamic - Adds a new sparse matrix partitioning to the
103830de9b25SBarry Smith    matrix package.
103930de9b25SBarry Smith 
104030de9b25SBarry Smith    Synopsis:
104130de9b25SBarry Smith    int MatPartitioningRegisterDynamic(char *name_partitioning,char *path,char *name_create,int (*routine_create)(MatPartitioning))
104230de9b25SBarry Smith 
104330de9b25SBarry Smith    Not Collective
104430de9b25SBarry Smith 
104530de9b25SBarry Smith    Input Parameters:
104630de9b25SBarry Smith +  sname - name of partitioning (for example MAT_PARTITIONING_CURRENT) or parmetis
104730de9b25SBarry Smith .  path - location of library where creation routine is
104830de9b25SBarry Smith .  name - name of function that creates the partitioning type, a string
104930de9b25SBarry Smith -  function - function pointer that creates the partitioning type
105030de9b25SBarry Smith 
105130de9b25SBarry Smith    Level: developer
105230de9b25SBarry Smith 
105330de9b25SBarry Smith    If dynamic libraries are used, then the fourth input argument (function)
105430de9b25SBarry Smith    is ignored.
105530de9b25SBarry Smith 
105630de9b25SBarry Smith    Sample usage:
105730de9b25SBarry Smith .vb
105830de9b25SBarry Smith    MatPartitioningRegisterDynamic("my_part",/home/username/my_lib/lib/libO/solaris/mylib.a,
105930de9b25SBarry Smith                "MyPartCreate",MyPartCreate);
106030de9b25SBarry Smith .ve
106130de9b25SBarry Smith 
106230de9b25SBarry Smith    Then, your partitioner can be chosen with the procedural interface via
106330de9b25SBarry Smith $     MatPartitioningSetType(part,"my_part")
106430de9b25SBarry Smith    or at runtime via the option
106530de9b25SBarry Smith $     -mat_partitioning_type my_part
106630de9b25SBarry Smith 
106730de9b25SBarry Smith    $PETSC_ARCH and $BOPT occuring in pathname will be replaced with appropriate values.
106830de9b25SBarry Smith 
106930de9b25SBarry Smith .keywords: matrix, partitioning, register
107030de9b25SBarry Smith 
107130de9b25SBarry Smith .seealso: MatPartitioningRegisterDestroy(), MatPartitioningRegisterAll()
107230de9b25SBarry Smith M*/
1073aa482453SBarry Smith #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
1074f1af5d2fSBarry Smith #define MatPartitioningRegisterDynamic(a,b,c,d) MatPartitioningRegister(a,b,c,0)
10752aabb6bbSBarry Smith #else
1076f1af5d2fSBarry Smith #define MatPartitioningRegisterDynamic(a,b,c,d) MatPartitioningRegister(a,b,c,d)
10772aabb6bbSBarry Smith #endif
10782aabb6bbSBarry Smith 
1079ca44d042SBarry Smith EXTERN int        MatPartitioningRegisterAll(char *);
10802bad1931SBarry Smith extern PetscTruth MatPartitioningRegisterAllCalled;
1081ca44d042SBarry Smith EXTERN int        MatPartitioningRegisterDestroy(void);
10822bad1931SBarry Smith 
1083b0a32e0cSBarry Smith EXTERN int MatPartitioningView(MatPartitioning,PetscViewer);
1084ca44d042SBarry Smith EXTERN int MatPartitioningSetFromOptions(MatPartitioning);
1085ca44d042SBarry Smith EXTERN int MatPartitioningGetType(MatPartitioning,MatPartitioningType*);
1086ca161407SBarry Smith 
1087ca44d042SBarry Smith EXTERN int MatPartitioningParmetisSetCoarseSequential(MatPartitioning);
10880752156aSBarry Smith 
10890752156aSBarry Smith /*
10900a835dfdSSatish Balay     If you add entries here you must also add them to finclude/petscmat.h
1091d4fbbf0eSBarry Smith */
10921c1c02c0SLois Curfman McInnes typedef enum { MATOP_SET_VALUES=0,
10931c1c02c0SLois Curfman McInnes                MATOP_GET_ROW=1,
10941c1c02c0SLois Curfman McInnes                MATOP_RESTORE_ROW=2,
10951c1c02c0SLois Curfman McInnes                MATOP_MULT=3,
10961c1c02c0SLois Curfman McInnes                MATOP_MULT_ADD=4,
10977c922b88SBarry Smith                MATOP_MULT_TRANSPOSE=5,
10987c922b88SBarry Smith                MATOP_MULT_TRANSPOSE_ADD=6,
10991c1c02c0SLois Curfman McInnes                MATOP_SOLVE=7,
11001c1c02c0SLois Curfman McInnes                MATOP_SOLVE_ADD=8,
11017c922b88SBarry Smith                MATOP_SOLVE_TRANSPOSE=9,
11027c922b88SBarry Smith                MATOP_SOLVE_TRANSPOSE_ADD=10,
11031c1c02c0SLois Curfman McInnes                MATOP_LUFACTOR=11,
11041c1c02c0SLois Curfman McInnes                MATOP_CHOLESKYFACTOR=12,
11051c1c02c0SLois Curfman McInnes                MATOP_RELAX=13,
11061c1c02c0SLois Curfman McInnes                MATOP_TRANSPOSE=14,
11071c1c02c0SLois Curfman McInnes                MATOP_GETINFO=15,
11081c1c02c0SLois Curfman McInnes                MATOP_EQUAL=16,
11091c1c02c0SLois Curfman McInnes                MATOP_GET_DIAGONAL=17,
11101c1c02c0SLois Curfman McInnes                MATOP_DIAGONAL_SCALE=18,
11111c1c02c0SLois Curfman McInnes                MATOP_NORM=19,
11121c1c02c0SLois Curfman McInnes                MATOP_ASSEMBLY_BEGIN=20,
11131c1c02c0SLois Curfman McInnes                MATOP_ASSEMBLY_END=21,
11141c1c02c0SLois Curfman McInnes                MATOP_COMPRESS=22,
11151c1c02c0SLois Curfman McInnes                MATOP_SET_OPTION=23,
11161c1c02c0SLois Curfman McInnes                MATOP_ZERO_ENTRIES=24,
11171c1c02c0SLois Curfman McInnes                MATOP_ZERO_ROWS=25,
11181c1c02c0SLois Curfman McInnes                MATOP_LUFACTOR_SYMBOLIC=26,
11191c1c02c0SLois Curfman McInnes                MATOP_LUFACTOR_NUMERIC=27,
11201c1c02c0SLois Curfman McInnes                MATOP_CHOLESKY_FACTOR_SYMBOLIC=28,
11211c1c02c0SLois Curfman McInnes                MATOP_CHOLESKY_FACTOR_NUMERIC=29,
1122d643ce63SMatthew Knepley                MATOP_SETUP_PREALLOCATION=30,
1123d643ce63SMatthew Knepley                MATOP_ILUFACTOR_SYMBOLIC=31,
1124d643ce63SMatthew Knepley                MATOP_ICCFACTOR_SYMBOLIC=32,
1125d643ce63SMatthew Knepley                MATOP_GET_ARRAY=33,
1126d643ce63SMatthew Knepley                MATOP_RESTORE_ARRAY=34,
1127d643ce63SMatthew Knepley                MATOP_DUPLCIATE=35,
1128d643ce63SMatthew Knepley                MATOP_FORWARD_SOLVE=36,
1129d643ce63SMatthew Knepley                MATOP_BACKWARD_SOLVE=37,
1130d643ce63SMatthew Knepley                MATOP_ILUFACTOR=38,
1131d643ce63SMatthew Knepley                MATOP_ICCFACTOR=39,
1132d643ce63SMatthew Knepley                MATOP_AXPY=40,
1133d643ce63SMatthew Knepley                MATOP_GET_SUBMATRICES=41,
1134d643ce63SMatthew Knepley                MATOP_INCREASE_OVERLAP=42,
1135d643ce63SMatthew Knepley                MATOP_GET_VALUES=43,
1136d643ce63SMatthew Knepley                MATOP_COPY=44,
1137d643ce63SMatthew Knepley                MATOP_PRINT_HELP=45,
1138d643ce63SMatthew Knepley                MATOP_SCALE=46,
1139d643ce63SMatthew Knepley                MATOP_SHIFT=47,
1140d643ce63SMatthew Knepley                MATOP_DIAGONAL_SHIFT=48,
1141d643ce63SMatthew Knepley                MATOP_ILUDT_FACTOR=49,
1142d643ce63SMatthew Knepley                MATOP_GET_BLOCK_SIZE=50,
1143d643ce63SMatthew Knepley                MATOP_GET_ROW_IJ=51,
1144d643ce63SMatthew Knepley                MATOP_RESTORE_ROW_IJ=52,
1145d643ce63SMatthew Knepley                MATOP_GET_COLUMN_IJ=53,
1146d643ce63SMatthew Knepley                MATOP_RESTORE_COLUMN_IJ=54,
1147d643ce63SMatthew Knepley                MATOP_FDCOLORING_CREATE=55,
1148d643ce63SMatthew Knepley                MATOP_COLORING_PATCH=56,
1149d643ce63SMatthew Knepley                MATOP_SET_UNFACTORED=57,
1150d643ce63SMatthew Knepley                MATOP_PERMUTE=58,
1151d643ce63SMatthew Knepley                MATOP_SET_VALUES_BLOCKED=59,
1152d643ce63SMatthew Knepley                MATOP_GET_SUBMATRIX=60,
1153d643ce63SMatthew Knepley                MATOP_DESTROY=61,
1154d643ce63SMatthew Knepley                MATOP_VIEW=62,
1155d643ce63SMatthew Knepley                MATOP_GET_MAPS=63,
1156d643ce63SMatthew Knepley                MATOP_USE_SCALED_FORM=64,
1157d643ce63SMatthew Knepley                MATOP_SCALE_SYSTEM=65,
1158d643ce63SMatthew Knepley                MATOP_UNSCALE_SYSTEM=66,
1159d643ce63SMatthew Knepley                MATOP_SET_LOCAL_TO_GLOBAL_MAPPING=67,
1160d643ce63SMatthew Knepley                MATOP_SET_VALUES_LOCAL=68,
1161d643ce63SMatthew Knepley                MATOP_ZERO_ROWS_LOCAL=69,
1162d643ce63SMatthew Knepley                MATOP_GET_ROW_MAX=70,
1163d643ce63SMatthew Knepley                MATOP_CONVERT=71,
1164d643ce63SMatthew Knepley                MATOP_SET_COLORING=72,
1165d643ce63SMatthew Knepley                MATOP_SET_VALUES_ADIC=73,
1166d643ce63SMatthew Knepley                MATOP_SET_VALUES_ADIFOR=74,
1167d643ce63SMatthew Knepley                MATOP_FD_COLORING_APPLY=75,
1168d643ce63SMatthew Knepley                MATOP_SET_FROM_OPTIONS=76,
1169d643ce63SMatthew Knepley                MATOP_MULT_CONSTRAINED=77,
1170d643ce63SMatthew Knepley                MATOP_MULT_TRANSPOSE_CONSTRAINED=78,
1171d643ce63SMatthew Knepley                MATOP_ILU_FACTOR_SYMBOLIC_CONSTRAINED=79,
1172d643ce63SMatthew Knepley                MATOP_PERMUTE_SPARSIFY=80,
1173d643ce63SMatthew Knepley                MATOP_MULT_MULTIPLE=81,
1174d643ce63SMatthew Knepley                MATOP_SOLVE_MULTIPLE=82
1175fae171e0SBarry Smith              } MatOperation;
1176ca44d042SBarry Smith EXTERN int MatHasOperation(Mat,MatOperation,PetscTruth*);
1177ff8b7a98SSatish Balay EXTERN int MatShellSetOperation(Mat,MatOperation,void(*)(void));
1178ff8b7a98SSatish Balay EXTERN int MatShellGetOperation(Mat,MatOperation,void(**)(void));
1179273d9f13SBarry Smith EXTERN int MatShellSetContext(Mat,void*);
1180112a2221SBarry Smith 
118190ace30eSBarry Smith /*
118290ace30eSBarry Smith    Codes for matrices stored on disk. By default they are
118390ace30eSBarry Smith  stored in a universal format. By changing the format with
1184fb9695e5SSatish Balay  PetscViewerSetFormat(viewer,PETSC_VIEWER_BINARY_NATIVE); the matrices will
118590ace30eSBarry Smith  be stored in a way natural for the matrix, for example dense matrices
118690ace30eSBarry Smith  would be stored as dense. Matrices stored this way may only be
118790ace30eSBarry Smith  read into matrices of the same time.
118890ace30eSBarry Smith */
118990ace30eSBarry Smith #define MATRIX_BINARY_FORMAT_DENSE -1
119090ace30eSBarry Smith 
11916d053be9SSatish Balay EXTERN int MatMPIBAIJSetHashTableFactor(Mat,PetscReal);
1192ca44d042SBarry Smith EXTERN int MatSeqAIJGetInodeSizes(Mat,int *,int *[],int *);
119308918a0eSSatish Balay EXTERN int MatMPIRowbsGetColor(Mat,ISColoring *);
1194860d1616SSatish Balay 
1195d9274352SBarry Smith /*S
1196d9274352SBarry Smith      MatNullSpace - Object that removes a null space from a vector, i.e.
1197d9274352SBarry Smith          orthogonalizes the vector to a subsapce
1198d9274352SBarry Smith 
1199f7a9e4ceSBarry Smith    Level: advanced
1200d9274352SBarry Smith 
1201d9274352SBarry Smith   Concepts: matrix; linear operator, null space
1202d9274352SBarry Smith 
12036e1639daSBarry Smith   Users manual sections:
12046e1639daSBarry Smith .   sec_singular
12056e1639daSBarry Smith 
1206d9274352SBarry Smith .seealso:  MatNullSpaceCreate()
1207d9274352SBarry Smith S*/
120874637425SBarry Smith typedef struct _p_MatNullSpace* MatNullSpace;
1209d9274352SBarry Smith 
12104e7234bfSBarry Smith EXTERN int MatNullSpaceCreate(MPI_Comm,int,int,const Vec[],MatNullSpace*);
121174637425SBarry Smith EXTERN int MatNullSpaceDestroy(MatNullSpace);
121274637425SBarry Smith EXTERN int MatNullSpaceRemove(MatNullSpace,Vec,Vec*);
121374637425SBarry Smith EXTERN int MatNullSpaceAttach(Mat,MatNullSpace);
121474637425SBarry Smith EXTERN int MatNullSpaceTest(MatNullSpace,Mat);
121574637425SBarry Smith 
1216273d9f13SBarry Smith EXTERN int MatReorderingSeqSBAIJ(Mat A,IS isp);
1217273d9f13SBarry Smith EXTERN int MatMPISBAIJSetHashTableFactor(Mat,PetscReal);
1218273d9f13SBarry Smith EXTERN int MatSeqSBAIJSetColumnIndices(Mat,int *);
1219273d9f13SBarry Smith 
12205c66b693SKris Buschelman EXTERN int MatMatMult(Mat A,Mat B, Mat *C);
12215c66b693SKris Buschelman EXTERN int MatMatMultSymbolic(Mat A,Mat B,Mat *C);
12225c66b693SKris Buschelman EXTERN int MatMatMultNumeric(Mat A,Mat B,Mat C);
12233f1d51d7SBarry Smith 
1224f069c275SSatish Balay EXTERN int MatCreateMAIJ(Mat,int,Mat*);
1225c4f061fbSSatish Balay EXTERN int MatMAIJRedimension(Mat,int,Mat*);
1226c4f061fbSSatish Balay EXTERN int MatMAIJGetAIJ(Mat,Mat*);
1227c4f061fbSSatish Balay 
1228b0a32e0cSBarry Smith EXTERN int MatComputeExplicitOperator(Mat,Mat*);
1229b0a32e0cSBarry Smith 
123024a595ddSBarry Smith EXTERN int MatESISetType(Mat,char*);
123124a595ddSBarry Smith EXTERN int MatESISetFromOptions(Mat);
123224a595ddSBarry Smith 
12332cd6534aSBarry Smith EXTERN int MatDiagonalScaleLocal(Mat,Vec);
123404f1ad80SBarry Smith 
12357dbadf16SMatthew Knepley EXTERN int PetscViewerMathematicaPutMatrix(PetscViewer, int, int, PetscReal *);
12367dbadf16SMatthew Knepley EXTERN int PetscViewerMathematicaPutCSRMatrix(PetscViewer, int, int, int *, int *, PetscReal *);
12377dbadf16SMatthew Knepley 
1238e82a3eeeSBarry Smith EXTERN int MatUseSpooles_SeqAIJ(Mat);
1239e82a3eeeSBarry Smith EXTERN int MatUseUMFPACK_SeqAIJ(Mat);
1240e82a3eeeSBarry Smith EXTERN int MatUseSuperLU_SeqAIJ(Mat);
1241e82a3eeeSBarry Smith EXTERN int MatUseEssl_SeqAIJ(Mat);
1242e82a3eeeSBarry Smith EXTERN int MatUseLUSOL_SeqAIJ(Mat);
1243e82a3eeeSBarry Smith EXTERN int MatUseMatlab_SeqAIJ(Mat);
1244e82a3eeeSBarry Smith EXTERN int MatUseDXML_SeqAIJ(Mat);
12450889b5dcSvictorle EXTERN int MatUsePETSc_SeqAIJ(Mat);
1246e82a3eeeSBarry Smith EXTERN int MatUseSuperLU_DIST_MPIAIJ(Mat);
1247e82a3eeeSBarry Smith EXTERN int MatUseSpooles_MPIAIJ(Mat);
1248e82a3eeeSBarry Smith EXTERN int MatUseSpooles_SeqSBAIJ(Mat);
1249eee76cafSHong Zhang EXTERN int MatUseSpooles_MPISBAIJ(Mat);
1250eee76cafSHong Zhang EXTERN int MatUseMUMPS_MPIAIJ(Mat);
1251e82a3eeeSBarry Smith 
1252e9fa29b7SSatish Balay PETSC_EXTERN_CXX_END
12532eac72dbSBarry Smith #endif
1254