Actual source code: jd.c

  1: /*
  2:   SLEPc eigensolver: "jd"

  4:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  5:    SLEPc - Scalable Library for Eigenvalue Problem Computations
  6:    Copyright (c) 2002-2012, 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: */

 24: #include <slepc-private/epsimpl.h>                /*I "slepceps.h" I*/
 25: #include <../src/eps/impls/davidson/common/davidson.h>

 27: PetscErrorCode EPSSetUp_JD(EPS eps);
 28: PetscErrorCode EPSDestroy_JD(EPS eps);

 30: EXTERN_C_BEGIN
 33: PetscErrorCode EPSSetFromOptions_JD(EPS eps)
 34: {
 36:   PetscBool      flg,op;
 37:   PetscInt       opi,opi0;
 38:   PetscReal      opf;
 39:   KSP            ksp;
 40:   EPSOrthType    orth;
 41:   const char     *orth_list[3] = {"I","B","B_opt"};

 44:   PetscOptionsHead("EPS Jacobi-Davidson (JD) Options");

 46:   EPSJDGetKrylovStart(eps,&op);
 47:   PetscOptionsBool("-eps_jd_krylov_start","Start the searching subspace with a krylov basis","EPSJDSetKrylovStart",op,&op,&flg);
 48:   if(flg) { EPSJDSetKrylovStart(eps,op); }
 49: 
 50:   EPSJDGetBlockSize(eps,&opi);
 51:   PetscOptionsInt("-eps_jd_blocksize","Number vectors add to the searching subspace","EPSJDSetBlockSize",opi,&opi,&flg);
 52:   if(flg) { EPSJDSetBlockSize(eps,opi); }

 54:   EPSJDGetRestart(eps,&opi,&opi0);
 55:   PetscOptionsInt("-eps_jd_minv","Set the size of the searching subspace after restarting","EPSJDSetRestart",opi,&opi,&flg);
 56:   if(flg) { EPSJDSetRestart(eps,opi,opi0); }

 58:   PetscOptionsInt("-eps_jd_plusk","Set the number of saved eigenvectors from the previous iteration when restarting","EPSJDSetRestart",opi0,&opi0,&flg);
 59:   if(flg) { EPSJDSetRestart(eps,opi,opi0); }

 61:   EPSJDGetInitialSize(eps,&opi);
 62:   PetscOptionsInt("-eps_jd_initial_size","Set the initial size of the searching subspace","EPSJDSetInitialSize",opi,&opi,&flg);
 63:   if(flg) { EPSJDSetInitialSize(eps,opi); }

 65:   EPSJDGetFix(eps,&opf);
 66:   PetscOptionsReal("-eps_jd_fix","Set the tolerance for changing the target in the correction equation","EPSJDSetFix",opf,&opf,&flg);
 67:   if(flg) { EPSJDSetFix(eps,opf); }

 69:    EPSJDGetBOrth(eps,&orth);
 70:   PetscOptionsEList("-eps_jd_borth","orthogonalization used in the search subspace","EPSJDSetBOrth",orth_list,3,orth_list[orth-1],&opi,&flg);
 71:   if (flg) {EPSJDSetBOrth(eps,(EPSOrthType)(opi+1));}
 72: 
 73:   EPSJDGetConstantCorrectionTolerance(eps,&op);
 74:   PetscOptionsBool("-eps_jd_constant_correction_tolerance","Disable the dynamic stopping criterion when solving the correction equation","EPSJDSetConstantCorrectionTolerance",op,&op,&flg);
 75:   if(flg) { EPSJDSetConstantCorrectionTolerance(eps,op); }

 77:   EPSJDGetWindowSizes(eps,&opi,&opi0);
 78:   PetscOptionsInt("-eps_jd_pwindow","(Experimental!) Set the number of converged vectors in the projector","EPSJDSetWindowSizes",opi,&opi,&flg);
 79:   if(flg) { EPSJDSetWindowSizes(eps,opi,opi0); }

 81:   PetscOptionsInt("-eps_jd_qwindow","(Experimental!) Set the number of converged vectors in the projected problem","EPSJDSetWindowSizes",opi0,&opi0,&flg);
 82:   if(flg) { EPSJDSetWindowSizes(eps,opi,opi0); }

 84:   PetscOptionsTail();

 86:   /* Set STPrecond as the default ST */
 87:   if (!((PetscObject)eps->OP)->type_name) {
 88:     STSetType(eps->OP,STPRECOND);
 89:   }
 90:   STPrecondSetKSPHasMat(eps->OP,PETSC_FALSE);

 92:   /* Set the default options of the KSP */
 93:   STGetKSP(eps->OP,&ksp);
 94:   if (!((PetscObject)ksp)->type_name) {
 95:     KSPSetType(ksp,KSPBCGSL);
 96:     KSPSetTolerances(ksp,1e-4,PETSC_DEFAULT,PETSC_DEFAULT,90);
 97:   }
 98: 
 99:   return(0);
100: }
101: EXTERN_C_END

