1*56cd22aeSBarry Smith /* $Id: mat.h,v 1.137 1997/07/01 22:18:03 bsmith Exp bsmith $ */ 22eac72dbSBarry Smith /* 32eac72dbSBarry Smith Include file for the matrix component of PETSc 42eac72dbSBarry Smith */ 51eb62cbbSBarry Smith #ifndef __MAT_PACKAGE 61eb62cbbSBarry Smith #define __MAT_PACKAGE 78ed539a5SBarry Smith #include "vec.h" 82eac72dbSBarry Smith 99cd28387SBarry Smith #define MAT_COOKIE PETSC_COOKIE+5 10f0479e8cSBarry Smith 11e2a1c21fSSatish Balay typedef struct _p_Mat* Mat; 122eac72dbSBarry Smith 1394a9d846SBarry Smith #define MAX_MATRIX_TYPES 12 14639f9d9dSBarry Smith /* 15639f9d9dSBarry Smith The default matrix data storage formats and routines to create them. 16639f9d9dSBarry Smith */ 174ac9ca07SLois Curfman McInnes typedef enum { MATSAME=-1, MATSEQDENSE, MATSEQAIJ, MATMPIAIJ, MATSHELL, 1884cb2905SBarry Smith MATMPIROWBS, MATSEQBDIAG, MATMPIBDIAG, MATMPIDENSE, MATSEQBAIJ, 1982c9921cSBarry Smith MATMPIBAIJ, MATMPICSN, MATSEQCSN, MATSEQADJ, MATMPIADJ} MatType; 2028988994SBarry Smith 210e998a85SBarry Smith extern int MatCreate(MPI_Comm,int,int,Mat*); 22df6e0191SLois Curfman McInnes extern int MatCreateSeqDense(MPI_Comm,int,int,Scalar*,Mat*); 23d5bc1036SLois Curfman McInnes extern int MatCreateMPIDense(MPI_Comm,int,int,int,int,Scalar*,Mat*); 24de7da479SBarry Smith extern int MatCreateSeqAIJ(MPI_Comm,int,int,int,int*,Mat*); 259717bf64SBarry Smith extern int MatCreateMPIAIJ(MPI_Comm,int,int,int,int,int,int*,int,int*,Mat*); 26cfe223acSLois Curfman McInnes extern int MatCreateMPIRowbs(MPI_Comm,int,int,int,int*,void*,Mat*); 27f26ada1bSBarry Smith extern int MatCreateSeqBDiag(MPI_Comm,int,int,int,int,int*,Scalar**,Mat*); 28f26ada1bSBarry Smith extern int MatCreateMPIBDiag(MPI_Comm,int,int,int,int,int,int*,Scalar**,Mat*); 29df8a92d1SBarry Smith extern int MatCreateSeqBAIJ(MPI_Comm,int,int,int,int,int*,Mat*); 30eba03b66SLois Curfman McInnes extern int MatCreateMPIBAIJ(MPI_Comm,int,int,int,int,int,int,int*,int,int*,Mat*); 3182c9921cSBarry Smith extern int MatCreateSeqAdj(MPI_Comm,int,int,int*,int*,Mat *); 3282c9921cSBarry Smith extern int MatCreateMPIAdj(MPI_Comm,int,int,int,int*,int*,Mat*); 339717bf64SBarry Smith 347b80b807SBarry Smith extern int MatDestroy(Mat); 357b80b807SBarry Smith 367ddc982cSLois Curfman McInnes extern int MatCreateShell(MPI_Comm,int,int,int,int,void *,Mat*); 3717116c71SBarry Smith extern int MatShellGetContext(Mat,void **); 3821c89e3eSBarry Smith 39ec0117caSBarry Smith extern int MatPrintHelp(Mat); 40ec0117caSBarry Smith 418ed539a5SBarry Smith /* ------------------------------------------------------------*/ 42ee50ffe9SBarry Smith extern int MatSetValues(Mat,int,int*,int,int*,Scalar*,InsertMode); 4395e63191SSatish Balay extern int MatSetValuesBlocked(Mat,int,int*,int,int*,Scalar*,InsertMode); 4484cb2905SBarry Smith 456d4a8577SBarry Smith typedef enum {MAT_FLUSH_ASSEMBLY=1,MAT_FINAL_ASSEMBLY=0} MatAssemblyType; 46ee50ffe9SBarry Smith extern int MatAssemblyBegin(Mat,MatAssemblyType); 47ee50ffe9SBarry Smith extern int MatAssemblyEnd(Mat,MatAssemblyType); 48b951964fSBarry Smith #define MatSetValue(v,i,j,va,mode) \ 49b951964fSBarry Smith {int _ierr,_row = i,_col = j; Scalar _va = va; \ 50b951964fSBarry Smith _ierr = MatSetValues(v,1,&_row,1,&_col,&_va,mode);CHKERRQ(_ierr); \ 51b951964fSBarry Smith } 52ee50ffe9SBarry Smith 536d4a8577SBarry Smith typedef enum {MAT_ROW_ORIENTED=1,MAT_COLUMN_ORIENTED=2,MAT_ROWS_SORTED=4, 546d4a8577SBarry Smith MAT_COLUMNS_SORTED=8,MAT_NO_NEW_NONZERO_LOCATIONS=16, 556d4a8577SBarry Smith MAT_YES_NEW_NONZERO_LOCATIONS=32,MAT_SYMMETRIC=64, 566d4a8577SBarry Smith MAT_STRUCTURALLY_SYMMETRIC,MAT_NO_NEW_DIAGONALS, 576d4a8577SBarry Smith MAT_YES_NEW_DIAGONALS,MAT_INODE_LIMIT_1,MAT_INODE_LIMIT_2, 5890f02eecSBarry Smith MAT_INODE_LIMIT_3,MAT_INODE_LIMIT_4,MAT_INODE_LIMIT_5, 592b362799SSatish Balay MAT_IGNORE_OFF_PROC_ENTRIES,MAT_ROWS_UNSORTED, 6096854ed6SLois Curfman McInnes MAT_COLUMNS_UNSORTED,MAT_NEW_NONZERO_LOCATION_ERROR, 6196854ed6SLois Curfman McInnes MAT_NEW_NONZERO_ALLOCATION_ERROR} MatOption; 62ee50ffe9SBarry Smith extern int MatSetOption(Mat,MatOption); 634b0e389bSBarry Smith extern int MatGetType(Mat,MatType*,char**); 64*56cd22aeSBarry Smith extern int MatGetTypeFromOptions(MPI_Comm,char*,MatType*,PetscTruth*); 6584cb2905SBarry Smith 66ee50ffe9SBarry Smith extern int MatGetValues(Mat,int,int*,int,int*,Scalar*); 678ed539a5SBarry Smith extern int MatGetRow(Mat,int,int *,int **,Scalar**); 688ed539a5SBarry Smith extern int MatRestoreRow(Mat,int,int *,int **,Scalar**); 6977c4ece6SBarry Smith extern int MatGetColumn(Mat,int,int *,int **,Scalar**); 7077c4ece6SBarry Smith extern int MatRestoreColumn(Mat,int,int *,int **,Scalar**); 7164e87e97SBarry Smith extern int MatGetArray(Mat,Scalar **); 7209883261SBarry Smith extern int MatRestoreArray(Mat,Scalar **); 73870582ebSSatish Balay extern int MatGetBlockSize(Mat,int *); 747b80b807SBarry Smith 758ed539a5SBarry Smith extern int MatMult(Mat,Vec,Vec); 768ed539a5SBarry Smith extern int MatMultAdd(Mat,Vec,Vec,Vec); 778ed539a5SBarry Smith extern int MatMultTrans(Mat,Vec,Vec); 788ed539a5SBarry Smith extern int MatMultTransAdd(Mat,Vec,Vec,Vec); 792eac72dbSBarry Smith 807b80b807SBarry Smith extern int MatConvert(Mat,MatType,Mat*); 8194a9d846SBarry Smith extern int MatConvertRegister(MatType,MatType,int (*)(Mat,MatType,Mat*)); 8294a9d846SBarry Smith extern int MatConvertRegisterAll(); 8394a9d846SBarry Smith 847b80b807SBarry Smith extern int MatCopy(Mat,Mat); 857b80b807SBarry Smith extern int MatView(Mat,Viewer); 867b80b807SBarry Smith extern int MatLoad(Viewer,MatType,Mat*); 8794a9d846SBarry Smith extern int MatLoadRegister(MatType,int (*)(Viewer,MatType,Mat*)); 8894a9d846SBarry Smith extern int MatLoadRegisterAll(); 897b80b807SBarry Smith 90d4fbbf0eSBarry Smith extern int MatGetRowIJ(Mat,int,PetscTruth,int*,int **,int **,PetscTruth *); 91d4fbbf0eSBarry Smith extern int MatRestoreRowIJ(Mat,int,PetscTruth,int *,int **,int **,PetscTruth *); 92d4fbbf0eSBarry Smith extern int MatGetColumnIJ(Mat,int,PetscTruth,int*,int **,int **,PetscTruth *); 93d4fbbf0eSBarry Smith extern int MatRestoreColumnIJ(Mat,int,PetscTruth,int *,int **,int **,PetscTruth *); 94d4fbbf0eSBarry Smith 951d607229SLois Curfman McInnes /* 961d607229SLois Curfman McInnes Context of matrix information, used with MatGetInfo() 971d607229SLois Curfman McInnes Note: If any entries are added to this context, be sure 981d607229SLois Curfman McInnes to adjust MAT_INFO_SIZE in FINCLUDE/mat.h 991d607229SLois Curfman McInnes */ 1004e220ebcSLois Curfman McInnes typedef struct { 10137f753daSBarry Smith PLogDouble rows_global, columns_global; /* number of global rows and columns */ 10237f753daSBarry Smith PLogDouble rows_local, columns_local; /* number of local rows and columns */ 10337f753daSBarry Smith PLogDouble block_size; /* block size */ 10437f753daSBarry Smith PLogDouble nz_allocated, nz_used, nz_unneeded; /* number of nonzeros */ 10537f753daSBarry Smith PLogDouble memory; /* memory allocated */ 10637f753daSBarry Smith PLogDouble assemblies; /* number of matrix assemblies */ 10737f753daSBarry Smith PLogDouble mallocs; /* number of mallocs during MatSetValues() */ 10837f753daSBarry Smith PLogDouble fill_ratio_given, fill_ratio_needed; /* fill ratio for LU/ILU */ 10937f753daSBarry Smith PLogDouble factor_mallocs; /* number of mallocs during factorization */ 1104e220ebcSLois Curfman McInnes } MatInfo; 1114e220ebcSLois Curfman McInnes 1127b80b807SBarry Smith typedef enum {MAT_LOCAL=1,MAT_GLOBAL_MAX=2,MAT_GLOBAL_SUM=3} MatInfoType; 1134e220ebcSLois Curfman McInnes extern int MatGetInfo(Mat,MatInfoType,MatInfo*); 11477c4ece6SBarry Smith extern int MatValid(Mat,PetscTruth*); 1157b80b807SBarry Smith extern int MatGetDiagonal(Mat,Vec); 116cd8486b4SBarry Smith extern int MatTranspose(Mat,Mat*); 1170513a670SBarry Smith extern int MatPermute(Mat,IS,IS,Mat *); 118f4c33d5aSBarry Smith extern int MatDiagonalScale(Mat,Vec,Vec); 1198b3e568eSBarry Smith extern int MatDiagonalShift(Mat,Vec); 12077c4ece6SBarry Smith extern int MatEqual(Mat,Mat, PetscTruth*); 1217b80b807SBarry Smith 1227b80b807SBarry Smith extern int MatNorm(Mat,NormType,double *); 1237b80b807SBarry Smith extern int MatZeroEntries(Mat); 1247b80b807SBarry Smith extern int MatZeroRows(Mat,IS,Scalar*); 1257b80b807SBarry Smith extern int MatZeroColumns(Mat,IS,Scalar*); 1267b80b807SBarry Smith 1277b80b807SBarry Smith extern int MatGetSize(Mat,int*,int*); 1287b80b807SBarry Smith extern int MatGetLocalSize(Mat,int*,int*); 1297b80b807SBarry Smith extern int MatGetOwnershipRange(Mat,int*,int*); 1307b80b807SBarry Smith 1317b80b807SBarry Smith typedef enum {MAT_INITIAL_MATRIX, MAT_REUSE_MATRIX} MatGetSubMatrixCall; 1327b80b807SBarry Smith extern int MatGetSubMatrices(Mat,int,IS *,IS *,MatGetSubMatrixCall,Mat **); 133905e6a2fSBarry Smith extern int MatDestroyMatrices(int, Mat **); 1347b80b807SBarry Smith extern int MatIncreaseOverlap(Mat,int,IS *,int); 1357b80b807SBarry Smith 1367b80b807SBarry Smith extern int MatAXPY(Scalar *,Mat,Mat); 1377b80b807SBarry Smith extern int MatCompress(Mat); 1387b80b807SBarry Smith 139052efed2SBarry Smith extern int MatScale(Scalar *,Mat); 140052efed2SBarry Smith extern int MatShift(Scalar *,Mat); 141052efed2SBarry Smith 14290f02eecSBarry Smith extern int MatSetLocalToGlobalMapping(Mat, int,int *); 143eed86810SBarry Smith extern int MatSetLocalToGlobalMappingBlocked(Mat, int,int *); 14490f02eecSBarry Smith extern int MatZeroRowsLocal(Mat,IS,Scalar*); 14590f02eecSBarry Smith extern int MatSetValuesLocal(Mat,int,int*,int,int*,Scalar*,InsertMode); 1464a387fc0SSatish Balay extern int MatSetValuesBlockedLocal(Mat,int,int*,int,int*,Scalar*,InsertMode); 14790f02eecSBarry Smith 1487b80b807SBarry Smith /* Routines unique to particular data structures */ 1497b80b807SBarry Smith extern int MatBDiagGetData(Mat,int*,int*,int**,int**,Scalar***); 1507b80b807SBarry Smith 1517b80b807SBarry Smith /* 1527b80b807SBarry Smith These routines are not usually accessed directly, rather solving is 1537b80b807SBarry Smith done through the SLES, KSP and PC interfaces. 1547b80b807SBarry Smith */ 1557b80b807SBarry Smith 15684cb2905SBarry Smith typedef enum {ORDER_NATURAL=0,ORDER_ND=1,ORDER_1WD=2,ORDER_RCM=3, 15784cb2905SBarry Smith ORDER_QMD=4,ORDER_ROWLENGTH=5,ORDER_FLOW,ORDER_NEW} MatReordering; 158a2ce50c7SBarry Smith extern int MatGetReordering(Mat,MatReordering,IS*,IS*); 159a2ce50c7SBarry Smith extern int MatGetReorderingTypeFromOptions(char *,MatReordering*); 16084cb2905SBarry Smith extern int MatReorderingRegister(MatReordering,MatReordering*,char*,int(*)(Mat,MatReordering,IS*,IS*)); 161a2ce50c7SBarry Smith extern int MatReorderingGetName(MatReordering,char **); 16284cb2905SBarry Smith extern int MatReorderingRegisterDestroy(); 16384cb2905SBarry Smith extern int MatReorderingRegisterAll(); 16484cb2905SBarry Smith extern int MatReorderingRegisterAllCalled; 165d4fbbf0eSBarry Smith 166a2ce50c7SBarry Smith extern int MatReorderForNonzeroDiagonal(Mat,double,IS,IS); 167a2ce50c7SBarry Smith 168a2ce50c7SBarry Smith extern int MatCholeskyFactor(Mat,IS,double); 169a2ce50c7SBarry Smith extern int MatCholeskyFactorSymbolic(Mat,IS,double,Mat*); 170a2ce50c7SBarry Smith extern int MatCholeskyFactorNumeric(Mat,Mat*); 171a2ce50c7SBarry Smith 17249d8b64dSBarry Smith extern int MatLUFactor(Mat,IS,IS,double); 173d7b056bfSBarry Smith extern int MatILUFactor(Mat,IS,IS,double,int); 17464051cb3SBarry Smith extern int MatLUFactorSymbolic(Mat,IS,IS,double,Mat*); 17564051cb3SBarry Smith extern int MatILUFactorSymbolic(Mat,IS,IS,double,int,Mat*); 17664051cb3SBarry Smith extern int MatIncompleteCholeskyFactorSymbolic(Mat,IS,double,int,Mat*); 17720563c6bSBarry Smith extern int MatLUFactorNumeric(Mat,Mat*); 178a2ce50c7SBarry Smith extern int MatILUDTFactor(Mat,double,int,IS,IS,Mat *); 179a2ce50c7SBarry Smith 1808ed539a5SBarry Smith extern int MatSolve(Mat,Vec,Vec); 18122169318SLois Curfman McInnes extern int MatForwardSolve(Mat,Vec,Vec); 18222169318SLois Curfman McInnes extern int MatBackwardSolve(Mat,Vec,Vec); 1838ed539a5SBarry Smith extern int MatSolveAdd(Mat,Vec,Vec,Vec); 18428988994SBarry Smith extern int MatSolveTrans(Mat,Vec,Vec); 18528988994SBarry Smith extern int MatSolveTransAdd(Mat,Vec,Vec,Vec); 1868ed539a5SBarry Smith 187bb5a7306SBarry Smith extern int MatSetUnfactored(Mat); 188bb5a7306SBarry Smith 189ee50ffe9SBarry Smith typedef enum {SOR_FORWARD_SWEEP=1,SOR_BACKWARD_SWEEP=2,SOR_SYMMETRIC_SWEEP=3, 190ee50ffe9SBarry Smith SOR_LOCAL_FORWARD_SWEEP=4,SOR_LOCAL_BACKWARD_SWEEP=8, 191ee50ffe9SBarry Smith SOR_LOCAL_SYMMETRIC_SWEEP=12,SOR_ZERO_INITIAL_GUESS=16, 19284cb2905SBarry Smith SOR_EISENSTAT=32,SOR_APPLY_UPPER=64,SOR_APPLY_LOWER=128} MatSORType; 193ca9b4cbeSLois Curfman McInnes extern int MatRelax(Mat,Vec,double,MatSORType,double,int,Vec); 1948ed539a5SBarry Smith 195d4fbbf0eSBarry Smith /* 196639f9d9dSBarry Smith These routines are for efficiently computing Jacobians via finite differences. 197639f9d9dSBarry Smith */ 198639f9d9dSBarry Smith typedef enum {COLORING_NATURAL, COLORING_SL, COLORING_LF, COLORING_ID, 19984cb2905SBarry Smith COLORING_NEW} MatColoring; 200639f9d9dSBarry Smith extern int MatGetColoring(Mat,MatColoring,ISColoring*); 201639f9d9dSBarry Smith extern int MatGetColoringTypeFromOptions(char *,MatColoring*); 20284cb2905SBarry Smith extern int MatColoringRegister(MatColoring,MatColoring*,char*,int(*)(Mat,MatColoring,ISColoring *)); 203639f9d9dSBarry Smith extern int MatColoringRegisterAll(); 20484cb2905SBarry Smith extern int MatColoringRegisterAllCalled; 205639f9d9dSBarry Smith extern int MatColoringRegisterDestroy(); 206639f9d9dSBarry Smith extern int MatColoringPatch(Mat,int,int *,ISColoring*); 207639f9d9dSBarry Smith 20884cb2905SBarry Smith /* 20984cb2905SBarry Smith Data structures used to compute Jacobian vector products 21084cb2905SBarry Smith efficiently using finite differences. 21184cb2905SBarry Smith */ 212639f9d9dSBarry Smith #define MAT_FDCOLORING_COOKIE PETSC_COOKIE + 22 213639f9d9dSBarry Smith 214e2a1c21fSSatish Balay typedef struct _p_MatFDColoring *MatFDColoring; 215639f9d9dSBarry Smith 216639f9d9dSBarry Smith extern int MatFDColoringCreate(Mat,ISColoring,MatFDColoring *); 217639f9d9dSBarry Smith extern int MatFDColoringDestroy(MatFDColoring); 218639f9d9dSBarry Smith extern int MatFDColoringView(MatFDColoring,Viewer); 219639f9d9dSBarry Smith extern int MatFDColoringSetParameters(MatFDColoring,double,double); 220639f9d9dSBarry Smith extern int MatFDColoringSetFromOptions(MatFDColoring); 221639f9d9dSBarry Smith extern int MatFDColoringPrintHelp(MatFDColoring); 22243a90d84SBarry Smith extern int MatFDColoringApply(Mat,MatFDColoring,Vec,Vec,Vec,Vec,int (*)(void *,Vec,Vec,void*), 22343a90d84SBarry Smith void *,void *); 224639f9d9dSBarry Smith 225639f9d9dSBarry Smith /* 226d4fbbf0eSBarry Smith If you add entries here you must also add them to FINCLUDE/mat.h 227d4fbbf0eSBarry Smith */ 2281c1c02c0SLois Curfman McInnes typedef enum { MATOP_SET_VALUES=0, 2291c1c02c0SLois Curfman McInnes MATOP_GET_ROW=1, 2301c1c02c0SLois Curfman McInnes MATOP_RESTORE_ROW=2, 2311c1c02c0SLois Curfman McInnes MATOP_MULT=3, 2321c1c02c0SLois Curfman McInnes MATOP_MULT_ADD=4, 2331c1c02c0SLois Curfman McInnes MATOP_MULT_TRANS=5, 2341c1c02c0SLois Curfman McInnes MATOP_MULT_TRANS_ADD=6, 2351c1c02c0SLois Curfman McInnes MATOP_SOLVE=7, 2361c1c02c0SLois Curfman McInnes MATOP_SOLVE_ADD=8, 2371c1c02c0SLois Curfman McInnes MATOP_SOLVE_TRANS=9, 2381c1c02c0SLois Curfman McInnes MATOP_SOLVE_TRANS_ADD=10, 2391c1c02c0SLois Curfman McInnes MATOP_LUFACTOR=11, 2401c1c02c0SLois Curfman McInnes MATOP_CHOLESKYFACTOR=12, 2411c1c02c0SLois Curfman McInnes MATOP_RELAX=13, 2421c1c02c0SLois Curfman McInnes MATOP_TRANSPOSE=14, 2431c1c02c0SLois Curfman McInnes MATOP_GETINFO=15, 2441c1c02c0SLois Curfman McInnes MATOP_EQUAL=16, 2451c1c02c0SLois Curfman McInnes MATOP_GET_DIAGONAL=17, 2461c1c02c0SLois Curfman McInnes MATOP_DIAGONAL_SCALE=18, 2471c1c02c0SLois Curfman McInnes MATOP_NORM=19, 2481c1c02c0SLois Curfman McInnes MATOP_ASSEMBLY_BEGIN=20, 2491c1c02c0SLois Curfman McInnes MATOP_ASSEMBLY_END=21, 2501c1c02c0SLois Curfman McInnes MATOP_COMPRESS=22, 2511c1c02c0SLois Curfman McInnes MATOP_SET_OPTION=23, 2521c1c02c0SLois Curfman McInnes MATOP_ZERO_ENTRIES=24, 2531c1c02c0SLois Curfman McInnes MATOP_ZERO_ROWS=25, 2541c1c02c0SLois Curfman McInnes MATOP_LUFACTOR_SYMBOLIC=26, 2551c1c02c0SLois Curfman McInnes MATOP_LUFACTOR_NUMERIC=27, 2561c1c02c0SLois Curfman McInnes MATOP_CHOLESKY_FACTOR_SYMBOLIC=28, 2571c1c02c0SLois Curfman McInnes MATOP_CHOLESKY_FACTOR_NUMERIC=29, 2581c1c02c0SLois Curfman McInnes MATOP_GET_SIZE=30, 2591c1c02c0SLois Curfman McInnes MATOP_GET_LOCAL_SIZE=31, 2601c1c02c0SLois Curfman McInnes MATOP_GET_OWNERSHIP_RANGE=32, 2611c1c02c0SLois Curfman McInnes MATOP_ILUFACTOR_SYMBOLIC=33, 2621c1c02c0SLois Curfman McInnes MATOP_INCOMPLETECHOLESKYFACTOR_SYMBOLIC=34, 2631c1c02c0SLois Curfman McInnes MATOP_GET_ARRAY=35, 2641c1c02c0SLois Curfman McInnes MATOP_RESTORE_ARRAY=36, 2657bf97ca4SSatish Balay 26684cb2905SBarry Smith MATOP_CONVERT_SAME_TYPE=39, 26784cb2905SBarry Smith MATOP_FORWARD_SOLVE=40, 26884cb2905SBarry Smith MATOP_BACKWARD_SOLVE=41, 26984cb2905SBarry Smith MATOP_ILUFACTOR=42, 27084cb2905SBarry Smith MATOP_INCOMPLETECHOLESKYFACTOR=43, 27184cb2905SBarry Smith MATOP_AXPY=44, 27284cb2905SBarry Smith MATOP_GET_SUBMATRICES=45, 27384cb2905SBarry Smith MATOP_INCREASE_OVERLAP=46, 27484cb2905SBarry Smith MATOP_GET_VALUES=47, 27584cb2905SBarry Smith MATOP_COPY=48, 27684cb2905SBarry Smith MATOP_PRINT_HELP=49, 27784cb2905SBarry Smith MATOP_SCALE=50, 27884cb2905SBarry Smith MATOP_SHIFT=51, 27984cb2905SBarry Smith MATOP_DIAGONAL_SHIFT=52, 28084cb2905SBarry Smith MATOP_ILUDT_FACTOR=53, 28184cb2905SBarry Smith MATOP_GET_BLOCK_SIZE=54, 28284cb2905SBarry Smith MATOP_GET_ROW_IJ=55, 28384cb2905SBarry Smith MATOP_RESTORE_ROW_IJ=56, 28484cb2905SBarry Smith MATOP_GET_COLUMN_IJ=57, 28584cb2905SBarry Smith MATOP_RESTORE_COLUMN_IJ=58, 28684cb2905SBarry Smith MATOP_FDCOLORING_CREATE=59, 2871c1c02c0SLois Curfman McInnes MATOP_DESTROY=250, 2881c1c02c0SLois Curfman McInnes MATOP_VIEW=251 289fae171e0SBarry Smith } MatOperation; 290112a2221SBarry Smith extern int MatHasOperation(Mat,MatOperation,PetscTruth*); 291fae171e0SBarry Smith extern int MatShellSetOperation(Mat,MatOperation,void *); 292112a2221SBarry Smith 29390ace30eSBarry Smith /* 29490ace30eSBarry Smith Codes for matrices stored on disk. By default they are 29590ace30eSBarry Smith stored in a universal format. By changing the format with 296639f9d9dSBarry Smith ViewerSetFormat(viewer,VIEWER_FORMAT_BINARY_NATIVE); the matrices will 29790ace30eSBarry Smith be stored in a way natural for the matrix, for example dense matrices 29890ace30eSBarry Smith would be stored as dense. Matrices stored this way may only be 29990ace30eSBarry Smith read into matrices of the same time. 30090ace30eSBarry Smith */ 30190ace30eSBarry Smith #define MATRIX_BINARY_FORMAT_DENSE -1 30290ace30eSBarry Smith 3033f1d51d7SBarry Smith /* 3043f1d51d7SBarry Smith New matrix classes not yet distributed 3053f1d51d7SBarry Smith */ 3063f1d51d7SBarry Smith /* 3073f1d51d7SBarry Smith MatAIJIndices is a data structure for storing the nonzero location information 3083f1d51d7SBarry Smith for sparse matrices. Several matrices with identical nonzero structure can share 3093f1d51d7SBarry Smith the same MatAIJIndices. 3103f1d51d7SBarry Smith */ 311e2a1c21fSSatish Balay typedef struct _p_MatAIJIndices* MatAIJIndices; 3123f1d51d7SBarry Smith 3133f1d51d7SBarry Smith extern int MatCreateAIJIndices(int,int,int*,int*,PetscTruth,MatAIJIndices*); 3143f1d51d7SBarry Smith extern int MatCreateAIJIndicesEmpty(int,int,int*,PetscTruth,MatAIJIndices*); 3153f1d51d7SBarry Smith extern int MatAttachAIJIndices(MatAIJIndices,MatAIJIndices*); 3163f1d51d7SBarry Smith extern int MatDestroyAIJIndices(MatAIJIndices); 3173f1d51d7SBarry Smith extern int MatCopyAIJIndices(MatAIJIndices,MatAIJIndices*); 3183f1d51d7SBarry Smith extern int MatValidateAIJIndices(int,MatAIJIndices); 3193f1d51d7SBarry Smith extern int MatShiftAIJIndices(MatAIJIndices); 3203f1d51d7SBarry Smith extern int MatShrinkAIJIndices(MatAIJIndices); 3213f1d51d7SBarry Smith extern int MatTransposeAIJIndices(MatAIJIndices, MatAIJIndices*); 3223f1d51d7SBarry Smith 3233f1d51d7SBarry Smith extern int MatCreateSeqCSN(MPI_Comm,int,int,int*,int,Mat*); 3243f1d51d7SBarry Smith extern int MatCreateSeqCSN_Single(MPI_Comm,int,int,int*,int,Mat*); 3253f1d51d7SBarry Smith extern int MatCreateSeqCSNWithPrecision(MPI_Comm,int,int,int*,int,ScalarPrecision,Mat*); 3263f1d51d7SBarry Smith 3273f1d51d7SBarry Smith extern int MatCreateSeqCSNIndices(MPI_Comm,MatAIJIndices,int,Mat *); 3283f1d51d7SBarry Smith extern int MatCreateSeqCSNIndices_Single(MPI_Comm,MatAIJIndices,int,Mat *); 3293f1d51d7SBarry Smith extern int MatCreateSeqCSNIndicesWithPrecision(MPI_Comm,MatAIJIndices,int,ScalarPrecision,Mat *); 3303f1d51d7SBarry Smith 3313f1d51d7SBarry Smith 3322eac72dbSBarry Smith #endif 3332eac72dbSBarry Smith 3342eac72dbSBarry Smith 3359d00d63dSBarry Smith 336