Actual source code: mhas.c

  1: /*$Id: mhas.c,v 1.24 2001/03/23 23:21:44 balay Exp $*/


  4: #include "petsc.h"
  5: #include "src/mat/matimpl.h"        /*I "petscmat.h" I*/
  6: 
  7: /*@
  8:     MatHasOperation - Determines whether the given matrix supports the particular
  9:     operation.

 11:    Collective on Mat

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

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

 20:    Level: advanced

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

 28: .keywords: matrix, has, operation

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