Date: 2023-01-26T12:19:00+00:00

Actual source code: dlregissvd.c
slepc-3.18.2 2023-01-26
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: */

     11: #include <slepc/private/svdimpl.h>

     13: static PetscBool SVDPackageInitialized = PETSC_FALSE;

     15: const char *SVDTRLanczosGBidiags[] = {"SINGLE","UPPER","LOWER","SVDTRLanczosGBidiag","SVD_TRLANCZOS_GBIDIAG_",NULL};
     16: const char *SVDErrorTypes[] = {"ABSOLUTE","RELATIVE","SVDErrorType","SVD_ERROR_",NULL};
     17: const char *SVDPRIMMEMethods[] = {"","HYBRID","NORMALEQUATIONS","AUGMENTED","SVDPRIMMEMethod","SVD_PRIMME_",NULL};
     18: const char *const SVDConvergedReasons_Shifted[] = {"","","DIVERGED_BREAKDOWN","DIVERGED_ITS","CONVERGED_ITERATING","CONVERGED_TOL","CONVERGED_USER","CONVERGED_MAXIT","SVDConvergedReason","SVD_",NULL};
     19: const char *const*SVDConvergedReasons = SVDConvergedReasons_Shifted + 4;

     21: /*@C
     22:    SVDFinalizePackage - This function destroys everything in the Slepc interface
     23:    to the SVD package. It is called from SlepcFinalize().

     25:    Level: developer

     27: .seealso: SlepcFinalize()
     28: @*/
     29: PetscErrorCode SVDFinalizePackage(void)
     30: {
     31:   PetscFunctionListDestroy(&SVDList);
     32:   PetscFunctionListDestroy(&SVDMonitorList);
     33:   PetscFunctionListDestroy(&SVDMonitorCreateList);
     34:   PetscFunctionListDestroy(&SVDMonitorDestroyList);
     35:   SVDPackageInitialized       = PETSC_FALSE;
     36:   SVDRegisterAllCalled        = PETSC_FALSE;
     37:   SVDMonitorRegisterAllCalled = PETSC_FALSE;
     38:   return 0;
     39: }

     41: /*@C
     42:    SVDInitializePackage - This function initializes everything in the SVD package.
     43:    It is called from PetscDLLibraryRegister() when using dynamic libraries, and
     44:    on the first call to SVDCreate() when using static libraries.

     46:    Level: developer

     48: .seealso: SlepcInitialize()
     49: @*/
     50: PetscErrorCode SVDInitializePackage(void)
     51: {
     52:   char           logList[256];
     53:   PetscBool      opt,pkg;
     54:   PetscClassId   classids[1];

     56:   if (SVDPackageInitialized) return 0;
     57:   SVDPackageInitialized = PETSC_TRUE;
     58:   /* Register Classes */
     59:   PetscClassIdRegister("SVD Solver",&SVD_CLASSID);
     60:   /* Register Constructors */
     61:   SVDRegisterAll();
     62:   /* Register Monitors */
     63:   SVDMonitorRegisterAll();
     64:   /* Register Events */
     65:   PetscLogEventRegister("SVDSetUp",SVD_CLASSID,&SVD_SetUp);
     66:   PetscLogEventRegister("SVDSolve",SVD_CLASSID,&SVD_Solve);
     67:   /* Process Info */
     68:   classids[0] = SVD_CLASSID;
     69:   PetscInfoProcessClass("svd",1,&classids[0]);
     70:   /* Process summary exclusions */
     71:   PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt);
     72:   if (opt) {
     73:     PetscStrInList("svd",logList,',',&pkg);
     74:     if (pkg) PetscLogEventDeactivateClass(SVD_CLASSID);
     75:   }
     76:   /* Register package finalizer */
     77:   PetscRegisterFinalize(SVDFinalizePackage);
     78:   return 0;
     79: }

     81: #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)
     82: /*
     83:   PetscDLLibraryRegister - This function is called when the dynamic library
     84:   it is in is opened.

     86:   This one registers all the SVD methods that are in the basic SLEPc libslepcsvd
     87:   library.
     88:  */
     89: SLEPC_EXTERN PetscErrorCode PetscDLLibraryRegister_slepcsvd(void)
     90: {
     91:   SVDInitializePackage();
     92:   return 0;
     93: }
     94: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */