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: #undef __FUNCT__  
  8: /*@
  9:     MatHasOperation - Determines whether the given matrix supports the particular
 10:     operation.

 12:    Collective on Mat

 14:    Input Parameters:
 15: +  mat - the matrix
 16: -  op - the operation, for example, MATOP_GET_DIAGONAL

 18:    Output Parameter:
 19: .  has - either PETSC_TRUE or PETSC_FALSE

 21:    Level: advanced

 23:    Notes:
 24:    See the file include/petscmat.h for a complete list of matrix
 25:    operations, which all have the form MATOP_<OPERATION>, where
 26:    <OPERATION> is the name (in all capital letters) of the
 27:    user-level routine.  E.g., MatNorm() -> MATOP_NORM.

 29: .keywords: matrix, has, operation

 31: .seealso: MatCreateShell()
 32: @*/
 33: int MatHasOperation(Mat mat,MatOperation op,PetscTruth *has)
 34: {
 38:   MatPreallocated(mat);
 39:   if (((void **)mat->ops)[op]) {*has =  PETSC_TRUE;}
 40:   else {*has = PETSC_FALSE;}
 41:   return(0);
 42: }