105: PetscErrorCode EPSSetUp_JD(EPS eps)
106: {
108:   PetscBool      t;
109:   KSP            ksp;


113:   /* Setup common for all davidson solvers */
114:   EPSSetUp_Davidson(eps);

116:   /* Set the default options of the KSP */
117:   STGetKSP(eps->OP,&ksp);
118:   if (!((PetscObject)ksp)->type_name) {
119:     KSPSetType(ksp,KSPBCGSL);
120:     KSPSetTolerances(ksp,1e-4,PETSC_DEFAULT,PETSC_DEFAULT,90);
121:   }
122: 
123:   /* Check some constraints */
124:   PetscObjectTypeCompare((PetscObject)ksp,KSPPREONLY,&t);
125:   if (t) SETERRQ(((PetscObject)eps)->comm,PETSC_ERR_SUP,"EPSJD does not work with KSPPREONLY");
126:   return(0);
127: }

129: EXTERN_C_BEGIN
132: PetscErrorCode EPSCreate_JD(EPS eps)
133: {

137:   /* Load the Davidson solver */
138:   EPSCreate_Davidson(eps);
139:   EPSDavidsonSetMethod_Davidson(eps,DVD_METH_JD);

141:   /* Overload the JD properties */
142:   eps->ops->setfromoptions       = EPSSetFromOptions_JD;
143:   eps->ops->setup                = EPSSetUp_JD;
144:   eps->ops->destroy              = EPSDestroy_JD;

146:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDSetKrylovStart_C","EPSDavidsonSetKrylovStart_Davidson",EPSDavidsonSetKrylovStart_Davidson);
147:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDGetKrylovStart_C","EPSDavidsonGetKrylovStart_Davidson",EPSDavidsonGetKrylovStart_Davidson);
148:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDSetBlockSize_C","EPSDavidsonSetBlockSize_Davidson",EPSDavidsonSetBlockSize_Davidson);
149:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDGetBlockSize_C","EPSDavidsonGetBlockSize_Davidson",EPSDavidsonGetBlockSize_Davidson);
150:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDSetRestart_C","EPSDavidsonSetRestart_Davidson",EPSDavidsonSetRestart_Davidson);
151:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDGetRestart_C","EPSDavidsonGetRestart_Davidson",EPSDavidsonGetRestart_Davidson);
152:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDSetInitialSize_C","EPSDavidsonSetInitialSize_Davidson",EPSDavidsonSetInitialSize_Davidson);
153:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDGetInitialSize_C","EPSDavidsonGetInitialSize_Davidson",EPSDavidsonGetInitialSize_Davidson);
154:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDSetFix_C","EPSDavidsonSetFix_Davidson",EPSDavidsonSetFix_Davidson);
155:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDGetFix_C","EPSDavidsonGetFix_Davidson",EPSDavidsonGetFix_Davidson);
156:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDSetConstantCorrectionTolerance_C","EPSDavidsonSetConstantCorrectionTolerance_Davidson",EPSDavidsonSetConstantCorrectionTolerance_Davidson);
157:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDGetConstantCorrectionTolerance_C","EPSDavidsonGetConstantCorrectionTolerance_Davidson",EPSDavidsonGetConstantCorrectionTolerance_Davidson);
158:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDSetWindowSizes_C","EPSDavidsonSetWindowSizes_Davidson",EPSDavidsonSetWindowSizes_Davidson);
159:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDGetWindowSizes_C","EPSDavidsonGetWindowSizes_Davidson",EPSDavidsonGetWindowSizes_Davidson);
160:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDSetBOrth_C","EPSDavidsonSetBOrth_Davidson",EPSDavidsonSetBOrth_Davidson);
161:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDGetBOrth_C","EPSDavidsonGetBOrth_Davidson",EPSDavidsonGetBOrth_Davidson);
162:   return(0);
163: }
164: EXTERN_C_END

