LCOV - code coverage report
Current view: top level - svd/interface - dlregissvd.c (source / functions) Hit Total Coverage
Test: SLEPc Lines: 34 34 100.0 %
Date: 2024-03-29 00:34:52 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       3             :    SLEPc - Scalable Library for Eigenvalue Problem Computations
       4             :    Copyright (c) 2002-, Universitat Politecnica de Valencia, Spain
       5             : 
       6             :    This file is part of SLEPc.
       7             :    SLEPc is distributed under a 2-clause BSD license (see LICENSE).
       8             :    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       9             : */
      10             : 
      11             : #include <slepc/private/svdimpl.h>
      12             : 
      13             : static PetscBool SVDPackageInitialized = PETSC_FALSE;
      14             : 
      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 *SVDKSVDEigenMethods[] = {"","MRRR","DC","ELPA","SVDKSVDEigenMethod","SVD_KSVD_EIGEN_",NULL};
      19             : const char *SVDKSVDPolarMethods[] = {"","QDWH","ZOLOPD","SVDKSVDPolarMethod","SVD_KSVD_POLAR_",NULL};
      20             : const char *const SVDConvergedReasons_Shifted[] = {"","DIVERGED_SYMMETRY_LOST","DIVERGED_BREAKDOWN","DIVERGED_ITS","CONVERGED_ITERATING","CONVERGED_TOL","CONVERGED_USER","CONVERGED_MAXIT","SVDConvergedReason","SVD_",NULL};
      21             : const char *const*SVDConvergedReasons = SVDConvergedReasons_Shifted + 4;
      22             : 
      23             : /*@C
      24             :    SVDFinalizePackage - This function destroys everything in the Slepc interface
      25             :    to the SVD package. It is called from SlepcFinalize().
      26             : 
      27             :    Level: developer
      28             : 
      29             : .seealso: SlepcFinalize()
      30             : @*/
      31         201 : PetscErrorCode SVDFinalizePackage(void)
      32             : {
      33         201 :   PetscFunctionBegin;
      34         201 :   PetscCall(PetscFunctionListDestroy(&SVDList));
      35         201 :   PetscCall(PetscFunctionListDestroy(&SVDMonitorList));
      36         201 :   PetscCall(PetscFunctionListDestroy(&SVDMonitorCreateList));
      37         201 :   PetscCall(PetscFunctionListDestroy(&SVDMonitorDestroyList));
      38         201 :   SVDPackageInitialized       = PETSC_FALSE;
      39         201 :   SVDRegisterAllCalled        = PETSC_FALSE;
      40         201 :   SVDMonitorRegisterAllCalled = PETSC_FALSE;
      41         201 :   PetscFunctionReturn(PETSC_SUCCESS);
      42             : }
      43             : 
      44             : /*@C
      45             :    SVDInitializePackage - This function initializes everything in the SVD package.
      46             :    It is called from PetscDLLibraryRegister() when using dynamic libraries, and
      47             :    on the first call to SVDCreate() when using static libraries.
      48             : 
      49             :    Level: developer
      50             : 
      51             : .seealso: SlepcInitialize()
      52             : @*/
      53        3015 : PetscErrorCode SVDInitializePackage(void)
      54             : {
      55        3015 :   char           logList[256];
      56        3015 :   PetscBool      opt,pkg;
      57        3015 :   PetscClassId   classids[1];
      58             : 
      59        3015 :   PetscFunctionBegin;
      60        3015 :   if (SVDPackageInitialized) PetscFunctionReturn(PETSC_SUCCESS);
      61         201 :   SVDPackageInitialized = PETSC_TRUE;
      62             :   /* Register Classes */
      63         201 :   PetscCall(PetscClassIdRegister("SVD Solver",&SVD_CLASSID));
      64             :   /* Register Constructors */
      65         201 :   PetscCall(SVDRegisterAll());
      66             :   /* Register Monitors */
      67         201 :   PetscCall(SVDMonitorRegisterAll());
      68             :   /* Register Events */
      69         201 :   PetscCall(PetscLogEventRegister("SVDSetUp",SVD_CLASSID,&SVD_SetUp));
      70         201 :   PetscCall(PetscLogEventRegister("SVDSolve",SVD_CLASSID,&SVD_Solve));
      71             :   /* Process Info */
      72         201 :   classids[0] = SVD_CLASSID;
      73         201 :   PetscCall(PetscInfoProcessClass("svd",1,&classids[0]));
      74             :   /* Process summary exclusions */
      75         201 :   PetscCall(PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt));
      76         201 :   if (opt) {
      77           1 :     PetscCall(PetscStrInList("svd",logList,',',&pkg));
      78           1 :     if (pkg) PetscCall(PetscLogEventDeactivateClass(SVD_CLASSID));
      79             :   }
      80             :   /* Register package finalizer */
      81         201 :   PetscCall(PetscRegisterFinalize(SVDFinalizePackage));
      82         201 :   PetscFunctionReturn(PETSC_SUCCESS);
      83             : }
      84             : 
      85             : #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)
      86             : /*
      87             :   PetscDLLibraryRegister - This function is called when the dynamic library
      88             :   it is in is opened.
      89             : 
      90             :   This one registers all the SVD methods that are in the basic SLEPc libslepcsvd
      91             :   library.
      92             :  */
      93           1 : SLEPC_EXTERN PetscErrorCode PetscDLLibraryRegister_slepcsvd(void)
      94             : {
      95           1 :   PetscFunctionBegin;
      96           1 :   PetscCall(SVDInitializePackage());
      97           1 :   PetscFunctionReturn(PETSC_SUCCESS);
      98             : }
      99             : #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */

Generated by: LCOV version 1.14