Actual source code: slepcsvd.h

  1: /*
  2:    User interface for the SLEPC singular value solvers. 

  4:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  5:    SLEPc - Scalable Library for Eigenvalue Problem Computations
  6:    Copyright (c) 2002-2011, Universitat Politecnica de Valencia, Spain

  8:    This file is part of SLEPc.
  9:       
 10:    SLEPc is free software: you can redistribute it and/or modify it under  the
 11:    terms of version 3 of the GNU Lesser General Public License as published by
 12:    the Free Software Foundation.

 14:    SLEPc  is  distributed in the hope that it will be useful, but WITHOUT  ANY 
 15:    WARRANTY;  without even the implied warranty of MERCHANTABILITY or  FITNESS 
 16:    FOR  A  PARTICULAR PURPOSE. See the GNU Lesser General Public  License  for 
 17:    more details.

 19:    You  should have received a copy of the GNU Lesser General  Public  License
 20:    along with SLEPc. If not, see <http://www.gnu.org/licenses/>.
 21:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 22: */

 26:  #include slepcsys.h
 27:  #include slepceps.h


 32: /*S
 33:      SVD - Abstract SLEPc object that manages all the singular value 
 34:      problem solvers.

 36:    Level: beginner

 38: .seealso:  SVDCreate()
 39: S*/
 40: typedef struct _p_SVD* SVD;

 42: /*E
 43:     SVDType - String with the name of a SLEPc singular value solver

 45:    Level: beginner

 47: .seealso: SVDSetType(), SVD
 48: E*/
 49: #define SVDType        char*
 50: #define SVDCROSS       "cross"
 51: #define SVDCYCLIC      "cyclic"
 52: #define SVDLAPACK      "lapack"
 53: #define SVDLANCZOS     "lanczos"
 54: #define SVDTRLANCZOS   "trlanczos"

 56: /* Logging support */

 59: /*E
 60:     SVDTransposeMode - determines how to handle the transpose of the matrix

 62:     Level: advanced

 64: .seealso: SVDSetTransposeMode(), SVDGetTransposeMode()
 65: E*/
 66: typedef enum { SVD_TRANSPOSE_EXPLICIT,
 67:                SVD_TRANSPOSE_IMPLICIT } SVDTransposeMode;

 69: /*E
 70:     SVDWhich - determines whether largest or smallest singular triplets
 71:     are to be computed

 73:     Level: intermediate

 75: .seealso: SVDSetWhichSingularTriplets(), SVDGetWhichSingularTriplets()
 76: E*/
 77: typedef enum { SVD_LARGEST,
 78:                SVD_SMALLEST } SVDWhich;

 80: /*E
 81:     SVDConvergedReason - reason a singular value solver was said to 
 82:          have converged or diverged

 84:    Level: beginner

 86: .seealso: SVDSolve(), SVDGetConvergedReason(), SVDSetTolerances()
 87: E*/
 88: typedef enum {/* converged */
 89:               SVD_CONVERGED_TOL                =  2,
 90:               /* diverged */
 91:               SVD_DIVERGED_ITS                 = -3,
 92:               SVD_DIVERGED_BREAKDOWN           = -4,
 93:               SVD_CONVERGED_ITERATING          =  0 } SVDConvergedReason;










163: /*MC
164:    SVDRegisterDynamic - Adds a method to the singular value solver package.

166:    Synopsis:
167:    PetscErrorCode SVDRegisterDynamic(const char *name_solver,const char *path,const char *name_create,PetscErrorCode (*routine_create)(SVD))

169:    Not Collective

171:    Input Parameters:
172: +  name_solver - name of a new user-defined solver
173: .  path - path (either absolute or relative) the library containing this solver
174: .  name_create - name of routine to create the solver context
175: -  routine_create - routine to create the solver context

177:    Notes:
178:    SVDRegisterDynamic() may be called multiple times to add several user-defined solvers.

180:    If dynamic libraries are used, then the fourth input argument (routine_create)
181:    is ignored.

183:    Sample usage:
184: .vb
185:    SVDRegisterDynamic("my_solver",/home/username/my_lib/lib/libO/solaris/mylib.a,
186:                "MySolverCreate",MySolverCreate);
187: .ve

189:    Then, your solver can be chosen with the procedural interface via
190: $     SVDSetType(svd,"my_solver")
191:    or at runtime via the option
192: $     -svd_type my_solver

194:    Level: advanced

196: .seealso: SVDRegisterDestroy(), SVDRegisterAll()
197: M*/
198: #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
199: #define SVDRegisterDynamic(a,b,c,d) SVDRegister(a,b,c,0)
200: #else
201: #define SVDRegisterDynamic(a,b,c,d) SVDRegister(a,b,c,d)
202: #endif

205: #endif