Actual source code: slepcimpl.h

  1: /*
  2:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  3:    SLEPc - Scalable Library for Eigenvalue Problem Computations
  4:    Copyright (c) 2002-2012, Universitat Politecnica de Valencia, Spain

  6:    This file is part of SLEPc.
  7:       
  8:    SLEPc is free software: you can redistribute it and/or modify it under  the
  9:    terms of version 3 of the GNU Lesser General Public License as published by
 10:    the Free Software Foundation.

 12:    SLEPc  is  distributed in the hope that it will be useful, but WITHOUT  ANY 
 13:    WARRANTY;  without even the implied warranty of MERCHANTABILITY or  FITNESS 
 14:    FOR  A  PARTICULAR PURPOSE. See the GNU Lesser General Public  License  for 
 15:    more details.

 17:    You  should have received a copy of the GNU Lesser General  Public  License
 18:    along with SLEPc. If not, see <http://www.gnu.org/licenses/>.
 19:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 20: */

 22: #ifndef _SLEPCIMPL
 23: #define _SLEPCIMPL

 25: #include <slepcsys.h>

 27: /*@C
 28:     SlepcHeaderCreate - Creates a SLEPc object

 30:     Input Parameters:
 31: +   tp - the data structure type of the object
 32: .   pops - the data structure type of the objects operations (for example VecOps)
 33: .   cook - the classid associated with this object
 34: .   t - type (no longer should be used)
 35: .   class_name - string name of class; should be static
 36: .   com - the MPI Communicator
 37: .   des - the destroy routine for this object
 38: -   vie - the view routine for this object

 40:     Output Parameter:
 41: .   h - the newly created object

 43:     Note:
 44:     This is equivalent to PetscHeaderCreate but makes sure that SlepcInitialize
 45:     has been called.

 47:     Level: developer
 48: @*/
 49: #define SlepcHeaderCreate(h,tp,pops,cook,t,class_name,descr,mansec,com,des,vie) \
 50:     ((!SlepcInitializeCalled && \
 51:     PetscError(comm,__LINE__,PETSC_FUNCTION_NAME,__FILE__,__SDIR__,1,PETSC_ERROR_INITIAL, \
 52:     "Must call SlepcInitialize instead of PetscInitialize to use SLEPc classes")) ||  \
 53:     PetscHeaderCreate(h,tp,pops,cook,t,class_name,descr,mansec,com,des,vie))

 55: /* context for monitors of type XXXMonitorConverged */
 56: struct _n_SlepcConvMonitor {
 57:   PetscViewer viewer;
 58:   PetscInt    oldnconv;
 59: };
 60: typedef struct _n_SlepcConvMonitor* SlepcConvMonitor;

 62: /* Private functions that are shared by several classes */
 63: PETSC_EXTERN PetscErrorCode SlepcConvMonitorDestroy(SlepcConvMonitor *ctx);

 65: PETSC_EXTERN PetscErrorCode SlepcCompareLargestMagnitude(PetscScalar,PetscScalar,PetscScalar,PetscScalar,PetscInt*,void*);
 66: PETSC_EXTERN PetscErrorCode SlepcCompareSmallestMagnitude(PetscScalar,PetscScalar,PetscScalar,PetscScalar,PetscInt*,void*);
 67: PETSC_EXTERN PetscErrorCode SlepcCompareLargestReal(PetscScalar,PetscScalar,PetscScalar,PetscScalar,PetscInt*,void*);
 68: PETSC_EXTERN PetscErrorCode SlepcCompareSmallestReal(PetscScalar,PetscScalar,PetscScalar,PetscScalar,PetscInt*,void*);
 69: PETSC_EXTERN PetscErrorCode SlepcCompareLargestImaginary(PetscScalar,PetscScalar,PetscScalar,PetscScalar,PetscInt*,void*);
 70: PETSC_EXTERN PetscErrorCode SlepcCompareSmallestImaginary(PetscScalar,PetscScalar,PetscScalar,PetscScalar,PetscInt*,void*);
 71: PETSC_EXTERN PetscErrorCode SlepcCompareTargetMagnitude(PetscScalar,PetscScalar,PetscScalar,PetscScalar,PetscInt*,void*);
 72: PETSC_EXTERN PetscErrorCode SlepcCompareTargetReal(PetscScalar,PetscScalar,PetscScalar,PetscScalar,PetscInt*,void*);
 73: PETSC_EXTERN PetscErrorCode SlepcCompareTargetImaginary(PetscScalar,PetscScalar,PetscScalar,PetscScalar,PetscInt*,void*);
 74: PETSC_EXTERN PetscErrorCode SlepcCompareSmallestPositiveReal(PetscScalar,PetscScalar,PetscScalar,PetscScalar,PetscInt*,void*);

 76: #endif