Actual source code: krylovschur.h
1: /*
3: Private header for Krylov-Schur.
5: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
6: SLEPc - Scalable Library for Eigenvalue Problem Computations
7: Copyright (c) 2002-2012, Universitat Politecnica de Valencia, Spain
9: This file is part of SLEPc.
10:
11: SLEPc is free software: you can redistribute it and/or modify it under the
12: terms of version 3 of the GNU Lesser General Public License as published by
13: the Free Software Foundation.
15: SLEPc is distributed in the hope that it will be useful, but WITHOUT ANY
16: WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17: FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
18: more details.
20: You should have received a copy of the GNU Lesser General Public License
21: along with SLEPc. If not, see <http://www.gnu.org/licenses/>.
22: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
23: */
28: extern PetscErrorCode EPSSolve_KrylovSchur_Default(EPS);
29: extern PetscErrorCode EPSSolve_KrylovSchur_Symm(EPS);
30: extern PetscErrorCode EPSSolve_KrylovSchur_Slice(EPS);
31: extern PetscErrorCode EPSSolve_KrylovSchur_Indefinite(EPS);
32: extern PetscErrorCode EPSGetArbitraryValues(EPS,PetscScalar*,PetscScalar*);
34: /* Structure characterizing a shift in spectrum slicing */
35: typedef struct _n_shift *shift;
36: struct _n_shift {
37: PetscReal value;
38: PetscInt inertia;
39: PetscBool comp[2]; /* Shows completion of subintervals (left and right) */
40: shift neighb[2]; /* Adjacent shifts */
41: PetscInt index; /* Index in eig where found values are stored */
42: PetscInt neigs; /* Number of values found */
43: PetscReal ext[2]; /* Limits for accepted values */
44: PetscInt nsch[2]; /* Number of missing values for each subinterval */
45: PetscInt nconv[2]; /* Converged on each side (accepted or not) */
46: };
48: /* Structure for storing the state of spectrum slicing */
49: struct _n_SR {
50: PetscReal int0,int1; /* Extremes of the interval */
51: PetscInt dir; /* Determines the order of values in eig (+1 incr, -1 decr) */
52: PetscBool hasEnd; /* Tells whether the interval has an end */
53: PetscInt inertia0,inertia1;
54: Vec *V;
55: PetscScalar *eig,*eigi,*monit,*back;
56: PetscReal *errest;
57: PetscInt *perm; /* Permutation for keeping the eigenvalues in order */
58: PetscInt numEigs; /* Number of eigenvalues in the interval */
59: PetscInt indexEig;
60: shift sPres; /* Present shift */
61: shift *pending; /* Pending shifts array */
62: PetscInt nPend; /* Number of pending shifts */
63: PetscInt maxPend; /* Size of "pending" array */
64: Vec *VDef; /* Vector for deflation */
65: PetscInt *idxDef; /* For deflation */
66: PetscInt nMAXCompl;
67: PetscInt iterCompl;
68: PetscInt itsKs; /* Krylovschur restarts */
69: PetscInt nleap;
70: shift s0; /* Initial shift */
71: PetscScalar *S; /* Matrix for projected problem */
72: PetscInt nS;
73: PetscReal beta;
74: shift sPrev;
75: };
76: typedef struct _n_SR *SR;
78: typedef struct {
79: PetscReal keep;
80: SR sr;
81: } EPS_KRYLOVSCHUR;
83: #endif