Actual source code: mhas.c
1: /*$Id: mhas.c,v 1.24 2001/03/23 23:21:44 balay Exp $*/
4: #include src/mat/matimpl.h
5:
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: int MatHasOperation(Mat mat,MatOperation op,PetscTruth *has)
32: {
36: MatPreallocated(mat);
37: if (((void **)mat->ops)[op]) {*has = PETSC_TRUE;}
38: else {*has = PETSC_FALSE;}
39: return(0);
40: }