Actual source code: dlregissvd.c

slepc-3.7.0 2016-05-16
Report Typos and Errors
  1: /*
  2:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  3:    SLEPc - Scalable Library for Eigenvalue Problem Computations
  4:    Copyright (c) 2002-2016, 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;

 26: const char *SVDErrorTypes[] = {"ABSOLUTE","RELATIVE","SVDErrorType","SVD_ERROR_",0};
 27: const char *const SVDConvergedReasons_Shifted[] = {"","","DIVERGED_BREAKDOWN","DIVERGED_ITS","CONVERGED_ITERATING","CONVERGED_TOL","CONVERGED_USER","SVDConvergedReason","SVD_",0};
 28: const char *const*SVDConvergedReasons = SVDConvergedReasons_Shifted + 4;

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

 36:    Level: developer

 38: .seealso: SlepcFinalize()
 39: @*/
 40: PetscErrorCode SVDFinalizePackage(void)
 41: {

 45:   PetscFunctionListDestroy(&SVDList);
 46:   SVDPackageInitialized = PETSC_FALSE;
 47:   SVDRegisterAllCalled  = PETSC_FALSE;
 48:   return(0);
 49: }

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

 58:    Level: developer

 60: .seealso: SlepcInitialize()
 61: @*/
 62: PetscErrorCode SVDInitializePackage(void)
 63: {
 64:   char           logList[256];
 65:   char           *className;
 66:   PetscBool      opt;

 70:   if (SVDPackageInitialized) return(0);
 71:   SVDPackageInitialized = PETSC_TRUE;
 72:   /* Register Classes */
 73:   PetscClassIdRegister("SVD Solver",&SVD_CLASSID);
 74:   /* Register Constructors */
 75:   SVDRegisterAll();
 76:   /* Register Events */
 77:   PetscLogEventRegister("SVDSetUp",SVD_CLASSID,&SVD_SetUp);
 78:   PetscLogEventRegister("SVDSolve",SVD_CLASSID,&SVD_Solve);
 79:   /* Process info exclusions */
 80:   PetscOptionsGetString(NULL,NULL,"-info_exclude",logList,256,&opt);
 81:   if (opt) {
 82:     PetscStrstr(logList,"svd",&className);
 83:     if (className) {
 84:       PetscInfoDeactivateClass(SVD_CLASSID);
 85:     }
 86:   }
 87:   /* Process summary exclusions */
 88:   PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,256,&opt);
 89:   if (opt) {
 90:     PetscStrstr(logList,"svd",&className);
 91:     if (className) {
 92:       PetscLogEventDeactivateClass(SVD_CLASSID);
 93:     }
 94:   }
 95:   PetscRegisterFinalize(SVDFinalizePackage);
 96:   return(0);
 97: }

 99: #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)

103: /*
104:   PetscDLLibraryRegister - This function is called when the dynamic library
105:   it is in is opened.

107:   This one registers all the SVD methods that are in the basic SLEPc libslepcsvd
108:   library.
109:  */
110: PETSC_EXTERN PetscErrorCode PetscDLLibraryRegister_slepcsvd()
111: {

115:   SVDInitializePackage();
116:   return(0);
117: }
118: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */