GCC Code Coverage Report


Directory: ./
File: src/svd/interface/dlregissvd.c
Date: 2026-02-22 03:58:10
Exec Total Coverage
Lines: 34 34 100.0%
Functions: 3 3 100.0%
Branches: 92 150 61.3%

Line Branch Exec Source
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: [](ch:svd), `SlepcFinalize()`, `SVDInitializePackage()`
30 @*/
31 1892 PetscErrorCode SVDFinalizePackage(void)
32 {
33
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
1892 PetscFunctionBegin;
34
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 6 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
1892 PetscCall(PetscFunctionListDestroy(&SVDList));
35
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 6 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
1892 PetscCall(PetscFunctionListDestroy(&SVDMonitorList));
36
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 6 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
1892 PetscCall(PetscFunctionListDestroy(&SVDMonitorCreateList));
37
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 6 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
1892 PetscCall(PetscFunctionListDestroy(&SVDMonitorDestroyList));
38 1892 SVDPackageInitialized = PETSC_FALSE;
39 1892 SVDRegisterAllCalled = PETSC_FALSE;
40 1892 SVDMonitorRegisterAllCalled = PETSC_FALSE;
41
6/12
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 2 times.
1892 PetscFunctionReturn(PETSC_SUCCESS);
42 }
43
44 /*@C
45 SVDInitializePackage - This function initializes everything in the `SVD` package.
46 It is called from `PetscDLLibraryRegister_slepcsvd()` when using dynamic libraries, and
47 on the first call to `SVDCreate()` when using shared or static libraries.
48
49 Note:
50 This function never needs to be called by SLEPc users.
51
52 Level: developer
53
54 .seealso: [](ch:svd), `SVD`, `SlepcInitialize()`, `SVDFinalizePackage()`
55 @*/
56 29289 PetscErrorCode SVDInitializePackage(void)
57 {
58 29289 char logList[256];
59 29289 PetscBool opt,pkg;
60 29289 PetscClassId classids[1];
61
62
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
29289 PetscFunctionBegin;
63
8/14
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 2 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✓ Branch 13 taken 2 times.
29289 if (SVDPackageInitialized) PetscFunctionReturn(PETSC_SUCCESS);
64 1892 SVDPackageInitialized = PETSC_TRUE;
65 /* Register Classes */
66
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 6 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
1892 PetscCall(PetscClassIdRegister("SVD Solver",&SVD_CLASSID));
67 /* Register Constructors */
68
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 6 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
1892 PetscCall(SVDRegisterAll());
69 /* Register Monitors */
70
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 6 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
1892 PetscCall(SVDMonitorRegisterAll());
71 /* Register Events */
72
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 6 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
1892 PetscCall(PetscLogEventRegister("SVDSetUp",SVD_CLASSID,&SVD_SetUp));
73
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 6 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
1892 PetscCall(PetscLogEventRegister("SVDSolve",SVD_CLASSID,&SVD_Solve));
74 /* Process Info */
75 1892 classids[0] = SVD_CLASSID;
76
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 6 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
1892 PetscCall(PetscInfoProcessClass("svd",1,&classids[0]));
77 /* Process summary exclusions */
78
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 6 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
1892 PetscCall(PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt));
79
2/2
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 8 times.
1892 if (opt) {
80
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 6 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
10 PetscCall(PetscStrInList("svd",logList,',',&pkg));
81
5/8
✓ Branch 0 taken 8 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 6 times.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 2 times.
10 if (pkg) PetscCall(PetscLogEventDeactivateClass(SVD_CLASSID));
82 }
83 /* Register package finalizer */
84
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 6 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
1892 PetscCall(PetscRegisterFinalize(SVDFinalizePackage));
85
6/12
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 2 times.
457 PetscFunctionReturn(PETSC_SUCCESS);
86 }
87
88 #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)
89 /*
90 PetscDLLibraryRegister - This function is called when the dynamic library
91 it is in is opened.
92
93 This one registers all the SVD methods that are in the basic SLEPc libslepcsvd
94 library.
95 */
96 8 SLEPC_EXTERN PetscErrorCode PetscDLLibraryRegister_slepcsvd(void)
97 {
98
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
8 PetscFunctionBegin;
99
4/6
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 6 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
8 PetscCall(SVDInitializePackage());
100
6/12
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 2 times.
2 PetscFunctionReturn(PETSC_SUCCESS);
101 }
102 #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */
103