Date: 2024-09-25T09:34:02+00:00

Actual source code: zpepf.c
slepc-3.21.2 2024-09-25
Report Typos and Errors

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

     11: #include <petsc/private/fortranimpl.h>
     12: #include <slepcpep.h>

     14: #if defined(PETSC_HAVE_FORTRAN_CAPS)
     15: #define pepdestroy_                       PEPDESTROY
     16: #define pepview_                          PEPVIEW
     17: #define pepviewfromoptions_               PEPVIEWFROMOPTIONS
     18: #define peperrorview_                     PEPERRORVIEW
     19: #define pepconvergedreasonview_           PEPCONVERGEDREASONVIEW
     20: #define pepvaluesview_                    PEPVALUESVIEW
     21: #define pepvectorsview_                   PEPVECTORSVIEW
     22: #define pepsetoptionsprefix_              PEPSETOPTIONSPREFIX
     23: #define pepappendoptionsprefix_           PEPAPPENDOPTIONSPREFIX
     24: #define pepgetoptionsprefix_              PEPGETOPTIONSPREFIX
     25: #define pepsettype_                       PEPSETTYPE
     26: #define pepgettype_                       PEPGETTYPE
     27: #define pepmonitorset_                    PEPMONITORSET
     28: #define pepmonitorall_                    PEPMONITORALL
     29: #define pepmonitorfirst_                  PEPMONITORFIRST
     30: #define pepmonitorconverged_              PEPMONITORCONVERGED
     31: #define pepmonitorconvergedcreate_        PEPMONITORCONVERGEDCREATE
     32: #define pepmonitorconvergeddestroy_       PEPMONITORCONVERGEDDESTROY
     33: #define pepconvergedabsolute_             PEPCONVERGEDABSOLUTE
     34: #define pepconvergedrelative_             PEPCONVERGEDRELATIVE
     35: #define pepsetconvergencetestfunction_    PEPSETCONVERGENCETESTFUNCTION
     36: #define pepsetstoppingtestfunction_       PEPSETSTOPPINGTESTFUNCTION
     37: #define pepseteigenvaluecomparison_       PEPSETEIGENVALUECOMPARISON
     38: #define pepgetdimensions000_              PEPGETDIMENSIONS000
     39: #define pepgetdimensions100_              PEPGETDIMENSIONS100
     40: #define pepgetdimensions010_              PEPGETDIMENSIONS010
     41: #define pepgetdimensions001_              PEPGETDIMENSIONS001
     42: #define pepgetdimensions110_              PEPGETDIMENSIONS110
     43: #define pepgetdimensions011_              PEPGETDIMENSIONS011
     44: #define pepgetdimensions101_              PEPGETDIMENSIONS101
     45: #define pepgeteigenpair00_                PEPGETEIGENPAIR00
     46: #define pepgeteigenpair10_                PEPGETEIGENPAIR10
     47: #define pepgeteigenpair01_                PEPGETEIGENPAIR01
     48: #define pepgeteigenpair11_                PEPGETEIGENPAIR11
     49: #define pepgettolerances00_               PEPGETTOLERANCES00
     50: #define pepgettolerances10_               PEPGETTOLERANCES10
     51: #define pepgettolerances01_               PEPGETTOLERANCES01
     52: #define pepgetscale000_                   PEPGETSCALE000
     53: #define pepgetscale100_                   PEPGETSCALE100
     54: #define pepgetscale010_                   PEPGETSCALE010
     55: #define pepgetscale001_                   PEPGETSCALE001
     56: #define pepgetscale110_                   PEPGETSCALE110
     57: #define pepgetscale011_                   PEPGETSCALE011
     58: #define pepgetscale101_                   PEPGETSCALE101
     59: #define pepgetscale111_                   PEPGETSCALE111
     60: #define pepgetrefine000_                  PEPGETREFINE000
     61: #define pepgetrefine100_                  PEPGETREFINE100
     62: #define pepgetrefine010_                  PEPGETREFINE010
     63: #define pepgetrefine001_                  PEPGETREFINE001
     64: #define pepgetrefine110_                  PEPGETREFINE110
     65: #define pepgetrefine011_                  PEPGETREFINE011
     66: #define pepgetrefine101_                  PEPGETREFINE101
     67: #define pepgetrefine111_                  PEPGETREFINE111
     68: #define pepsetinitialspace0_              PEPSETINITIALSPACE0
     69: #define pepsetinitialspace1_              PEPSETINITIALSPACE1
     70: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
     71: #define pepdestroy_                       pepdestroy
     72: #define pepview_                          pepview
     73: #define pepviewfromoptions_               pepviewfromoptions
     74: #define peperrorview_                     peperrorview
     75: #define pepconvergedreasonview_           pepconvergedreasonview
     76: #define pepvaluesview_                    pepvaluesview
     77: #define pepvectorsview_                   pepvectorsview
     78: #define pepsetoptionsprefix_              pepsetoptionsprefix
     79: #define pepappendoptionsprefix_           pepappendoptionsprefix
     80: #define pepgetoptionsprefix_              pepgetoptionsprefix
     81: #define pepsettype_                       pepsettype
     82: #define pepgettype_                       pepgettype
     83: #define pepmonitorset_                    pepmonitorset
     84: #define pepmonitorall_                    pepmonitorall
     85: #define pepmonitorfirst_                  pepmonitorfirst
     86: #define pepmonitorconverged_              pepmonitorconverged
     87: #define pepmonitorconvergedcreate_        pepmonitorconvergedcreate
     88: #define pepmonitorconvergeddestroy_       pepmonitorconvergeddestroy
     89: #define pepconvergedabsolute_             pepconvergedabsolute
     90: #define pepconvergedrelative_             pepconvergedrelative
     91: #define pepsetconvergencetestfunction_    pepsetconvergencetestfunction
     92: #define pepsetstoppingtestfunction_       pepsetstoppingtestfunction
     93: #define pepseteigenvaluecomparison_       pepseteigenvaluecomparison
     94: #define pepgetdimensions000_              pepgetdimensions000
     95: #define pepgetdimensions100_              pepgetdimensions100
     96: #define pepgetdimensions010_              pepgetdimensions010
     97: #define pepgetdimensions001_              pepgetdimensions001
     98: #define pepgetdimensions110_              pepgetdimensions110
     99: #define pepgetdimensions011_              pepgetdimensions011
    100: #define pepgetdimensions101_              pepgetdimensions101
    101: #define pepgeteigenpair00_                pepgeteigenpair00
    102: #define pepgeteigenpair10_                pepgeteigenpair10
    103: #define pepgeteigenpair01_                pepgeteigenpair01
    104: #define pepgeteigenpair11_                pepgeteigenpair11
    105: #define pepgettolerances00_               pepgettolerances00
    106: #define pepgettolerances10_               pepgettolerances10
    107: #define pepgettolerances01_               pepgettolerances01
    108: #define pepgetscale000_                   pepgetscale000
    109: #define pepgetscale100_                   pepgetscale100
    110: #define pepgetscale010_                   pepgetscale010
    111: #define pepgetscale001_                   pepgetscale001
    112: #define pepgetscale110_                   pepgetscale110
    113: #define pepgetscale011_                   pepgetscale011
    114: #define pepgetscale101_                   pepgetscale101
    115: #define pepgetscale111_                   pepgetscale111
    116: #define pepgetrefine000_                  pepgetrefine000
    117: #define pepgetrefine100_                  pepgetrefine100
    118: #define pepgetrefine010_                  pepgetrefine010
    119: #define pepgetrefine001_                  pepgetrefine001
    120: #define pepgetrefine110_                  pepgetrefine110
    121: #define pepgetrefine011_                  pepgetrefine011
    122: #define pepgetrefine101_                  pepgetrefine101
    123: #define pepgetrefine111_                  pepgetrefine111
    124: #define pepsetinitialspace0_              pepsetinitialspace0
    125: #define pepsetinitialspace1_              pepsetinitialspace1
    126: #endif

    128: /*
    129:    These are not usually called from Fortran but allow Fortran users
    130:    to transparently set these monitors from .F code
    131: */
    132: SLEPC_EXTERN void pepmonitorall_(PEP *pep,PetscInt *it,PetscInt *nconv,PetscScalar *eigr,PetscScalar *eigi,PetscReal *errest,PetscInt *nest,PetscViewerAndFormat **vf,PetscErrorCode *ierr)
    133: {
    134:   *ierr = PEPMonitorAll(*pep,*it,*nconv,eigr,eigi,errest,*nest,*vf);
    135: }

    137: SLEPC_EXTERN void pepmonitorfirst_(PEP *pep,PetscInt *it,PetscInt *nconv,PetscScalar *eigr,PetscScalar *eigi,PetscReal *errest,PetscInt *nest,PetscViewerAndFormat **vf,PetscErrorCode *ierr)
    138: {
    139:   *ierr = PEPMonitorFirst(*pep,*it,*nconv,eigr,eigi,errest,*nest,*vf);
    140: }

    142: SLEPC_EXTERN void pepmonitorconverged_(PEP *pep,PetscInt *it,PetscInt *nconv,PetscScalar *eigr,PetscScalar *eigi,PetscReal *errest,PetscInt *nest,PetscViewerAndFormat **vf,PetscErrorCode *ierr)
    143: {
    144:   *ierr = PEPMonitorConverged(*pep,*it,*nconv,eigr,eigi,errest,*nest,*vf);
    145: }

    147: SLEPC_EXTERN void pepmonitorconvergedcreate_(PetscViewer *vin,PetscViewerFormat *format,void *ctx,PetscViewerAndFormat **vf,PetscErrorCode *ierr)
    148: {
    149:   PetscViewer v;
    150:   PetscPatchDefaultViewers_Fortran(vin,v);
    151:   CHKFORTRANNULLOBJECT(ctx);
    152:   *ierr = PEPMonitorConvergedCreate(v,*format,ctx,vf);
    153: }

    155: SLEPC_EXTERN void pepmonitorconvergeddestroy_(PetscViewerAndFormat **vf,PetscErrorCode *ierr)
    156: {
    157:   *ierr = PEPMonitorConvergedDestroy(vf);
    158: }

    160: static struct {
    161:   PetscFortranCallbackId monitor;
    162:   PetscFortranCallbackId monitordestroy;
    163:   PetscFortranCallbackId convergence;
    164:   PetscFortranCallbackId convdestroy;
    165:   PetscFortranCallbackId stopping;
    166:   PetscFortranCallbackId stopdestroy;
    167:   PetscFortranCallbackId comparison;
    168: } _cb;

    170: /* These are not extern C because they are passed into non-extern C user level functions */
    171: static PetscErrorCode ourmonitor(PEP pep,PetscInt i,PetscInt nc,PetscScalar *er,PetscScalar *ei,PetscReal *d,PetscInt l,void* ctx)
    172: {
    173:   PetscObjectUseFortranCallback(pep,_cb.monitor,(PEP*,PetscInt*,PetscInt*,PetscScalar*,PetscScalar*,PetscReal*,PetscInt*,void*,PetscErrorCode*),(&pep,&i,&nc,er,ei,d,&l,_ctx,&ierr));
    174: }

    176: static PetscErrorCode ourdestroy(void** ctx)
    177: {
    178:   PEP pep = (PEP)*ctx;
    179:   PetscObjectUseFortranCallback(pep,_cb.monitordestroy,(void*,PetscErrorCode*),(_ctx,&ierr));
    180: }

    182: static PetscErrorCode ourconvergence(PEP pep,PetscScalar eigr,PetscScalar eigi,PetscReal res,PetscReal *errest,void *ctx)
    183: {
    184:   PetscObjectUseFortranCallback(pep,_cb.convergence,(PEP*,PetscScalar*,PetscScalar*,PetscReal*,PetscReal*,void*,PetscErrorCode*),(&pep,&eigr,&eigi,&res,errest,_ctx,&ierr));
    185: }

    187: static PetscErrorCode ourconvdestroy(void *ctx)
    188: {
    189:   PEP pep = (PEP)ctx;
    190:   PetscObjectUseFortranCallback(pep,_cb.convdestroy,(void*,PetscErrorCode*),(_ctx,&ierr));
    191: }

    193: static PetscErrorCode ourstopping(PEP pep,PetscInt its,PetscInt max_it,PetscInt nconv,PetscInt nev,PEPConvergedReason *reason,void *ctx)
    194: {
    195:   PetscObjectUseFortranCallback(pep,_cb.stopping,(PEP*,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PEPConvergedReason*,void*,PetscErrorCode*),(&pep,&its,&max_it,&nconv,&nev,reason,_ctx,&ierr));
    196: }

    198: static PetscErrorCode ourstopdestroy(void *ctx)
    199: {
    200:   PEP pep = (PEP)ctx;
    201:   PetscObjectUseFortranCallback(pep,_cb.stopdestroy,(void*,PetscErrorCode*),(_ctx,&ierr));
    202: }

    204: static PetscErrorCode oureigenvaluecomparison(PetscScalar ar,PetscScalar ai,PetscScalar br,PetscScalar bi,PetscInt *r,void *ctx)
    205: {
    206:   PEP pep = (PEP)ctx;
    207:   PetscObjectUseFortranCallback(pep,_cb.comparison,(PetscScalar*,PetscScalar*,PetscScalar*,PetscScalar*,PetscInt*,void*,PetscErrorCode*),(&ar,&ai,&br,&bi,r,_ctx,&ierr));
    208: }

    210: SLEPC_EXTERN void pepdestroy_(PEP *pep,PetscErrorCode *ierr)
    211: {
    212:   PETSC_FORTRAN_OBJECT_F_DESTROYED_TO_C_NULL(pep);
    213:   *ierr = PEPDestroy(pep); if (*ierr) return;
    214:   PETSC_FORTRAN_OBJECT_C_NULL_TO_F_DESTROYED(pep);
    215: }

    217: SLEPC_EXTERN void pepview_(PEP *pep,PetscViewer *viewer,PetscErrorCode *ierr)
    218: {
    219:   PetscViewer v;
    220:   PetscPatchDefaultViewers_Fortran(viewer,v);
    221:   *ierr = PEPView(*pep,v);
    222: }

    224: SLEPC_EXTERN void pepviewfromoptions_(PEP *pep,PetscObject obj,char* type,PetscErrorCode *ierr,PETSC_FORTRAN_CHARLEN_T len)
    225: {
    226:   char *t;

    228:   FIXCHAR(type,len,t);
    229:   CHKFORTRANNULLOBJECT(obj);
    230:   *ierr = PEPViewFromOptions(*pep,obj,t);if (*ierr) return;
    231:   FREECHAR(type,t);
    232: }

    234: SLEPC_EXTERN void pepconvergedreasonview_(PEP *pep,PetscViewer *viewer,PetscErrorCode *ierr)
    235: {
    236:   PetscViewer v;
    237:   PetscPatchDefaultViewers_Fortran(viewer,v);
    238:   *ierr = PEPConvergedReasonView(*pep,v);
    239: }

    241: SLEPC_EXTERN void peperrorview_(PEP *pep,PEPErrorType *etype,PetscViewer *viewer,PetscErrorCode *ierr)
    242: {
    243:   PetscViewer v;
    244:   PetscPatchDefaultViewers_Fortran(viewer,v);
    245:   *ierr = PEPErrorView(*pep,*etype,v);
    246: }

    248: SLEPC_EXTERN void pepvaluesview_(PEP *pep,PetscViewer *viewer,PetscErrorCode *ierr)
    249: {
    250:   PetscViewer v;
    251:   PetscPatchDefaultViewers_Fortran(viewer,v);
    252:   *ierr = PEPValuesView(*pep,v);
    253: }

    255: SLEPC_EXTERN void pepvectorsview_(PEP *pep,PetscViewer *viewer,PetscErrorCode *ierr)
    256: {
    257:   PetscViewer v;
    258:   PetscPatchDefaultViewers_Fortran(viewer,v);
    259:   *ierr = PEPVectorsView(*pep,v);
    260: }

    262: SLEPC_EXTERN void pepsettype_(PEP *pep,char *type,PetscErrorCode *ierr,PETSC_FORTRAN_CHARLEN_T len)
    263: {
    264:   char *t;

    266:   FIXCHAR(type,len,t);
    267:   *ierr = PEPSetType(*pep,t);if (*ierr) return;
    268:   FREECHAR(type,t);
    269: }

    271: SLEPC_EXTERN void pepgettype_(PEP *pep,char *name,PetscErrorCode *ierr,PETSC_FORTRAN_CHARLEN_T len)
    272: {
    273:   PEPType tname;

    275:   *ierr = PEPGetType(*pep,&tname);if (*ierr) return;
    276:   *ierr = PetscStrncpy(name,tname,len);if (*ierr) return;
    277:   FIXRETURNCHAR(PETSC_TRUE,name,len);
    278: }

    280: SLEPC_EXTERN void pepsetoptionsprefix_(PEP *pep,char *prefix,PetscErrorCode *ierr,PETSC_FORTRAN_CHARLEN_T len)
    281: {
    282:   char *t;

    284:   FIXCHAR(prefix,len,t);
    285:   *ierr = PEPSetOptionsPrefix(*pep,t);if (*ierr) return;
    286:   FREECHAR(prefix,t);
    287: }

    289: SLEPC_EXTERN void pepappendoptionsprefix_(PEP *pep,char *prefix,PetscErrorCode *ierr,PETSC_FORTRAN_CHARLEN_T len)
    290: {
    291:   char *t;

    293:   FIXCHAR(prefix,len,t);
    294:   *ierr = PEPAppendOptionsPrefix(*pep,t);if (*ierr) return;
    295:   FREECHAR(prefix,t);
    296: }

    298: SLEPC_EXTERN void pepgetoptionsprefix_(PEP *pep,char *prefix,PetscErrorCode *ierr,PETSC_FORTRAN_CHARLEN_T len)
    299: {
    300:   const char *tname;

    302:   *ierr = PEPGetOptionsPrefix(*pep,&tname); if (*ierr) return;
    303:   *ierr = PetscStrncpy(prefix,tname,len);if (*ierr) return;
    304:   FIXRETURNCHAR(PETSC_TRUE,prefix,len);
    305: }

    307: SLEPC_EXTERN void pepmonitorset_(PEP *pep,void (*monitor)(PEP*,PetscInt*,PetscInt*,PetscScalar*,PetscScalar*,PetscReal*,PetscInt*,void*,PetscErrorCode*),void *mctx,void (*monitordestroy)(void *,PetscErrorCode*),PetscErrorCode *ierr)
    308: {
    309:   CHKFORTRANNULLOBJECT(mctx);
    310:   CHKFORTRANNULLFUNCTION(monitordestroy);
    311:   if ((PetscVoidFunction)monitor == (PetscVoidFunction)pepmonitorall_) {
    312:     *ierr = PEPMonitorSet(*pep,(PetscErrorCode (*)(PEP,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt,void*))PEPMonitorAll,*(PetscViewerAndFormat**)mctx,(PetscErrorCode (*)(void**))PetscViewerAndFormatDestroy);
    313:   } else if ((PetscVoidFunction)monitor == (PetscVoidFunction)pepmonitorconverged_) {
    314:     *ierr = PEPMonitorSet(*pep,(PetscErrorCode (*)(PEP,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt,void*))PEPMonitorConverged,*(PetscViewerAndFormat**)mctx,(PetscErrorCode (*)(void**))PEPMonitorConvergedDestroy);
    315:   } else if ((PetscVoidFunction)monitor == (PetscVoidFunction)pepmonitorfirst_) {
    316:     *ierr = PEPMonitorSet(*pep,(PetscErrorCode (*)(PEP,PetscInt,PetscInt,PetscScalar*,PetscScalar*,PetscReal*,PetscInt,void*))PEPMonitorFirst,*(PetscViewerAndFormat**)mctx,(PetscErrorCode (*)(void**))PetscViewerAndFormatDestroy);
    317:   } else {
    318:     *ierr = PetscObjectSetFortranCallback((PetscObject)*pep,PETSC_FORTRAN_CALLBACK_CLASS,&_cb.monitor,(PetscVoidFunction)monitor,mctx); if (*ierr) return;
    319:     *ierr = PetscObjectSetFortranCallback((PetscObject)*pep,PETSC_FORTRAN_CALLBACK_CLASS,&_cb.monitordestroy,(PetscVoidFunction)monitordestroy,mctx); if (*ierr) return;
    320:     *ierr = PEPMonitorSet(*pep,ourmonitor,*pep,ourdestroy);
    321:   }
    322: }

    324: SLEPC_EXTERN void pepconvergedabsolute_(PEP *pep,PetscScalar *eigr,PetscScalar *eigi,PetscReal *res,PetscReal *errest,void *ctx,PetscErrorCode *ierr)
    325: {
    326:   *ierr = PEPConvergedAbsolute(*pep,*eigr,*eigi,*res,errest,ctx);
    327: }

    329: SLEPC_EXTERN void pepconvergedrelative_(PEP *pep,PetscScalar *eigr,PetscScalar *eigi,PetscReal *res,PetscReal *errest,void *ctx,PetscErrorCode *ierr)
    330: {
    331:   *ierr = PEPConvergedRelative(*pep,*eigr,*eigi,*res,errest,ctx);
    332: }

    334: SLEPC_EXTERN void pepsetconvergencetestfunction_(PEP *pep,void (*func)(PEP*,PetscScalar*,PetscScalar*,PetscReal*,PetscReal*,void*,PetscErrorCode*),void* ctx,void (*destroy)(void*,PetscErrorCode*),PetscErrorCode *ierr)
    335: {
    336:   CHKFORTRANNULLOBJECT(ctx);
    337:   CHKFORTRANNULLFUNCTION(destroy);
    338:   if ((PetscVoidFunction)func == (PetscVoidFunction)pepconvergedabsolute_) {
    339:     *ierr = PEPSetConvergenceTest(*pep,PEP_CONV_ABS);
    340:   } else if ((PetscVoidFunction)func == (PetscVoidFunction)pepconvergedrelative_) {
    341:     *ierr = PEPSetConvergenceTest(*pep,PEP_CONV_REL);
    342:   } else {
    343:     *ierr = PetscObjectSetFortranCallback((PetscObject)*pep,PETSC_FORTRAN_CALLBACK_CLASS,&_cb.convergence,(PetscVoidFunction)func,ctx); if (*ierr) return;
    344:     *ierr = PetscObjectSetFortranCallback((PetscObject)*pep,PETSC_FORTRAN_CALLBACK_CLASS,&_cb.convdestroy,(PetscVoidFunction)destroy,ctx); if (*ierr) return;
    345:     *ierr = PEPSetConvergenceTestFunction(*pep,ourconvergence,*pep,ourconvdestroy);
    346:   }
    347: }

    349: SLEPC_EXTERN void pepstoppingbasic_(PEP *pep,PetscInt *its,PetscInt *max_it,PetscInt *nconv,PetscInt *nev,PEPConvergedReason *reason,void *ctx,PetscErrorCode *ierr)
    350: {
    351:   *ierr = PEPStoppingBasic(*pep,*its,*max_it,*nconv,*nev,reason,ctx);
    352: }

    354: SLEPC_EXTERN void pepsetstoppingtestfunction_(PEP *pep,void (*func)(PEP*,PetscInt,PetscInt,PetscInt,PetscInt,PEPConvergedReason*,void*,PetscErrorCode*),void* ctx,void (*destroy)(void*,PetscErrorCode*),PetscErrorCode *ierr)
    355: {
    356:   CHKFORTRANNULLOBJECT(ctx);
    357:   CHKFORTRANNULLFUNCTION(destroy);
    358:   if ((PetscVoidFunction)func == (PetscVoidFunction)pepstoppingbasic_) {
    359:     *ierr = PEPSetStoppingTest(*pep,PEP_STOP_BASIC);
    360:   } else {
    361:     *ierr = PetscObjectSetFortranCallback((PetscObject)*pep,PETSC_FORTRAN_CALLBACK_CLASS,&_cb.stopping,(PetscVoidFunction)func,ctx); if (*ierr) return;
    362:     *ierr = PetscObjectSetFortranCallback((PetscObject)*pep,PETSC_FORTRAN_CALLBACK_CLASS,&_cb.stopdestroy,(PetscVoidFunction)destroy,ctx); if (*ierr) return;
    363:     *ierr = PEPSetStoppingTestFunction(*pep,ourstopping,*pep,ourstopdestroy);
    364:   }
    365: }

    367: SLEPC_EXTERN void pepseteigenvaluecomparison_(PEP *pep,void (*func)(PetscScalar*,PetscScalar*,PetscScalar*,PetscScalar*,PetscInt*,void*),void* ctx,PetscErrorCode *ierr)
    368: {
    369:   CHKFORTRANNULLOBJECT(ctx);
    370:   *ierr = PetscObjectSetFortranCallback((PetscObject)*pep,PETSC_FORTRAN_CALLBACK_CLASS,&_cb.comparison,(PetscVoidFunction)func,ctx); if (*ierr) return;
    371:   *ierr = PEPSetEigenvalueComparison(*pep,oureigenvaluecomparison,*pep);
    372: }

    374: SLEPC_EXTERN void pepgetdimensions_(PEP *pep,PetscInt *nev,PetscInt *ncv,PetscInt *mpd,PetscErrorCode *ierr)
    375: {
    376:   CHKFORTRANNULLINTEGER(nev);
    377:   CHKFORTRANNULLINTEGER(ncv);
    378:   CHKFORTRANNULLINTEGER(mpd);
    379:   *ierr = PEPGetDimensions(*pep,nev,ncv,mpd);
    380: }

    382: SLEPC_EXTERN void pepgetdimensions000_(PEP *pep,PetscInt *nev,PetscInt *ncv,PetscInt *mpd,PetscErrorCode *ierr)
    383: {
    384:   pepgetdimensions_(pep,nev,ncv,mpd,ierr);
    385: }

    387: SLEPC_EXTERN void pepgetdimensions100_(PEP *pep,PetscInt *nev,PetscInt *ncv,PetscInt *mpd,PetscErrorCode *ierr)
    388: {
    389:   pepgetdimensions_(pep,nev,ncv,mpd,ierr);
    390: }

    392: SLEPC_EXTERN void pepgetdimensions010_(PEP *pep,PetscInt *nev,PetscInt *ncv,PetscInt *mpd,PetscErrorCode *ierr)
    393: {
    394:   pepgetdimensions_(pep,nev,ncv,mpd,ierr);
    395: }

    397: SLEPC_EXTERN void pepgetdimensions001_(PEP *pep,PetscInt *nev,PetscInt *ncv,PetscInt *mpd,PetscErrorCode *ierr)
    398: {
    399:   pepgetdimensions_(pep,nev,ncv,mpd,ierr);
    400: }

    402: SLEPC_EXTERN void pepgetdimensions110_(PEP *pep,PetscInt *nev,PetscInt *ncv,PetscInt *mpd,PetscErrorCode *ierr)
    403: {
    404:   pepgetdimensions_(pep,nev,ncv,mpd,ierr);
    405: }

    407: SLEPC_EXTERN void pepgetdimensions011_(PEP *pep,PetscInt *nev,PetscInt *ncv,PetscInt *mpd,PetscErrorCode *ierr)
    408: {
    409:   pepgetdimensions_(pep,nev,ncv,mpd,ierr);
    410: }

    412: SLEPC_EXTERN void pepgeteigenpair_(PEP *pep,PetscInt *i,PetscScalar *eigr,PetscScalar *eigi,Vec *Vr,Vec *Vi,PetscErrorCode *ierr)
    413: {
    414:   CHKFORTRANNULLSCALAR(eigr);
    415:   CHKFORTRANNULLSCALAR(eigi);
    416:   *ierr = PEPGetEigenpair(*pep,*i,eigr,eigi,*Vr,*Vi);
    417: }

    419: SLEPC_EXTERN void pepgeteigenpair00_(PEP *pep,PetscInt *i,PetscScalar *eigr,PetscScalar *eigi,Vec *Vr,Vec *Vi,PetscErrorCode *ierr)
    420: {
    421:   pepgeteigenpair_(pep,i,eigr,eigi,Vr,Vi,ierr);
    422: }

    424: SLEPC_EXTERN void pepgeteigenpair10_(PEP *pep,PetscInt *i,PetscScalar *eigr,PetscScalar *eigi,Vec *Vr,Vec *Vi,PetscErrorCode *ierr)
    425: {
    426:   pepgeteigenpair_(pep,i,eigr,eigi,Vr,Vi,ierr);
    427: }

    429: SLEPC_EXTERN void pepgeteigenpair01_(PEP *pep,PetscInt *i,PetscScalar *eigr,PetscScalar *eigi,Vec *Vr,Vec *Vi,PetscErrorCode *ierr)
    430: {
    431:   pepgeteigenpair_(pep,i,eigr,eigi,Vr,Vi,ierr);
    432: }

    434: SLEPC_EXTERN void pepgeteigenpair11_(PEP *pep,PetscInt *i,PetscScalar *eigr,PetscScalar *eigi,Vec *Vr,Vec *Vi,PetscErrorCode *ierr)
    435: {
    436:   pepgeteigenpair_(pep,i,eigr,eigi,Vr,Vi,ierr);
    437: }

    439: SLEPC_EXTERN void pepgettolerances_(PEP *pep,PetscReal *tol,PetscInt *maxits,PetscErrorCode *ierr)
    440: {
    441:   CHKFORTRANNULLREAL(tol);
    442:   CHKFORTRANNULLINTEGER(maxits);
    443:   *ierr = PEPGetTolerances(*pep,tol,maxits);
    444: }

    446: SLEPC_EXTERN void pepgettolerances00_(PEP *pep,PetscReal *tol,PetscInt *maxits,PetscErrorCode *ierr)
    447: {
    448:   pepgettolerances_(pep,tol,maxits,ierr);
    449: }

    451: SLEPC_EXTERN void pepgettolerances10_(PEP *pep,PetscReal *tol,PetscInt *maxits,PetscErrorCode *ierr)
    452: {
    453:   pepgettolerances_(pep,tol,maxits,ierr);
    454: }

    456: SLEPC_EXTERN void pepgettolerances01_(PEP *pep,PetscReal *tol,PetscInt *maxits,PetscErrorCode *ierr)
    457: {
    458:   pepgettolerances_(pep,tol,maxits,ierr);
    459: }

    461: SLEPC_EXTERN void pepgetscale_(PEP *pep,PEPScale *scale,PetscReal *alpha,Vec *Dl,Vec *Dr,PetscInt *its,PetscReal *lambda,PetscErrorCode *ierr)
    462: {
    463:   CHKFORTRANNULLREAL(alpha);
    464:   CHKFORTRANNULLINTEGER(its);
    465:   CHKFORTRANNULLREAL(lambda);
    466:   *ierr = PEPGetScale(*pep,scale,alpha,Dl,Dr,its,lambda);
    467: }

    469: SLEPC_EXTERN void pepgetscale000_(PEP *pep,PEPScale *scale,PetscReal *alpha,Vec *Dl,Vec *Dr,PetscInt *its,PetscReal *lambda,PetscErrorCode *ierr)
    470: {
    471:   pepgetscale_(pep,scale,alpha,Dl,Dr,its,lambda,ierr);
    472: }

    474: SLEPC_EXTERN void pepgetscale100_(PEP *pep,PEPScale *scale,PetscReal *alpha,Vec *Dl,Vec *Dr,PetscInt *its,PetscReal *lambda,PetscErrorCode *ierr)
    475: {
    476:   pepgetscale_(pep,scale,alpha,Dl,Dr,its,lambda,ierr);
    477: }

    479: SLEPC_EXTERN void pepgetscale010_(PEP *pep,PEPScale *scale,PetscReal *alpha,Vec *Dl,Vec *Dr,PetscInt *its,PetscReal *lambda,PetscErrorCode *ierr)
    480: {
    481:   pepgetscale_(pep,scale,alpha,Dl,Dr,its,lambda,ierr);
    482: }

    484: SLEPC_EXTERN void pepgetscale001_(PEP *pep,PEPScale *scale,PetscReal *alpha,Vec *Dl,Vec *Dr,PetscInt *its,PetscReal *lambda,PetscErrorCode *ierr)
    485: {
    486:   pepgetscale_(pep,scale,alpha,Dl,Dr,its,lambda,ierr);
    487: }

    489: SLEPC_EXTERN void pepgetscale110_(PEP *pep,PEPScale *scale,PetscReal *alpha,Vec *Dl,Vec *Dr,PetscInt *its,PetscReal *lambda,PetscErrorCode *ierr)
    490: {
    491:   pepgetscale_(pep,scale,alpha,Dl,Dr,its,lambda,ierr);
    492: }

    494: SLEPC_EXTERN void pepgetscale011_(PEP *pep,PEPScale *scale,PetscReal *alpha,Vec *Dl,Vec *Dr,PetscInt *its,PetscReal *lambda,PetscErrorCode *ierr)
    495: {
    496:   pepgetscale_(pep,scale,alpha,Dl,Dr,its,lambda,ierr);
    497: }

    499: SLEPC_EXTERN void pepgetscale101_(PEP *pep,PEPScale *scale,PetscReal *alpha,Vec *Dl,Vec *Dr,PetscInt *its,PetscReal *lambda,PetscErrorCode *ierr)
    500: {
    501:   pepgetscale_(pep,scale,alpha,Dl,Dr,its,lambda,ierr);
    502: }

    504: SLEPC_EXTERN void pepgetscale111_(PEP *pep,PEPScale *scale,PetscReal *alpha,Vec *Dl,Vec *Dr,PetscInt *its,PetscReal *lambda,PetscErrorCode *ierr)
    505: {
    506:   pepgetscale_(pep,scale,alpha,Dl,Dr,its,lambda,ierr);
    507: }

    509: SLEPC_EXTERN void pepgetrefine_(PEP *pep,PEPRefine *refine,PetscInt *npart,PetscReal *tol,PetscInt *its,PEPRefineScheme *scheme,PetscErrorCode *ierr)
    510: {
    511:   CHKFORTRANNULLINTEGER(npart);
    512:   CHKFORTRANNULLREAL(tol);
    513:   CHKFORTRANNULLINTEGER(its);
    514:   *ierr = PEPGetRefine(*pep,refine,npart,tol,its,scheme);
    515: }

    517: SLEPC_EXTERN void pepgetrefine000_(PEP *pep,PEPRefine *refine,PetscInt *npart,PetscReal *tol,PetscInt *its,PEPRefineScheme *scheme,PetscErrorCode *ierr)
    518: {
    519:   pepgetrefine_(pep,refine,npart,tol,its,scheme,ierr);
    520: }

    522: SLEPC_EXTERN void pepgetrefine100_(PEP *pep,PEPRefine *refine,PetscInt *npart,PetscReal *tol,PetscInt *its,PEPRefineScheme *scheme,PetscErrorCode *ierr)
    523: {
    524:   pepgetrefine_(pep,refine,npart,tol,its,scheme,ierr);
    525: }

    527: SLEPC_EXTERN void pepgetrefine010_(PEP *pep,PEPRefine *refine,PetscInt *npart,PetscReal *tol,PetscInt *its,PEPRefineScheme *scheme,PetscErrorCode *ierr)
    528: {
    529:   pepgetrefine_(pep,refine,npart,tol,its,scheme,ierr);
    530: }

    532: SLEPC_EXTERN void pepgetrefine001_(PEP *pep,PEPRefine *refine,PetscInt *npart,PetscReal *tol,PetscInt *its,PEPRefineScheme *scheme,PetscErrorCode *ierr)
    533: {
    534:   pepgetrefine_(pep,refine,npart,tol,its,scheme,ierr);
    535: }

    537: SLEPC_EXTERN void pepgetrefine110_(PEP *pep,PEPRefine *refine,PetscInt *npart,PetscReal *tol,PetscInt *its,PEPRefineScheme *scheme,PetscErrorCode *ierr)
    538: {
    539:   pepgetrefine_(pep,refine,npart,tol,its,scheme,ierr);
    540: }

    542: SLEPC_EXTERN void pepgetrefine011_(PEP *pep,PEPRefine *refine,PetscInt *npart,PetscReal *tol,PetscInt *its,PEPRefineScheme *scheme,PetscErrorCode *ierr)
    543: {
    544:   pepgetrefine_(pep,refine,npart,tol,its,scheme,ierr);
    545: }

    547: SLEPC_EXTERN void pepgetrefine101_(PEP *pep,PEPRefine *refine,PetscInt *npart,PetscReal *tol,PetscInt *its,PEPRefineScheme *scheme,PetscErrorCode *ierr)
    548: {
    549:   pepgetrefine_(pep,refine,npart,tol,its,scheme,ierr);
    550: }

    552: SLEPC_EXTERN void pepgetrefine111_(PEP *pep,PEPRefine *refine,PetscInt *npart,PetscReal *tol,PetscInt *its,PEPRefineScheme *scheme,PetscErrorCode *ierr)
    553: {
    554:   pepgetrefine_(pep,refine,npart,tol,its,scheme,ierr);
    555: }

    557: SLEPC_EXTERN void pepsetinitialspace0_(PEP *pep,PetscInt *n,Vec *is,PetscErrorCode *ierr)
    558: {
    559:   CHKFORTRANNULLOBJECT(is);
    560:   *ierr = PEPSetInitialSpace(*pep,*n,is);
    561: }

    563: SLEPC_EXTERN void pepsetinitialspace1_(PEP *pep,PetscInt *n,Vec *is,PetscErrorCode *ierr)
    564: {
    565:   CHKFORTRANNULLOBJECT(is);
    566:   *ierr = PEPSetInitialSpace(*pep,*n,is);
    567: }