Date: 2024-04-26T10:21:50+00:00

Actual source code: zkrylovschurf.c
slepc-3.21.1 2024-04-26
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 <slepceps.h>

     14: #if defined(PETSC_HAVE_FORTRAN_CAPS)
     15: #define epskrylovschursetsubintervals_    EPSKRYLOVSCHURSETSUBINTERVALS
     16: #define epskrylovschurgetsubintervals_    EPSKRYLOVSCHURGETSUBINTERVALS
     17: #define epskrylovschurgetinertias_        EPSKRYLOVSCHURGETINERTIAS
     18: #define epskrylovschurgetsubcomminfo_     EPSKRYLOVSCHURGETSUBCOMMINFO
     19: #define epskrylovschurgetsubcommmats_     EPSKRYLOVSCHURGETSUBCOMMMATS
     20: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
     21: #define epskrylovschursetsubintervals_    epskrylovschursetsubintervals
     22: #define epskrylovschurgetsubintervals_    epskrylovschurgetsubintervals
     23: #define epskrylovschurgetinertias_        epskrylovschurgetinertias
     24: #define epskrylovschurgetsubcomminfo_     epskrylovschurgetsubcomminfo
     25: #define epskrylovschurgetsubcommmats_     epskrylovschurgetsubcommmats
     26: #endif

     28: SLEPC_EXTERN void epskrylovschursetsubintervals_(EPS *eps,PetscReal *subint,PetscErrorCode *ierr)
     29: {
     30:   CHKFORTRANNULLREAL(subint);
     31:   *ierr = EPSKrylovSchurSetSubintervals(*eps,subint);
     32: }

     34: SLEPC_EXTERN void epskrylovschurgetsubintervals_(EPS *eps,PetscReal *subint,PetscErrorCode *ierr)
     35: {
     36:   PetscReal *osubint;
     37:   PetscInt  npart;

     39:   CHKFORTRANNULLREAL(subint);
     40:   *ierr = EPSKrylovSchurGetSubintervals(*eps,&osubint); if (*ierr) return;
     41:   *ierr = EPSKrylovSchurGetPartitions(*eps,&npart); if (*ierr) return;
     42:   *ierr = PetscArraycpy(subint,osubint,npart+1); if (*ierr) return;
     43:   *ierr = PetscFree(osubint);
     44: }

     46: SLEPC_EXTERN void epskrylovschurgetinertias_(EPS *eps,PetscInt *nshift,PetscReal *shifts,PetscInt *inertias,PetscErrorCode *ierr)
     47: {
     48:   PetscReal *oshifts;
     49:   PetscInt  *oinertias;
     50:   PetscInt  n;

     52:   CHKFORTRANNULLREAL(shifts);
     53:   CHKFORTRANNULLINTEGER(inertias);
     54:   *ierr = EPSKrylovSchurGetInertias(*eps,&n,&oshifts,&oinertias); if (*ierr) return;
     55:   if (shifts) { *ierr = PetscArraycpy(shifts,oshifts,n); if (*ierr) return; }
     56:   if (inertias) { *ierr = PetscArraycpy(inertias,oinertias,n); if (*ierr) return; }
     57:   *nshift = n;
     58:   *ierr = PetscFree(oshifts);if (*ierr) return;
     59:   *ierr = PetscFree(oinertias);
     60: }

     62: SLEPC_EXTERN void epskrylovschurgetsubcomminfo_(EPS *eps,PetscInt *k,PetscInt *n,Vec *v,PetscErrorCode *ierr)
     63: {
     64:   CHKFORTRANNULLOBJECT(v);
     65:   *ierr = EPSKrylovSchurGetSubcommInfo(*eps,k,n,v);
     66: }

     68: SLEPC_EXTERN void epskrylovschurgetsubcommmats_(EPS *eps,Mat *A,Mat *B,PetscErrorCode *ierr)
     69: {
     70:   CHKFORTRANNULLOBJECT(A);
     71:   CHKFORTRANNULLOBJECT(B);
     72:   *ierr = EPSKrylovSchurGetSubcommMats(*eps,A,B);
     73: }