168: PetscErrorCode EPSDestroy_JD(EPS eps)
169: {
170:   PetscErrorCode  ierr;

173:   PetscFree(eps->data);
174:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDSetKrylovStart_C","",PETSC_NULL);
175:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDGetKrylovStart_C","",PETSC_NULL);
176:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDSetBlockSize_C","",PETSC_NULL);
177:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDGetBlockSize_C","",PETSC_NULL);
178:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDSetRestart_C","",PETSC_NULL);
179:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDGetRestart_C","",PETSC_NULL);
180:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDSetInitialSize_C","",PETSC_NULL);
181:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDGetInitialSize_C","",PETSC_NULL);
182:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDSetFix_C","",PETSC_NULL);
183:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDGetFix_C","",PETSC_NULL);
184:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDSetConstantCorrectionTolerance_C","",PETSC_NULL);
185:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDGetConstantCorrectionTolerance_C","",PETSC_NULL);
186:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDSetWindowSizes_C","",PETSC_NULL);
187:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDGetWindowSizes_C","",PETSC_NULL);
188:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDSetBOrth_C","",PETSC_NULL);
189:   PetscObjectComposeFunctionDynamic((PetscObject)eps,"EPSJDGetBOrth_C","",PETSC_NULL);
190:   return(0);
191: }

195: /*@
196:    EPSJDSetKrylovStart - Activates or deactivates starting the searching
197:    subspace with a Krylov basis. 

199:    Logically Collective on EPS

201:    Input Parameters:
202: +  eps - the eigenproblem solver context
203: -  krylovstart - boolean flag

205:    Options Database Key:
206: .  -eps_jd_krylov_start - Activates starting the searching subspace with a
207:     Krylov basis
208:    
209:    Level: advanced

211: .seealso: EPSJDGetKrylovStart()
212: @*/
213: PetscErrorCode EPSJDSetKrylovStart(EPS eps,PetscBool krylovstart)
214: {

220:   PetscTryMethod(eps,"EPSJDSetKrylovStart_C",(EPS,PetscBool),(eps,krylovstart));
221:   return(0);
222: }

226: /*@
227:    EPSJDGetKrylovStart - Returns a flag indicating if the searching subspace is started with a
228:    Krylov basis.

230:    Not Collective

232:    Input Parameter:
233: .  eps - the eigenproblem solver context

235:    Output Parameters:
236: .  krylovstart - boolean flag indicating if the searching subspace is started
237:    with a Krylov basis

239:    Level: advanced

241: .seealso: EPSJDGetKrylovStart()
242: @*/
243: PetscErrorCode EPSJDGetKrylovStart(EPS eps,PetscBool *krylovstart)
244: {

250:   PetscTryMethod(eps,"EPSJDGetKrylovStart_C",(EPS,PetscBool*),(eps,krylovstart));
251:   return(0);
252: }

256: /*@
257:    EPSJDSetBlockSize - Sets the number of vectors to be added to the searching space
258:    in every iteration.

260:    Logically Collective on EPS

262:    Input Parameters:
263: +  eps - the eigenproblem solver context
264: -  blocksize - number of vectors added to the search space in every iteration

266:    Options Database Key:
267: .  -eps_jd_blocksize - number of vectors added to the searching space every iteration
268:    
269:    Level: advanced

271: .seealso: EPSJDSetKrylovStart()
272: @*/
273: PetscErrorCode EPSJDSetBlockSize(EPS eps,PetscInt blocksize)
274: {

280:   PetscTryMethod(eps,"EPSJDSetBlockSize_C",(EPS,PetscInt),(eps,blocksize));
281:   return(0);
282: }

286: /*@
287:    EPSJDGetBlockSize - Returns the number of vectors to be added to the searching space
288:    in every iteration.

290:    Not Collective

292:    Input Parameter:
293: .  eps - the eigenproblem solver context

295:    Output Parameter:
296: .  blocksize - number of vectors added to the search space in every iteration

298:    Level: advanced

300: .seealso: EPSJDSetBlockSize()
301: @*/
302: PetscErrorCode EPSJDGetBlockSize(EPS eps,PetscInt *blocksize)
303: {

309:   PetscTryMethod(eps,"EPSJDGetBlockSize_C",(EPS,PetscInt*),(eps,blocksize));
310:   return(0);
311: }

315: /*@
316:    EPSJDGetRestart - Gets the number of vectors of the searching space after
317:    restarting and the number of vectors saved from the previous iteration.

319:    Not Collective

321:    Input Parameter:
322: .  eps - the eigenproblem solver context

324:    Output Parameter:
325: +  minv - number of vectors of the searching subspace after restarting
326: -  plusk - number of vectors saved from the previous iteration   

328:    Level: advanced

330: .seealso: EPSJDSetRestart()
331: @*/
332: PetscErrorCode EPSJDGetRestart(EPS eps,PetscInt *minv,PetscInt *plusk)
333: {

338:   PetscTryMethod(eps,"EPSJDGetRestart_C",(EPS,PetscInt*,PetscInt*),(eps,minv,plusk));
339:   return(0);
340: }

344: /*@
345:    EPSJDSetRestart - Sets the number of vectors of the searching space after
346:    restarting and the number of vectors saved from the previous iteration.

348:    Logically Collective on EPS

350:    Input Parameters:
351: +  eps - the eigenproblem solver context
352: .  minv - number of vectors of the searching subspace after restarting
353: -  plusk - number of vectors saved from the previous iteration   

355:    Options Database Keys:
356: +  -eps_jd_minv - number of vectors of the searching subspace after restarting
357: -  -eps_jd_plusk - number of vectors saved from the previous iteration   
358:    
359:    Level: advanced

361: .seealso: EPSJDGetRestart()
362: @*/
363: PetscErrorCode EPSJDSetRestart(EPS eps,PetscInt minv,PetscInt plusk)
364: {

371:   PetscTryMethod(eps,"EPSJDSetRestart_C",(EPS,PetscInt,PetscInt),(eps,minv,plusk));
372:   return(0);
373: }

377: /*@
378:    EPSJDGetInitialSize - Returns the initial size of the searching space.

380:    Not Collective

382:    Input Parameter:
383: .  eps - the eigenproblem solver context

385:    Output Parameter:
386: .  initialsize - number of vectors of the initial searching subspace

388:    Notes:
389:    If EPSJDGetKrylovStart() is PETSC_FALSE and the user provides vectors with
390:    EPSSetInitialSpace(), up to initialsize vectors will be used; and if the
391:    provided vectors are not enough, the solver completes the subspace with
392:    random vectors. In the case of EPSJDGetKrylovStart() being PETSC_TRUE, the solver
393:    gets the first vector provided by the user or, if not available, a random vector,
394:    and expands the Krylov basis up to initialsize vectors.

396:    Level: advanced

398: .seealso: EPSJDSetInitialSize(), EPSJDGetKrylovStart()
399: @*/
400: PetscErrorCode EPSJDGetInitialSize(EPS eps,PetscInt *initialsize)
401: {

407:   PetscTryMethod(eps,"EPSJDGetInitialSize_C",(EPS,PetscInt*),(eps,initialsize));
408:   return(0);
409: }

