2: #include src/mat/matimpl.h 3: 6: /*@ 7: MatHasOperation - Determines whether the given matrix supports the particular 8: operation. 10: Collective on Mat 12: Input Parameters: 13: + mat - the matrix 14: - op - the operation, for example, MATOP_GET_DIAGONAL 16: Output Parameter: 17: . has - either PETSC_TRUE or PETSC_FALSE 19: Level: advanced 21: Notes: 22: See the file include/petscmat.h for a complete list of matrix 23: operations, which all have the form MATOP_<OPERATION>, where 24: <OPERATION> is the name (in all capital letters) of the 25: user-level routine. E.g., MatNorm() -> MATOP_NORM. 27: .keywords: matrix, has, operation 29: .seealso: MatCreateShell() 30: @*/ 31: PetscErrorCode MatHasOperation(Mat mat,MatOperation op,PetscTruth *has) 32: { 36: MatPreallocated(mat); 38: if (((void **)mat->ops)[op]) {*has = PETSC_TRUE;} 39: else {*has = PETSC_FALSE;} 40: return(0); 41: }