Actual source code: pepkrylov.h

slepc-3.9.0 2018-04-12
Report Typos and Errors
  1: /*
  2:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  3:    SLEPc - Scalable Library for Eigenvalue Problem Computations
  4:    Copyright (c) 2002-2018, Universitat Politecnica de Valencia, Spain

  6:    This file is part of SLEPc.
  7:    SLEPc is distributed under a 2-clause BSD license (see LICENSE).
  8:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9: */
 10: /*
 11:    Private header for TOAR and STOAR
 12: */


 17: PETSC_INTERN PetscErrorCode PEPExtractVectors_TOAR(PEP);
 18: PETSC_INTERN PetscErrorCode MatMult_Func(Mat,Vec,Vec);
 19: PETSC_INTERN PetscErrorCode MatDestroy_Func(Mat);
 20: PETSC_INTERN PetscErrorCode PEPSolve_STOAR(PEP);
 21: PETSC_INTERN PetscErrorCode PEPSolve_STOAR_QSlice(PEP);
 22: PETSC_INTERN PetscErrorCode PEPSetUp_STOAR_QSlice(PEP);
 23: PETSC_INTERN PetscErrorCode PEPReset_STOAR_QSlice(PEP);

 25: /* Structure characterizing a shift in spectrum slicing */
 26: typedef struct _n_shift *PEP_shift;
 27: struct _n_shift {
 28:   PetscReal     value;
 29:   PetscInt      inertia;
 30:   PetscBool     comp[2];      /* Shows completion of subintervals (left and right) */
 31:   PEP_shift     neighb[2];    /* Adjacent shifts */
 32:   PetscInt      index;        /* Index in eig where found values are stored */
 33:   PetscInt      neigs;        /* Number of values found */
 34:   PetscReal     ext[2];       /* Limits for accepted values */
 35:   PetscInt      nsch[2];      /* Number of missing values for each subinterval */
 36:   PetscInt      nconv[2];     /* Converged on each side (accepted or not) */
 37: };

 39: /* Identifies the TOAR vectors for each Pseudo-Lanczos vector in the global array */
 40: typedef struct {
 41:   PetscInt nq;
 42:   PetscInt *q;
 43: } PEP_QInfo;

 45: /* Structure for storing the state of spectrum slicing */
 46: struct _n_SR {
 47:   PetscReal     int0,int1;         /* Extremes of the interval */
 48:   PetscInt      dir;               /* Determines the order of values in eig (+1 incr, -1 decr) */
 49:   PetscBool     hasEnd;            /* Tells whether the interval has an end */
 50:   PetscInt      inertia0,inertia1;
 51:   PetscScalar   *back;
 52:   PetscInt      numEigs;           /* Number of eigenvalues in the interval */
 53:   PetscInt      indexEig;
 54:   PEP_shift     sPres;             /* Present shift */
 55:   PEP_shift     *pending;          /* Pending shifts array */
 56:   PetscInt      nPend;             /* Number of pending shifts */
 57:   PetscInt      maxPend;           /* Size of "pending" array */
 58:   PetscInt      *idxDef0,*idxDef1; /* For deflation */
 59:   PetscInt      ndef0,ndef1;       /* Index in deflation arrays */
 60:   PetscInt      nMAXCompl;
 61:   PetscInt      iterCompl;
 62:   PetscInt      itsKs;             /* Krylovschur restarts */
 63:   PetscInt      nleap;
 64:   PEP_shift     s0;                /* Initial shift */
 65:   PEP_shift     sPrev;
 66:   PetscInt      nv;                /* position of restart vector */
 67:   BV            V;                 /* full TOAR basis */
 68:   PetscScalar   *S;                /* TOAR coefficients */
 69:   PetscInt      ld;                /* Leading dimension for each block of S */
 70:   BV            Vnext;             /* temporary working basis during change of shift */
 71:   PetscScalar   *eigr,*eigi;       /* eigenvalues */
 72:   PetscReal     *errest;           /* error estimates */
 73:   PetscInt      *perm;             /* permutation */
 74:   PEP_QInfo     *qinfo;            /* TOAR vectors for each pseudo-Lanczos vector */
 75:   PetscInt      intcorr;           /* Global inertia correction */
 76:   Vec           v[3];
 77:   EPS           eps;
 78: };
 79: typedef struct _n_SR *PEP_SR;

 81: typedef struct {
 82:   PetscReal   keep;      /* restart parameter */
 83:   PetscBool   lock;      /* locking/non-locking variant */
 84:   BV          V;         /* tensor basis vectors object for the linearization */
 85:   PEP_SR      sr;        /* spectrum slicing context */
 86:   PetscReal   *shifts;   /* array containing global shifts */
 87:   PetscInt    *inertias; /* array containing global inertias */
 88:   PetscInt    nshifts;   /* elements in the arrays of shifts and inertias */
 89:   PetscInt    nev;       /* number of eigenvalues to compute */
 90:   PetscInt    ncv;       /* number of basis vectors */
 91:   PetscInt    mpd;       /* maximum dimension of projected problem */
 92:   PetscBool   detect;    /* check for zeros during factorizations */
 93:   PetscBool   hyperbolic;/* hyperbolic problem flag */
 94: } PEP_TOAR;

 96: typedef struct {
 97:   PetscScalar scal;
 98:   Mat         A;
 99: } ShellMatCtx;
100: #endif