1: /*
2: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
3: SLEPc - Scalable Library for Eigenvalue Problem Computations
4: Copyright (c) 2002-2014, Universitat Politecnica de Valencia, Spain
6: This file is part of SLEPc.
8: SLEPc is free software: you can redistribute it and/or modify it under the
9: terms of version 3 of the GNU Lesser General Public License as published by
10: the Free Software Foundation.
12: SLEPc is distributed in the hope that it will be useful, but WITHOUT ANY
13: WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14: FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
15: more details.
17: You should have received a copy of the GNU Lesser General Public License
18: along with SLEPc. If not, see <http://www.gnu.org/licenses/>.
19: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
20: */
22: #include <slepc-private/svdimpl.h>
24: static PetscBool SVDPackageInitialized = PETSC_FALSE;
28: /*@C
29: SVDFinalizePackage - This function destroys everything in the Slepc interface
30: to the SVD package. It is called from SlepcFinalize().
32: Level: developer
34: .seealso: SlepcFinalize()
35: @*/
36: PetscErrorCode SVDFinalizePackage(void) 37: {
41: PetscFunctionListDestroy(&SVDList);
42: SVDPackageInitialized = PETSC_FALSE;
43: SVDRegisterAllCalled = PETSC_FALSE;
44: return(0);
45: }
49: /*@C
50: SVDInitializePackage - This function initializes everything in the SVD package. It is called
51: from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to SVDCreate()
52: when using static libraries.
54: Level: developer
56: .seealso: SlepcInitialize()
57: @*/
58: PetscErrorCode SVDInitializePackage(void) 59: {
60: char logList[256];
61: char *className;
62: PetscBool opt;
66: if (SVDPackageInitialized) return(0);
67: SVDPackageInitialized = PETSC_TRUE;
68: /* Register Classes */
69: PetscClassIdRegister("Singular Value Solver",&SVD_CLASSID);
70: /* Register Constructors */
71: SVDRegisterAll();
72: /* Register Events */
73: PetscLogEventRegister("SVDSetUp",SVD_CLASSID,&SVD_SetUp);
74: PetscLogEventRegister("SVDSolve",SVD_CLASSID,&SVD_Solve);
75: /* Process info exclusions */
76: PetscOptionsGetString(NULL,"-info_exclude",logList,256,&opt);
77: if (opt) {
78: PetscStrstr(logList,"svd",&className);
79: if (className) {
80: PetscInfoDeactivateClass(SVD_CLASSID);
81: }
82: }
83: /* Process summary exclusions */
84: PetscOptionsGetString(NULL,"-log_summary_exclude",logList,256,&opt);
85: if (opt) {
86: PetscStrstr(logList,"svd",&className);
87: if (className) {
88: PetscLogEventDeactivateClass(SVD_CLASSID);
89: }
90: }
91: PetscRegisterFinalize(SVDFinalizePackage);
92: return(0);
93: }
95: #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)
99: /*
100: PetscDLLibraryRegister - This function is called when the dynamic library
101: it is in is opened.
103: This one registers all the SVD methods that are in the basic SLEPc libslepcsvd
104: library.
105: */
106: PETSC_EXTERN PetscErrorCode PetscDLLibraryRegister_slepcsvd()107: {
111: SVDInitializePackage();
112: return(0);
113: }
114: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */