GCC Code Coverage Report


Directory: ./
File: src/nep/impls/nleigs/nleigs.h
Date: 2025-10-03 04:28:47
Exec Total Coverage
Lines: 8 8 100.0%
Functions: 1 1 100.0%
Branches: 9 16 56.2%

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 Private header for NLEIGS
12 */
13
14 #pragma once
15
16 #define LBPOINTS 100 /* default value of the maximum number of Leja-Bagby points */
17 #define NDPOINTS 1e4 /* number of discretization points */
18
19 typedef struct {
20 BV V; /* tensor vector basis for the linearization */
21 BV W; /* tensor vector basis for the linearization */
22 PetscInt nmat; /* number of interpolation points */
23 PetscScalar *s,*xi; /* Leja-Bagby points */
24 PetscScalar *beta; /* scaling factors */
25 Mat *D; /* divided difference matrices */
26 PetscScalar *coeffD; /* coefficients for divided differences in split form */
27 PetscInt nshifts; /* provided number of shifts */
28 PetscScalar *shifts; /* user-provided shifts for the Rational Krylov variant */
29 PetscInt nshiftsw; /* actual number of shifts (1 if Krylov-Schur) */
30 PetscReal ddtol; /* tolerance for divided difference convergence */
31 PetscInt ddmaxit; /* maximum number of divided difference terms */
32 PetscReal keep; /* restart parameter */
33 PetscBool lock; /* locking/non-locking variant */
34 PetscInt idxrk; /* index of next shift to use */
35 KSP *ksp; /* ksp array for storing shift factorizations */
36 Vec vrn; /* random vector with normally distributed value */
37 PetscBool fullbasis; /* use full Krylov basis instead of TOAR basis */
38 EPS eps; /* eigensolver used in the full basis variant */
39 Mat A; /* shell matrix used for the eps in full basis */
40 Vec w[6]; /* work vectors */
41 void *singularitiesctx;
42 PetscErrorCode (*computesingularities)(NEP,PetscInt*,PetscScalar*,void*);
43 } NEP_NLEIGS;
44
45 typedef struct {
46 PetscInt nmat,maxnmat;
47 PetscScalar *coeff;
48 Mat *A;
49 Vec t;
50 } NEP_NLEIGS_MATSHELL;
51
52 274 static inline PetscErrorCode NEPNLEIGSSetShifts(NEP nep,PetscInt *nshiftsw)
53 {
54 274 NEP_NLEIGS *ctx = (NEP_NLEIGS*)nep->data;
55
56
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
274 PetscFunctionBegin;
57
2/2
✓ Branch 0 taken 10 times.
✓ Branch 1 taken 10 times.
274 if (!ctx->nshifts) {
58 244 ctx->shifts = &nep->target;
59 244 *nshiftsw = 1;
60 30 } else *nshiftsw = ctx->nshifts;
61
6/12
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 2 times.
274 PetscFunctionReturn(PETSC_SUCCESS);
62 }
63
64 SLEPC_INTERN PetscErrorCode NEPSetUp_NLEIGS_FullBasis(NEP);
65 SLEPC_INTERN PetscErrorCode NEPNLEIGSSetEPS_NLEIGS(NEP,EPS);
66 SLEPC_INTERN PetscErrorCode NEPNLEIGSGetEPS_NLEIGS(NEP,EPS*);
67 SLEPC_INTERN PetscErrorCode NEPNLEIGSBackTransform(PetscObject,PetscInt,PetscScalar*,PetscScalar *vali);
68 SLEPC_INTERN PetscErrorCode NEPNLEIGSEvalNRTFunct(NEP,PetscInt,PetscScalar,PetscScalar*);
69 SLEPC_INTERN PetscErrorCode NEPSolve_NLEIGS_FullBasis(NEP);
70 SLEPC_INTERN PetscErrorCode NEPSolve_NLEIGS(NEP);
71