Date: 2026-03-31T13:22:58+00:00

Actual source code: slepcsys.h

      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:     Initialization of SLEPc and other system routines
     82: */
     83: SLEPC_EXTERN PetscErrorCode SlepcInitialize(int*,char***,const char[],const char[]);
     84: SLEPC_EXTERN PetscErrorCode SlepcInitializeNoPointers(int,char**,const char[],const char[]);
     85: SLEPC_EXTERN PetscErrorCode SlepcInitializeNoArguments(void);
     86: SLEPC_EXTERN PetscErrorCode SlepcFinalize(void);
     87: SLEPC_EXTERN PetscErrorCode SlepcInitializeFortran(void);
     88: SLEPC_EXTERN PetscErrorCode SlepcInitialized(PetscBool*);
     89: SLEPC_EXTERN PetscErrorCode SlepcFinalized(PetscBool*);
     90: SLEPC_EXTERN PetscErrorCode SlepcGetVersion(char[],size_t);
     91: SLEPC_EXTERN PetscErrorCode SlepcGetVersionNumber(PetscInt*,PetscInt*,PetscInt*,PetscInt*);
     92: SLEPC_EXTERN PetscErrorCode SlepcHasExternalPackage(const char[],PetscBool*);

     94: SLEPC_EXTERN PetscErrorCode SlepcSNPrintfScalar(char[],size_t,PetscScalar,PetscBool);

     96: SLEPC_EXTERN PetscBool SlepcInitializeCalled;
     97: SLEPC_EXTERN PetscBool SlepcFinalizeCalled;

     99: #if defined(PETSC_USE_COMPLEX)
    100: #define SlepcLogFlopsComplex(a) PetscLogFlops((a))
    101: #else
    102: #define SlepcLogFlopsComplex(a) PetscLogFlops((4.0*a))
    103: #endif

    105: #if defined(PETSC_USE_COMPLEX)
    106: #define SlepcLogGpuFlopsComplex(a) PetscLogGpuFlops((a))
    107: #else
    108: #define SlepcLogGpuFlopsComplex(a) PetscLogGpuFlops((4.0*a))
    109: #endif

    111: /*
    112:     Developer routines to be used with a debugger
    113: */
    114: #if defined(PETSC_USE_DEBUG)
    115: SLEPC_EXTERN PetscErrorCode SlepcDebugViewMatrix(PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscInt,const char*,const char*);
    116: #endif