Actual source code: ipimpl.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: */
22: #if !defined(_IPIMPL)
23: #define _IPIMPL
25: #include <slepcip.h>
26: #include <slepc-private/slepcimpl.h>
28: PETSC_EXTERN PetscLogEvent IP_InnerProduct,IP_Orthogonalize,IP_ApplyMatrix;
30: typedef struct _IPOps *IPOps;
32: struct _IPOps {
33: PetscErrorCode (*normbegin)(IP,Vec,PetscReal*);
34: PetscErrorCode (*normend)(IP,Vec,PetscReal*);
35: PetscErrorCode (*innerproductbegin)(IP,Vec,Vec,PetscScalar*);
36: PetscErrorCode (*innerproductend)(IP,Vec,Vec,PetscScalar*);
37: PetscErrorCode (*minnerproductbegin)(IP,Vec,PetscInt,const Vec[],PetscScalar*);
38: PetscErrorCode (*minnerproductend)(IP,Vec,PetscInt,const Vec[],PetscScalar*);
39: };
41: struct _p_IP {
42: PETSCHEADER(struct _IPOps);
43: IPOrthogType orthog_type; /* which orthogonalization to use */
44: IPOrthogRefineType orthog_ref; /* refinement method */
45: PetscReal orthog_eta; /* refinement threshold */
46: Mat matrix;
47: PetscInt innerproducts;
48: PetscScalar *work;
49: PetscInt lwork;
51: /*------------------------- Cache Bx product -------------------*/
52: PetscInt xid;
53: PetscInt xstate;
54: Vec Bx;
55: };
57: PETSC_INTERN PetscErrorCode IPSetType_Default(IP);
58: PETSC_INTERN PetscErrorCode IPApplyMatrix_Private(IP,Vec);
59: PETSC_INTERN PetscErrorCode IPOrthogonalizeCGS1(IP,PetscInt,Vec*,PetscInt,PetscBool*,Vec*,Vec,PetscScalar*,PetscReal*,PetscReal*);
61: PETSC_INTERN PetscErrorCode IPOrthonormalizeBasis_Private(IP,PetscInt*,Vec**,Vec*);
63: #endif