Subversion Repositories slepc-dev

Rev

Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2762 Rev 2817
/*
/*
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   SLEPc - Scalable Library for Eigenvalue Problem Computations
   SLEPc - Scalable Library for Eigenvalue Problem Computations
   Copyright (c) 2002-2011, Universitat Politecnica de Valencia, Spain
   Copyright (c) 2002-2011, Universitat Politecnica de Valencia, Spain
 
 
   This file is part of SLEPc.
   This file is part of SLEPc.
     
     
   SLEPc is free software: you can redistribute it and/or modify it under  the
   SLEPc is free software: you can redistribute it and/or modify it under  the
   terms of version 3 of the GNU Lesser General Public License as published by
   terms of version 3 of the GNU Lesser General Public License as published by
   the Free Software Foundation.
   the Free Software Foundation.
 
 
   SLEPc  is  distributed in the hope that it will be useful, but WITHOUT  ANY
   SLEPc  is  distributed in the hope that it will be useful, but WITHOUT  ANY
   WARRANTY;  without even the implied warranty of MERCHANTABILITY or  FITNESS
   WARRANTY;  without even the implied warranty of MERCHANTABILITY or  FITNESS
   FOR  A  PARTICULAR PURPOSE. See the GNU Lesser General Public  License  for
   FOR  A  PARTICULAR PURPOSE. See the GNU Lesser General Public  License  for
   more details.
   more details.
 
 
   You  should have received a copy of the GNU Lesser General  Public  License
   You  should have received a copy of the GNU Lesser General  Public  License
   along with SLEPc. If not, see <http://www.gnu.org/licenses/>.
   along with SLEPc. If not, see <http://www.gnu.org/licenses/>.
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*/
*/
 
 
#include <slepc-private/slepcimpl.h>           /*I "slepcsys.h" I*/
#include <slepc-private/slepcimpl.h>           /*I "slepcsys.h" I*/
#include <slepc-private/epsimpl.h>
#include <slepc-private/epsimpl.h>
#include <slepc-private/stimpl.h>
#include <slepc-private/stimpl.h>
#include <slepc-private/svdimpl.h>
#include <slepc-private/svdimpl.h>
#include <slepc-private/qepimpl.h>
#include <slepc-private/qepimpl.h>
#include <slepc-private/ipimpl.h>
#include <slepc-private/ipimpl.h>
#include <slepc-private/psimpl.h>
#include <slepc-private/psimpl.h>
#include <slepc-private/vecimplslepc.h>
#include <slepc-private/vecimplslepc.h>
#include <stdlib.h>
#include <stdlib.h>
 
 
#undef __FUNCT__  
#undef __FUNCT__  
#define __FUNCT__ "SlepcPrintVersion"
#define __FUNCT__ "SlepcPrintVersion"
/*
/*
   SlepcPrintVersion - Prints SLEPc version info.
   SlepcPrintVersion - Prints SLEPc version info.
 
 
   Collective on MPI_Comm
   Collective on MPI_Comm
*/
*/
PetscErrorCode SlepcPrintVersion(MPI_Comm comm)
PetscErrorCode SlepcPrintVersion(MPI_Comm comm)
{
{
  PetscErrorCode ierr;
  PetscErrorCode ierr;
  char           version[256];
  char           version[256];
 
 
  PetscFunctionBegin;
  PetscFunctionBegin;
  ierr = SlepcGetVersion(version,256);CHKERRQ(ierr);
  ierr = SlepcGetVersion(version,256);CHKERRQ(ierr);
  ierr = (*PetscHelpPrintf)(comm,"--------------------------------------------------------------------------\n");CHKERRQ(ierr);
  ierr = (*PetscHelpPrintf)(comm,"--------------------------------------------------------------------------\n");CHKERRQ(ierr);
  ierr = (*PetscHelpPrintf)(comm,"%s\n",version);CHKERRQ(ierr);
  ierr = (*PetscHelpPrintf)(comm,"%s\n",version);CHKERRQ(ierr);
  ierr = (*PetscHelpPrintf)(comm,SLEPC_AUTHOR_INFO);CHKERRQ(ierr);
  ierr = (*PetscHelpPrintf)(comm,SLEPC_AUTHOR_INFO);CHKERRQ(ierr);
  ierr = (*PetscHelpPrintf)(comm,"See docs/manual.html for help.\n");CHKERRQ(ierr);
  ierr = (*PetscHelpPrintf)(comm,"See docs/manual.html for help.\n");CHKERRQ(ierr);
  ierr = (*PetscHelpPrintf)(comm,"SLEPc libraries linked from %s\n",SLEPC_LIB_DIR);CHKERRQ(ierr);
  ierr = (*PetscHelpPrintf)(comm,"SLEPc libraries linked from %s\n",SLEPC_LIB_DIR);CHKERRQ(ierr);
  PetscFunctionReturn(0);
  PetscFunctionReturn(0);
}
}
 
 
#undef __FUNCT__  
#undef __FUNCT__  
#define __FUNCT__ "SlepcPrintHelpIntro"
#define __FUNCT__ "SlepcPrintHelpIntro"
/*
/*
   SlepcPrintHelpIntro - Prints introductory SLEPc help info.
   SlepcPrintHelpIntro - Prints introductory SLEPc help info.
 
 
   Collective on MPI_Comm
   Collective on MPI_Comm
*/
*/
PetscErrorCode SlepcPrintHelpIntro(MPI_Comm comm)
PetscErrorCode SlepcPrintHelpIntro(MPI_Comm comm)
{
{
  PetscErrorCode  ierr;
  PetscErrorCode  ierr;
 
 
  PetscFunctionBegin;
  PetscFunctionBegin;
  ierr = (*PetscHelpPrintf)(comm,"SLEPc help information includes that for the PETSc libraries, which provide\n");CHKERRQ(ierr);
  ierr = (*PetscHelpPrintf)(comm,"SLEPc help information includes that for the PETSc libraries, which provide\n");CHKERRQ(ierr);
  ierr = (*PetscHelpPrintf)(comm,"low-level system infrastructure and linear algebra tools.\n");CHKERRQ(ierr);
  ierr = (*PetscHelpPrintf)(comm,"low-level system infrastructure and linear algebra tools.\n");CHKERRQ(ierr);
  ierr = (*PetscHelpPrintf)(comm,"--------------------------------------------------------------------------\n");CHKERRQ(ierr);
  ierr = (*PetscHelpPrintf)(comm,"--------------------------------------------------------------------------\n");CHKERRQ(ierr);
  PetscFunctionReturn(0);
  PetscFunctionReturn(0);
}
}
 
 
/* ------------------------Nasty global variables -------------------------------*/
/* ------------------------Nasty global variables -------------------------------*/
/*
/*
   Indicates whether SLEPc started PETSc, or whether it was
   Indicates whether SLEPc started PETSc, or whether it was
   already started before SLEPc was initialized.
   already started before SLEPc was initialized.
*/
*/
PetscBool SlepcBeganPetsc = PETSC_FALSE;
PetscBool SlepcBeganPetsc = PETSC_FALSE;
PetscBool SlepcInitializeCalled = PETSC_FALSE;
PetscBool SlepcInitializeCalled = PETSC_FALSE;
extern PetscLogEvent SLEPC_UpdateVectors,SLEPC_VecMAXPBY,SLEPC_SlepcDenseMatProd,SLEPC_SlepcDenseOrth,
extern PetscLogEvent SLEPC_UpdateVectors,SLEPC_VecMAXPBY,SLEPC_SlepcDenseMatProd,SLEPC_SlepcDenseOrth,
                     SLEPC_SlepcDenseMatInvProd,SLEPC_SlepcDenseNorm,SLEPC_SlepcDenseCopy,SLEPC_VecsMult;
                     SLEPC_SlepcDenseMatInvProd,SLEPC_SlepcDenseNorm,SLEPC_SlepcDenseCopy,SLEPC_VecsMult;
 
 
