Actual source code: slepcip.h

  1: /*
  2:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  3:    SLEPc - Scalable Library for Eigenvalue Problem Computations
  4:    Copyright (c) 2002-2013, 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: */

 24: #include <slepcvec.h>

 26: PETSC_EXTERN PetscErrorCode IPInitializePackage(void);
 27: /*S
 28:     IP - Abstraction of a vector inner product, that can be defined
 29:     in different ways. Using this object is not required for application
 30:     programmers.

 32:     Level: beginner

 34: .seealso: IPCreate()
 35: S*/
 36: typedef struct _p_IP* IP;

 38: /*J
 39:     IPType - String with the name of the inner product. For complex scalars,
 40:     it is possible to choose between a sesquilinear form (x,y)=x^H*M*y (the default)
 41:     or a bilinear form (x,y)=x^T*M*y (without complex conjugation). In the case
 42:     of real scalars, only the bilinear form (x,y)=x^T*M*y is available.
 43:     Apart form these, there is also an indefinite inner product, defined by
 44:     and indefinite matrix M.

 46:     Level: advanced

 48: .seealso: IPSetType(), IP
 49: J*/
 50: typedef const char* IPType;
 51: #define IPBILINEAR     "bilinear"
 52: #define IPSESQUILINEAR "sesquilinear"
 53: #define IPINDEFINITE   "indefinite"

 55: /* Logging support */
 56: PETSC_EXTERN PetscClassId IP_CLASSID;

 58: /*E
 59:     IPOrthogType - Determines what type of orthogonalization to use

 61:     Level: advanced

 63: .seealso: IPSetOrthogonalization(), IPGetOrthogonalization(), IPOrthogonalize()
 64: E*/
 65: typedef enum { IP_ORTHOG_MGS,
 66:                IP_ORTHOG_CGS } IPOrthogType;

 68: /*E
 69:     IPOrthogRefineType - Determines what type of refinement
 70:     to use during orthogonalization

 72:     Level: advanced

 74: .seealso: IPSetOrthogonalization(), IPGetOrthogonalization(), IPOrthogonalize()
 75: E*/
 76: typedef enum { IP_ORTHOG_REFINE_NEVER,
 77:                IP_ORTHOG_REFINE_IFNEEDED,
 78:                IP_ORTHOG_REFINE_ALWAYS } IPOrthogRefineType;

 80: PETSC_EXTERN PetscErrorCode IPCreate(MPI_Comm,IP*);
 81: PETSC_EXTERN PetscErrorCode IPSetType(IP,IPType);
 82: PETSC_EXTERN PetscErrorCode IPGetType(IP,IPType*);
 83: PETSC_EXTERN PetscErrorCode IPSetOptionsPrefix(IP,const char *);
 84: PETSC_EXTERN PetscErrorCode IPAppendOptionsPrefix(IP,const char *);
 85: PETSC_EXTERN PetscErrorCode IPGetOptionsPrefix(IP,const char *[]);
 86: PETSC_EXTERN PetscErrorCode IPSetFromOptions(IP);
 87: PETSC_EXTERN PetscErrorCode IPSetOrthogonalization(IP,IPOrthogType,IPOrthogRefineType,PetscReal);
 88: PETSC_EXTERN PetscErrorCode IPGetOrthogonalization(IP,IPOrthogType*,IPOrthogRefineType*,PetscReal*);
 89: PETSC_EXTERN PetscErrorCode IPView(IP,PetscViewer);
 90: PETSC_EXTERN PetscErrorCode IPDestroy(IP*);
 91: PETSC_EXTERN PetscErrorCode IPReset(IP);

 93: PETSC_EXTERN PetscErrorCode IPOrthogonalize(IP,PetscInt,Vec*,PetscInt,PetscBool*,Vec*,Vec,PetscScalar*,PetscReal*,PetscBool*);
 94: PETSC_EXTERN PetscErrorCode IPBOrthogonalize(IP,PetscInt,Vec*,Vec*,PetscReal*,PetscInt,PetscBool*,Vec*,Vec*,PetscReal*,Vec,Vec,PetscScalar*,PetscReal*,PetscBool*);
 95: PETSC_EXTERN PetscErrorCode IPBiOrthogonalize(IP,PetscInt,Vec*,Vec*,Vec,PetscScalar*,PetscReal*);
 96: PETSC_EXTERN PetscErrorCode IPPseudoOrthogonalize(IP,PetscInt,Vec*,PetscReal*,Vec,PetscScalar*,PetscReal*,PetscBool*);
 97: PETSC_EXTERN PetscErrorCode IPQRDecomposition(IP,Vec*,PetscInt,PetscInt,PetscScalar*,PetscInt);

 99: PETSC_EXTERN PetscErrorCode IPSetMatrix(IP,Mat);
100: PETSC_EXTERN PetscErrorCode IPGetMatrix(IP,Mat*);
101: PETSC_EXTERN PetscErrorCode IPApplyMatrix(IP,Vec,Vec);

103: PETSC_EXTERN PetscErrorCode IPInnerProduct(IP,Vec,Vec,PetscScalar*);
104: PETSC_EXTERN PetscErrorCode IPInnerProductBegin(IP,Vec,Vec,PetscScalar*);
105: PETSC_EXTERN PetscErrorCode IPInnerProductEnd(IP,Vec,Vec,PetscScalar*);
106: PETSC_EXTERN PetscErrorCode IPMInnerProduct(IP,Vec,PetscInt,const Vec[],PetscScalar*);
107: PETSC_EXTERN PetscErrorCode IPMInnerProductBegin(IP,Vec,PetscInt,const Vec[],PetscScalar*);
108: PETSC_EXTERN PetscErrorCode IPMInnerProductEnd(IP,Vec,PetscInt,const Vec[],PetscScalar*);
109: PETSC_EXTERN PetscErrorCode IPNorm(IP,Vec,PetscReal*);
110: PETSC_EXTERN PetscErrorCode IPNormBegin(IP,Vec,PetscReal*);
111: PETSC_EXTERN PetscErrorCode IPNormEnd(IP,Vec,PetscReal*);

113: PETSC_EXTERN PetscFunctionList IPList;
114: PETSC_EXTERN PetscBool         IPRegisterAllCalled;
115: PETSC_EXTERN PetscErrorCode IPRegisterAll(void);
116: PETSC_EXTERN PetscErrorCode IPRegister(const char[],PetscErrorCode(*)(IP));

118: PETSC_EXTERN PetscErrorCode IPGetOperationCounters(IP,PetscInt*);
119: PETSC_EXTERN PetscErrorCode IPResetOperationCounters(IP);

121: #endif