413: /*@
414:    EPSJDSetInitialSize - Sets the initial size of the searching space.

416:    Logically Collective on EPS

418:    Input Parameters:
419: +  eps - the eigenproblem solver context
420: -  initialsize - number of vectors of the initial searching subspace

422:    Options Database Key:
423: .  -eps_jd_initial_size - number of vectors of the initial searching subspace
424:    
425:    Notes:
426:    If EPSJDGetKrylovStart() is PETSC_FALSE and the user provides vectors with
427:    EPSSetInitialSpace(), up to initialsize vectors will be used; and if the
428:    provided vectors are not enough, the solver completes the subspace with
429:    random vectors. In the case of EPSJDGetKrylovStart() being PETSC_TRUE, the solver
430:    gets the first vector provided by the user or, if not available, a random vector,
431:    and expands the Krylov basis up to initialsize vectors.

433:    Level: advanced

435: .seealso: EPSJDGetInitialSize(), EPSJDGetKrylovStart()
436: @*/
437: PetscErrorCode EPSJDSetInitialSize(EPS eps,PetscInt initialsize)
438: {

444:   PetscTryMethod(eps,"EPSJDSetInitialSize_C",(EPS,PetscInt),(eps,initialsize));
445:   return(0);
446: }

450: /*@
451:    EPSJDGetFix - Returns the threshold for changing the target in the correction
452:    equation.

454:    Not Collective

456:    Input Parameter:
457: .  eps - the eigenproblem solver context

459:    Output Parameter:
460: .  fix - threshold for changing the target

462:    Note:
463:    The target in the correction equation is fixed at the first iterations.
464:    When the norm of the residual vector is lower than the fix value,
465:    the target is set to the corresponding eigenvalue.

467:    Level: advanced

469: .seealso: EPSJDSetFix()
470: @*/
471: PetscErrorCode EPSJDGetFix(EPS eps,PetscReal *fix)
472: {

478:   PetscTryMethod(eps,"EPSJDGetFix_C",(EPS,PetscReal*),(eps,fix));
479:   return(0);
480: }

484: /*@
485:    EPSJDSetFix - Sets the threshold for changing the target in the correction
486:    equation.

488:    Logically Collective on EPS

490:    Input Parameters:
491: +  eps - the eigenproblem solver context
492: -  fix - threshold for changing the target

494:    Options Database Key:
495: .  -eps_jd_fix - the fix value
496:    
497:    Note:
498:    The target in the correction equation is fixed at the first iterations.
499:    When the norm of the residual vector is lower than the fix value,
500:    the target is set to the corresponding eigenvalue.

502:    Level: advanced

504: .seealso: EPSJDGetFix()
505: @*/
506: PetscErrorCode EPSJDSetFix(EPS eps,PetscReal fix)
507: {

513:   PetscTryMethod(eps,"EPSJDSetFix_C",(EPS,PetscReal),(eps,fix));
514:   return(0);
515: }

519: /*@
520:    EPSJDSetConstantCorrectionTolerance - If true, deactivates the dynamic stopping criterion
521:    (also called Newton) that sets the KSP relative tolerance
522:    to 0.5**i, where i is the number of EPS iterations from the last converged value.

524:    Logically Collective on EPS

526:    Input Parameters:
527: +  eps - the eigenproblem solver context
528: -  constant - if false, the KSP relative tolerance is set to 0.5**i.

530:    Options Database Key:
531: .  -eps_jd_constant_correction_tolerance - Deactivates the dynamic stopping criterion.
532:    
533:    Level: advanced

535: .seealso: EPSJDGetConstantCorrectionTolerance()
536: @*/
537: PetscErrorCode EPSJDSetConstantCorrectionTolerance(EPS eps,PetscBool constant)
538: {

544:   PetscTryMethod(eps,"EPSJDSetConstantCorrectionTolerance_C",(EPS,PetscBool),(eps,constant));
545:   return(0);
546: }

550: /*@
551:    EPSJDGetConstantCorrectionTolerance - Returns a flag indicating if the dynamic stopping is being used for
552:    solving the correction equation. If the flag is false the KSP relative tolerance is set
553:    to 0.5**i, where i is the number of EPS iterations from the last converged value.

555:    Not Collective

557:    Input Parameter:
558: .  eps - the eigenproblem solver context

560:    Output Parameters:
561: .  constant - boolean flag indicating if the dynamic stopping criterion is not being used.

563:    Level: advanced

565: .seealso: EPSJDGetConstantCorrectionTolerance()
566: @*/
567: PetscErrorCode EPSJDGetConstantCorrectionTolerance(EPS eps,PetscBool *constant)
568: {

574:   PetscTryMethod(eps,"EPSJDGetConstantCorrectionTolerance",(EPS,PetscBool*),(eps,constant));
575:   return(0);
576: }

