Actual source code: slepcsys.h

slepc-main 2024-11-09
Report Typos and Errors
  1: /*
  2:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  3:    SLEPc - Scalable Library for Eigenvalue Problem Computations
  4:    Copyright (c) 2002-, Universitat Politecnica de Valencia, Spain

  6:    This file is part of SLEPc.
  7:    SLEPc is distributed under a 2-clause BSD license (see LICENSE).
  8:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9: */
 10: /*
 11:    This include file contains definitions of system functions. It is included
 12:    by all other SLEPc include files.
 13: */

 15: #pragma once

 17: #include <petscsys.h>

 19: /* SUBMANSEC = sys */

 21: #if defined(slepc_EXPORTS)
 22: #define SLEPC_VISIBILITY_PUBLIC 
 23: #else
 24: #define SLEPC_VISIBILITY_PUBLIC PETSC_DLLIMPORT
 25: #endif
 26: #define SLEPC_VISIBILITY_INTERNAL PETSC_VISIBILITY_INTERNAL

 28: /*
 29:     Functions tagged with SLEPC_EXTERN in the header files are
 30:   always defined as extern "C" when compiled with C++ so they may be
 31:   used from C and are always visible in the shared libraries
 32: */
 33: #if defined(__cplusplus)
 34: #define SLEPC_EXTERN extern "C" SLEPC_VISIBILITY_PUBLIC
 35: #define SLEPC_INTERN extern "C" SLEPC_VISIBILITY_INTERNAL
 36: #else
 37: #define SLEPC_EXTERN extern SLEPC_VISIBILITY_PUBLIC
 38: #define SLEPC_INTERN extern SLEPC_VISIBILITY_INTERNAL
 39: #endif

 41: #if defined(PETSC_USE_SINGLE_LIBRARY)
 42:   #define SLEPC_SINGLE_LIBRARY_VISIBILITY_INTERNAL SLEPC_VISIBILITY_INTERNAL
 43:   #define SLEPC_SINGLE_LIBRARY_INTERN              SLEPC_INTERN
 44: #else
 45:   #define SLEPC_SINGLE_LIBRARY_VISIBILITY_INTERNAL SLEPC_VISIBILITY_PUBLIC
 46:   #define SLEPC_SINGLE_LIBRARY_INTERN              SLEPC_EXTERN
 47: #endif

 49: /* ========================================================================== */
 50: /*
 51:    slepcconf.h is created by the configure script and placed in ${PETSC_ARCH}/include.
 52:    It contains macro definitions set at configure time.
 53: */
 54: #include <slepcconf.h>
 55: /*
 56:     slepcversion.h contains version info
 57: */
 58: #include <slepcversion.h>
 59: #define SLEPC_AUTHOR_INFO "       The SLEPc Team\n    slepc-maint@upv.es\n https://slepc.upv.es\n"

 61: /* ========================================================================== */
 62: /*
 63:    The PETSc include files.
 64: */
 65: #include <petscmat.h>
 66: /*
 67:     slepcmath.h contains definition of basic math functions
 68: */
 69: #include <slepcmath.h>
 70: /*
 71:     slepcsc.h contains definition of sorting criterion
 72: */
 73: #include <slepcsc.h>
 74: /*
 75:     slepcmat.h, slepcvec.h contain utilities related to Mat and Vec, extend functionality in PETSc
 76: */
 77: #include <slepcmat.h>
 78: #include <slepcvec.h>

 80: /*
 81:     Context for monitors of type XXXMonitorConverged
 82: */
 83: typedef struct _n_SlepcConvMon* SlepcConvMon;

 85: /*
 86:     Initialization of SLEPc and other system routines
 87: */
 88: SLEPC_EXTERN PetscErrorCode SlepcInitialize(int*,char***,const char[],const char[]);
 89: SLEPC_EXTERN PetscErrorCode SlepcInitializeNoPointers(int,char**,const char[],const char[]);
 90: SLEPC_EXTERN PetscErrorCode SlepcInitializeNoArguments(void);
 91: SLEPC_EXTERN PetscErrorCode SlepcFinalize(void);
 92: SLEPC_EXTERN PetscErrorCode SlepcInitializeFortran(void);
 93: SLEPC_EXTERN PetscErrorCode SlepcInitialized(PetscBool*);
 94: SLEPC_EXTERN PetscErrorCode SlepcFinalized(PetscBool*);
 95: SLEPC_EXTERN PetscErrorCode SlepcGetVersion(char[],size_t);
 96: SLEPC_EXTERN PetscErrorCode SlepcGetVersionNumber(PetscInt*,PetscInt*,PetscInt*,PetscInt*);
 97: SLEPC_EXTERN PetscErrorCode SlepcHasExternalPackage(const char[],PetscBool*);

 99: SLEPC_EXTERN PetscErrorCode SlepcSNPrintfScalar(char*,size_t,PetscScalar,PetscBool);

101: SLEPC_EXTERN PetscBool SlepcInitializeCalled;
102: SLEPC_EXTERN PetscBool SlepcFinalizeCalled;

104: #if defined(PETSC_USE_COMPLEX)
105: #define SlepcLogFlopsComplex(a) PetscLogFlops((a))
106: #else
107: #define SlepcLogFlopsComplex(a) PetscLogFlops((4.0*a))
108: #endif

110: #if defined(PETSC_USE_COMPLEX)
111: #define SlepcLogGpuFlopsComplex(a) PetscLogGpuFlops((a))
112: #else
113: #define SlepcLogGpuFlopsComplex(a) PetscLogGpuFlops((4.0*a))
114: #endif

116: /*
117:     Developer routines to be used with a debugger
118: */
119: #if defined(PETSC_USE_DEBUG)
120: SLEPC_EXTERN PetscErrorCode SlepcDebugViewMatrix(PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscInt,const char*,const char*);
121: #endif