#if defined(PETSC_USE_DYNAMIC_LIBRARIES)
#if defined(PETSC_USE_DYNAMIC_LIBRARIES)
extern PetscDLLibrary DLLibrariesLoaded;
extern PetscDLLibrary DLLibrariesLoaded;
 
 
#undef __FUNCT__  
#undef __FUNCT__  
#define __FUNCT__ "SlepcInitialize_DynamicLibraries"
#define __FUNCT__ "SlepcInitialize_DynamicLibraries"
/*
/*
    SlepcInitialize_DynamicLibraries - Adds the default dynamic link libraries to the
    SlepcInitialize_DynamicLibraries - Adds the default dynamic link libraries to the
    search path.
    search path.
*/
*/
PetscErrorCode SlepcInitialize_DynamicLibraries(void)
PetscErrorCode SlepcInitialize_DynamicLibraries(void)
{
{
  PetscErrorCode ierr;
  PetscErrorCode ierr;
  PetscBool      found;
  PetscBool      found;
  char           libs[PETSC_MAX_PATH_LEN],dlib[PETSC_MAX_PATH_LEN];
  char           libs[PETSC_MAX_PATH_LEN],dlib[PETSC_MAX_PATH_LEN];
 
 
  PetscFunctionBegin;
  PetscFunctionBegin;
  ierr = PetscStrcpy(libs,SLEPC_LIB_DIR);CHKERRQ(ierr);
  ierr = PetscStrcpy(libs,SLEPC_LIB_DIR);CHKERRQ(ierr);
  ierr = PetscStrcat(libs,"/libslepc");CHKERRQ(ierr);
  ierr = PetscStrcat(libs,"/libslepc");CHKERRQ(ierr);
  ierr = PetscDLLibraryRetrieve(PETSC_COMM_WORLD,libs,dlib,1024,&found);CHKERRQ(ierr);
  ierr = PetscDLLibraryRetrieve(PETSC_COMM_WORLD,libs,dlib,1024,&found);CHKERRQ(ierr);
  if (found) {
  if (found) {
    ierr = PetscDLLibraryAppend(PETSC_COMM_WORLD,&DLLibrariesLoaded,libs);CHKERRQ(ierr);
    ierr = PetscDLLibraryAppend(PETSC_COMM_WORLD,&DLLibrariesLoaded,libs);CHKERRQ(ierr);
  } else SETERRQ(PETSC_COMM_SELF,PETSC_ERR_FILE_OPEN,"Unable to locate SLEPc dynamic library\n You cannot move the dynamic libraries!");
  } else SETERRQ(PETSC_COMM_SELF,PETSC_ERR_FILE_OPEN,"Unable to locate SLEPc dynamic library\n You cannot move the dynamic libraries!");
  PetscFunctionReturn(0);
  PetscFunctionReturn(0);
}
}
#endif
#endif
 
 
#undef __FUNCT__  
#undef __FUNCT__  
#define __FUNCT__ "SlepcInitialize_Packages"
#define __FUNCT__ "SlepcInitialize_Packages"
/*
/*
    SlepcInitialize_Packages - Initialize all SLEPc packages at the initialization.
    SlepcInitialize_Packages - Initialize all SLEPc packages at the initialization.
*/
*/
PetscErrorCode SlepcInitialize_Packages(void)
PetscErrorCode SlepcInitialize_Packages(void)
{
{
  PetscErrorCode ierr;
  PetscErrorCode ierr;
 
 
  PetscFunctionBegin;
  PetscFunctionBegin;
  ierr = STInitializePackage(PETSC_NULL);CHKERRQ(ierr);
  ierr = STInitializePackage(PETSC_NULL);CHKERRQ(ierr);
  ierr = EPSInitializePackage(PETSC_NULL);CHKERRQ(ierr);
  ierr = EPSInitializePackage(PETSC_NULL);CHKERRQ(ierr);
  ierr = SVDInitializePackage(PETSC_NULL);CHKERRQ(ierr);
  ierr = SVDInitializePackage(PETSC_NULL);CHKERRQ(ierr);
  ierr = QEPInitializePackage(PETSC_NULL);CHKERRQ(ierr);
  ierr = QEPInitializePackage(PETSC_NULL);CHKERRQ(ierr);
  ierr = IPInitializePackage(PETSC_NULL);CHKERRQ(ierr);
  ierr = IPInitializePackage(PETSC_NULL);CHKERRQ(ierr);
  ierr = PSInitializePackage(PETSC_NULL);CHKERRQ(ierr);
  ierr = PSInitializePackage(PETSC_NULL);CHKERRQ(ierr);
  /* New special type of Vec, implemented in SLEPc */
  /* New special type of Vec, implemented in SLEPc */
  ierr = VecRegister_Comp(PETSC_NULL);CHKERRQ(ierr);
  ierr = VecRegister_Comp(PETSC_NULL);CHKERRQ(ierr);
  PetscFunctionReturn(0);
  PetscFunctionReturn(0);
}
}
 
 
#undef __FUNCT__  
#undef __FUNCT__  
#define __FUNCT__ "SlepcInitialize_LogEvents"
#define __FUNCT__ "SlepcInitialize_LogEvents"
/*
/*
    SlepcInitialize_LogEvents - Initialize log events not pertaining to any object class.
    SlepcInitialize_LogEvents - Initialize log events not pertaining to any object class.
*/
*/
PetscErrorCode SlepcInitialize_LogEvents(void)
PetscErrorCode SlepcInitialize_LogEvents(void)
{
{
  PetscErrorCode ierr;
  PetscErrorCode ierr;
 
 
  PetscFunctionBegin;
  PetscFunctionBegin;
  ierr = PetscLogEventRegister("UpdateVectors",0,&SLEPC_UpdateVectors);CHKERRQ(ierr);
  ierr = PetscLogEventRegister("UpdateVectors",0,&SLEPC_UpdateVectors);CHKERRQ(ierr);
  ierr = PetscLogEventRegister("VecMAXPBY",0,&SLEPC_VecMAXPBY);CHKERRQ(ierr);
  ierr = PetscLogEventRegister("VecMAXPBY",0,&SLEPC_VecMAXPBY);CHKERRQ(ierr);
  ierr = PetscLogEventRegister("DenseMatProd",EPS_CLASSID,&SLEPC_SlepcDenseMatProd);CHKERRQ(ierr);
  ierr = PetscLogEventRegister("DenseMatProd",EPS_CLASSID,&SLEPC_SlepcDenseMatProd);CHKERRQ(ierr);
  ierr = PetscLogEventRegister("DenseOrth",EPS_CLASSID,&SLEPC_SlepcDenseOrth);CHKERRQ(ierr);
  ierr = PetscLogEventRegister("DenseOrth",EPS_CLASSID,&SLEPC_SlepcDenseOrth);CHKERRQ(ierr);
  ierr = PetscLogEventRegister("DenseMatNorm",EPS_CLASSID,&SLEPC_SlepcDenseNorm);CHKERRQ(ierr);
  ierr = PetscLogEventRegister("DenseMatNorm",EPS_CLASSID,&SLEPC_SlepcDenseNorm);CHKERRQ(ierr);
  ierr = PetscLogEventRegister("DenseCopy",EPS_CLASSID,&SLEPC_SlepcDenseCopy);CHKERRQ(ierr);
  ierr = PetscLogEventRegister("DenseCopy",EPS_CLASSID,&SLEPC_SlepcDenseCopy);CHKERRQ(ierr);
  ierr = PetscLogEventRegister("VecsMult",EPS_CLASSID,&SLEPC_VecsMult);CHKERRQ(ierr);
  ierr = PetscLogEventRegister("VecsMult",EPS_CLASSID,&SLEPC_VecsMult);CHKERRQ(ierr);
  PetscFunctionReturn(0);
  PetscFunctionReturn(0);
}
}
 
 
#undef __FUNCT__  
#undef __FUNCT__  
#define __FUNCT__ "SlepcInitialize"
#define __FUNCT__ "SlepcInitialize"
/*@C
/*@C
   SlepcInitialize - Initializes the SLEPc library. SlepcInitialize() calls
   SlepcInitialize - Initializes the SLEPc library. SlepcInitialize() calls
   PetscInitialize() if that has not been called yet, so this routine should
   PetscInitialize() if that has not been called yet, so this routine should
   always be called near the beginning of your program.
   always be called near the beginning of your program.
 
 
   Collective on MPI_COMM_WORLD or PETSC_COMM_WORLD if it has been set
   Collective on MPI_COMM_WORLD or PETSC_COMM_WORLD if it has been set
 
 
   Input Parameters:
   Input Parameters:
+  argc - count of number of command line arguments
+  argc - count of number of command line arguments
.  args - the command line arguments
.  args - the command line arguments
.  file - [optional] PETSc database file, defaults to ~username/.petscrc
.  file - [optional] PETSc database file, defaults to ~username/.petscrc
          (use PETSC_NULL for default)
          (use PETSC_NULL for default)
-  help - [optional] Help message to print, use PETSC_NULL for no message
-  help - [optional] Help message to print, use PETSC_NULL for no message
 
 
   Fortran Note:
   Fortran Note:
   Fortran syntax is very similar to that of PetscInitialize()
   Fortran syntax is very similar to that of PetscInitialize()
   
   
   Level: beginner
   Level: beginner
 
 
.seealso: SlepcFinalize(), PetscInitialize()
.seealso: SlepcFinalize(), PetscInitialize()
@*/
@*/
PetscErrorCode SlepcInitialize(int *argc,char ***args,const char file[],const char help[])
PetscErrorCode SlepcInitialize(int *argc,char ***args,const char file[],const char help[])
{
{
  PetscErrorCode ierr;
  PetscErrorCode ierr;
  PetscBool      flg;
  PetscBool      flg;
 
 
  PetscFunctionBegin;
  PetscFunctionBegin;
  if (SlepcInitializeCalled) {
  if (SlepcInitializeCalled) {
    PetscFunctionReturn(0);
    PetscFunctionReturn(0);
  }
  }
  ierr = PetscSetHelpVersionFunctions(SlepcPrintHelpIntro,SlepcPrintVersion);CHKERRQ(ierr);
  ierr = PetscSetHelpVersionFunctions(SlepcPrintHelpIntro,SlepcPrintVersion);CHKERRQ(ierr);
  ierr = PetscInitialized(&flg);CHKERRQ(ierr);
  ierr = PetscInitialized(&flg);CHKERRQ(ierr);
  if (!flg) {
  if (!flg) {
    ierr = PetscInitialize(argc,args,file,help);CHKERRQ(ierr);
    ierr = PetscInitialize(argc,args,file,help);CHKERRQ(ierr);
    SlepcBeganPetsc = PETSC_TRUE;
    SlepcBeganPetsc = PETSC_TRUE;
  }
  }
 
 
#if defined(PETSC_USE_DYNAMIC_LIBRARIES)
#if defined(PETSC_USE_DYNAMIC_LIBRARIES)
  ierr = SlepcInitialize_DynamicLibraries();CHKERRQ(ierr);
  ierr = SlepcInitialize_DynamicLibraries();CHKERRQ(ierr);
#else
#else
  ierr = SlepcInitialize_Packages();CHKERRQ(ierr);
  ierr = SlepcInitialize_Packages();CHKERRQ(ierr);
#endif
#endif
  ierr = SlepcInitialize_LogEvents();CHKERRQ(ierr);
  ierr = SlepcInitialize_LogEvents();CHKERRQ(ierr);
 
 
#if defined(PETSC_HAVE_DRAND48)
#if defined(PETSC_HAVE_DRAND48)
  /* work-around for Cygwin drand48() initialization bug */
  /* work-around for Cygwin drand48() initialization bug */
  srand48(0);
  srand48(0);
#endif
#endif
 
 
  SlepcInitializeCalled = PETSC_TRUE;
  SlepcInitializeCalled = PETSC_TRUE;
  ierr = PetscInfo(0,"SLEPc successfully started\n");CHKERRQ(ierr);
  ierr = PetscInfo(0,"SLEPc successfully started\n");CHKERRQ(ierr);
  PetscFunctionReturn(0);
  PetscFunctionReturn(0);
}
}
 
 
#undef __FUNCT__  
#undef __FUNCT__  
#define __FUNCT__ "SlepcFinalize"
#define __FUNCT__ "SlepcFinalize"
/*@
/*@
   SlepcFinalize - Checks for options to be called at the conclusion
   SlepcFinalize - Checks for options to be called at the conclusion
   of the SLEPc program and calls PetscFinalize().
   of the SLEPc program and calls PetscFinalize().
 
 
   Collective on PETSC_COMM_WORLD
   Collective on PETSC_COMM_WORLD
 
 
   Level: beginner
   Level: beginner
 
 
.seealso: SlepcInitialize(), PetscFinalize()
.seealso: SlepcInitialize(), PetscFinalize()
@*/
@*/
PetscErrorCode SlepcFinalize(void)
PetscErrorCode SlepcFinalize(void)
{
{
  PetscErrorCode ierr;
  PetscErrorCode ierr;
 
 
  PetscFunctionBegin;
  PetscFunctionBegin;
  ierr = PetscInfo(0,"SlepcFinalize() called\n");CHKERRQ(ierr);
  ierr = PetscInfo(0,"SlepcFinalize() called\n");CHKERRQ(ierr);
  if (SlepcBeganPetsc) {
  if (SlepcBeganPetsc) {
    ierr = PetscFinalize();CHKERRQ(ierr);
    ierr = PetscFinalize();CHKERRQ(ierr);
  }
  }
  SlepcInitializeCalled = PETSC_FALSE;
  SlepcInitializeCalled = PETSC_FALSE;
  PetscFunctionReturn(0);
  PetscFunctionReturn(0);
}
}
 
 
#undef __FUNCT__  
#undef __FUNCT__  
#define __FUNCT__ "SlepcInitialized"
#define __FUNCT__ "SlepcInitialized"
/*@
/*@
   SlepcInitialized - Determine whether SLEPc is initialized.
   SlepcInitialized - Determine whether SLEPc is initialized.
 
 
   Level: beginner
   Level: beginner
 
 
.seealso: SlepcInitialize(), SlepcInitializeFortran()
.seealso: SlepcInitialize(), SlepcInitializeFortran()
@*/
@*/
PetscErrorCode SlepcInitialized(PetscBool *isInitialized)
PetscErrorCode SlepcInitialized(PetscBool *isInitialized)
{
{
  PetscFunctionBegin;
  PetscFunctionBegin;
  PetscValidPointer(isInitialized,1);
  PetscValidPointer(isInitialized,1);
  *isInitialized = SlepcInitializeCalled;
  *isInitialized = SlepcInitializeCalled;
  PetscFunctionReturn(0);
  PetscFunctionReturn(0);
}
}
 
 
#if defined(PETSC_HAVE_MATLAB_ENGINE)
#if defined(PETSC_HAVE_MATLAB_ENGINE)
extern PetscBool PetscBeganMPI;
extern PetscBool PetscBeganMPI;
 
 
#undef __FUNCT__  
#undef __FUNCT__  
#define __FUNCT__ "SlepcInitializeMatlab"
#define __FUNCT__ "SlepcInitializeNoPointers"
/*
/*
   SlepcInitializeMatlab - Calls SlepcInitialize() from MATLAB (analogue to
   SlepcInitializeNoPointers - Calls SlepcInitialize() from C/C++ without the pointers
   PetscInitializeMatlab).
   to argc and args (analogue to PetscInitializeNoPointers).
 
 
   Collective
   Collective
 
 
   Level: advanced
   Level: advanced
 
 
.seealso: SlepcInitialize()
.seealso: SlepcInitialize()
*/
*/
PetscErrorCode SlepcInitializeMatlab(int argc,char **args,const char *filename,const char *help)
PetscErrorCode SlepcInitializeNoPointers(int argc,char **args,const char *filename,const char *help)
{
{
  PetscErrorCode ierr;
  PetscErrorCode ierr;
  int            myargc = argc;
  int            myargc = argc;
  char           **myargs = args;
  char           **myargs = args;
 
 
  PetscFunctionBegin;
  PetscFunctionBegin;
  ierr = SlepcInitialize(&myargc,&myargs,filename,help);
  ierr = SlepcInitialize(&myargc,&myargs,filename,help);
  ierr = PetscPopSignalHandler();CHKERRQ(ierr);
  ierr = PetscPopSignalHandler();CHKERRQ(ierr);
  PetscBeganMPI = PETSC_FALSE;
  PetscBeganMPI = PETSC_FALSE;
  PetscFunctionReturn(ierr);
  PetscFunctionReturn(ierr);
}
 
 
 
#undef __FUNCT__  
 
#define __FUNCT__ "SlepcInitializedMatlab"
 
/*
 
   SlepcInitializedMatlab - Has SLEPc been initialized already?
 
 
 
   Not Collective
 
 
 
   Level: advanced
 
 
 
   Notes: this is called only by the SLEPc MATLAB interface.
 
 
 
.seealso: SlepcInitialize()
 
*/
 
int SlepcInitializedMatlab(void)
 
{
 
  PetscBool flg;
 
 
 
  SlepcInitialized(&flg);
 
  if (flg) return 1;
 
  else return 0;
 
}
}
#endif
#endif
 
 
#ifdef PETSC_USE_DYNAMIC_LIBRARIES
#ifdef PETSC_USE_DYNAMIC_LIBRARIES
EXTERN_C_BEGIN
EXTERN_C_BEGIN
#undef __FUNCT__  
#undef __FUNCT__  
#define __FUNCT__ "PetscDLLibraryRegister_slepc"
#define __FUNCT__ "PetscDLLibraryRegister_slepc"
/*
/*
  PetscDLLibraryRegister - This function is called when the dynamic library
  PetscDLLibraryRegister - This function is called when the dynamic library
  it is in is opened.
  it is in is opened.
 
 
  This one registers all the EPS and ST methods in the libslepc.a
  This one registers all the EPS and ST methods in the libslepc.a
  library.
  library.
 
 
  Input Parameter:
  Input Parameter:
  path - library path
  path - library path
 */
 */
PetscErrorCode PetscDLLibraryRegister_slepc(char *path)
PetscErrorCode PetscDLLibraryRegister_slepc(char *path)
{
{
  PetscErrorCode ierr;
  PetscErrorCode ierr;
 
 
  ierr = PetscInitializeNoArguments(); if (ierr) return 1;
  ierr = PetscInitializeNoArguments(); if (ierr) return 1;
 
 
  PetscFunctionBegin;
  PetscFunctionBegin;
  /*
  /*
      If we got here then PETSc was properly loaded
      If we got here then PETSc was properly loaded
  */
  */
  ierr = SlepcInitialize_Packages();CHKERRQ(ierr);
  ierr = SlepcInitialize_Packages();CHKERRQ(ierr);
  PetscFunctionReturn(0);
  PetscFunctionReturn(0);
}
}
EXTERN_C_END
EXTERN_C_END
#endif /* PETSC_USE_DYNAMIC_LIBRARIES */
#endif /* PETSC_USE_DYNAMIC_LIBRARIES */