580: /*@
581:    EPSJDGetWindowSizes - Gets the number of converged vectors in the projected
582:    problem (or Rayleigh quotient) and in the projector employed in the correction
583:    equation.

585:    Not Collective

587:    Input Parameter:
588: .  eps - the eigenproblem solver context

590:    Output Parameter:
591: +  pwindow - number of converged vectors in the projector
592: -  qwindow - number of converged vectors in the projected problem

594:    Level: advanced

596: .seealso: EPSJDSetWindowSizes()
597: @*/
598: PetscErrorCode EPSJDGetWindowSizes(EPS eps,PetscInt *pwindow,PetscInt *qwindow)
599: {

604:   PetscTryMethod(eps,"EPSJDGetWindowSizes_C",(EPS,PetscInt*,PetscInt*),(eps,pwindow,qwindow));
605:   return(0);
606: }

610: /*@
611:    EPSJDSetWindowSizes - Sets the number of converged vectors in the projected
612:    problem (or Rayleigh quotient) and in the projector employed in the correction
613:    equation.

615:    Logically Collective on EPS

617:    Input Parameters:
618: +  eps - the eigenproblem solver context
619: .  pwindow - number of converged vectors in the projector
620: -  qwindow - number of converged vectors in the projected problem

622:    Options Database Keys:
623: +  -eps_jd_pwindow - set the number of converged vectors in the projector
624: -  -eps_jd_qwindow - set the number of converged vectors in the projected problem  
625:    
626:    Level: advanced

628: .seealso: EPSJDGetWindowSizes()
629: @*/
630: PetscErrorCode EPSJDSetWindowSizes(EPS eps,PetscInt pwindow,PetscInt qwindow)
631: {

638:   PetscTryMethod(eps,"EPSJDSetWindowSizes_C",(EPS,PetscInt,PetscInt),(eps,pwindow,qwindow));
639:   return(0);
640: }

644: /*@
645:    EPSJDSetBOrth - Selects the orthogonalization that will be used in the search
646:    subspace in case of generalized Hermitian problems.

648:    Logically Collective on EPS

650:    Input Parameters:
651: +  eps   - the eigenproblem solver context
652: -  borth - the kind of orthogonalization

654:    Possible values:
655:    The parameter 'borth' can have one of these values

657: +   EPS_ORTH_I - orthogonalization of the search subspace
658: .   EPS_ORTH_B - B-orthogonalization of the search subspace
659: -   EPS_ORTH_BOPT - B-orthogonalization of the search subspace with an alternative method

661:    Options Database Key:
662: .  -eps_jd_borth - Set the orthogonalization used in the search subspace

664:    Notes:
665:    If borth is EPS_ORTH_B, the solver uses a variant of Gram-Schmidt (selected in
666:    IP associated to the EPS) with the inner product defined by the matrix problem B.
667:    If borth is EPS_ORTH_BOPT, it uses another variant of Gram-Schmidt that only performs
668:    one matrix-vector product although more than one reorthogonalization would be done.
669:    
670:    Level: advanced

672: .seealso: EPSJDGetBOrth()
673: @*/
674: PetscErrorCode EPSJDSetBOrth(EPS eps,EPSOrthType borth)
675: {

681:   PetscTryMethod(eps,"EPSJDSetBOrth_C",(EPS,EPSOrthType),(eps,borth));
682:   return(0);
683: }

687: /*@
688:    EPSJDGetBOrth - Returns the orthogonalization used in the search
689:    subspace in case of generalized Hermitian problems.

691:    Not Collective

693:    Input Parameter:
694: .  eps - the eigenproblem solver context

696:    Output Parameters:
697: .  borth - the kind of orthogonalization

699:    Notes:
700:    See EPSJDSetBOrth() for possible values of 'borth'.

702:    Level: advanced

704: .seealso: EPSJDSetBOrth(), EPSOrthType
705: @*/
706: PetscErrorCode EPSJDGetBOrth(EPS eps,EPSOrthType *borth)
707: {

713:   PetscTryMethod(eps,"EPSJDGetBOrth_C",(EPS,EPSOrthType*),(eps,borth));
714:   return(0);
715: }