GCC Code Coverage Report


Directory: ./
File: src/nep/impls/nleigs/ftn-custom/znleigsf.c
Date: 2026-05-04 03:58:11
Exec Total Coverage
Lines: 6 14 42.9%
Functions: 2 3 66.7%
Branches: 16 62 25.8%

Line Branch Exec Source
1 /*
2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
3 SLEPc - Scalable Library for Eigenvalue Problem Computations
4 Copyright (c) 2002-, Universitat Politecnica de Valencia, Spain
5
6 This file is part of SLEPc.
7 SLEPc is distributed under a 2-clause BSD license (see LICENSE).
8 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
9 */
10
11 #include <petsc/private/ftnimpl.h>
12 #include <slepcnep.h>
13
14 #if defined(PETSC_HAVE_FORTRAN_CAPS)
15 #define nepnleigssetsingularitiesfunction_ NEPNLEIGSSETSINGULARITIESFUNCTION
16 #define nepnleigsgetrkshifts_ NEPNLEIGSGETRKSHIFTS
17 #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
18 #define nepnleigssetsingularitiesfunction_ nepnleigssetsingularitiesfunction
19 #define nepnleigsgetrkshifts_ nepnleigsgetrkshifts
20 #endif
21
22 static struct {
23 PetscFortranCallbackId singularities;
24 } _cb;
25
26 12 static PetscErrorCode oursingularitiesfunc(NEP nep,PetscInt *maxnp,PetscScalar *xi,void *ctx)
27 {
28
3/6
✗ Branch 0 not taken.
✓ Branch 1 taken 6 times.
✓ Branch 2 taken 6 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 6 times.
12 PetscObjectUseFortranCallback(nep,_cb.singularities,(NEP*,PetscInt*,PetscScalar*,void*,PetscErrorCode*),(&nep,maxnp,xi,_ctx,&ierr));
29 }
30
31 12 SLEPC_EXTERN void nepnleigssetsingularitiesfunction_(NEP *nep,void (*func)(NEP*,PetscInt*,PetscScalar*,void*,PetscErrorCode*),void *ctx,PetscErrorCode *ierr)
32 {
33
12/24
✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 6 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 6 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 6 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 6 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 6 times.
✗ Branch 13 not taken.
✓ Branch 14 taken 6 times.
✗ Branch 15 not taken.
✓ Branch 16 taken 6 times.
✗ Branch 17 not taken.
✓ Branch 18 taken 6 times.
✗ Branch 19 not taken.
✓ Branch 20 taken 6 times.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 6 times.
12 CHKFORTRANNULLOBJECT(ctx);
34
1/2
✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
12 *ierr = PetscObjectSetFortranCallback((PetscObject)*nep,PETSC_FORTRAN_CALLBACK_CLASS,&_cb.singularities,(PetscFortranCallbackFn*)func,ctx); if (*ierr) return;
35 12 *ierr = NEPNLEIGSSetSingularitiesFunction(*nep,oursingularitiesfunc,*nep);
36 }
37
38 SLEPC_EXTERN void nepnleigsgetrkshifts_(NEP *nep,PetscInt *ns,PetscScalar *pshifts,PetscErrorCode *ierr)
39 {
40 PetscScalar *oshifts;
41 PetscInt n;
42
43 CHKFORTRANNULLSCALAR(pshifts);
44 *ierr = NEPNLEIGSGetRKShifts(*nep,&n,&oshifts); if (*ierr) return;
45 if (pshifts) { *ierr = PetscArraycpy(pshifts,oshifts,n); if (*ierr) return; }
46 *ns = n;
47 *ierr = PetscFree(oshifts);
48 }
49