Skip to main content

Table 1 Algorithm for preconditioned conjugate gradient (PCG) and deflated PCG (DPCG) methods for solving \({\mathbf{x}}\) in the linear system \({\mathbf{Cx}} = {\mathbf{b}}\) using a preconditioner M

From: Deflated preconditioned conjugate gradient method for solving single-step BLUP models efficiently

1

Select an initial guess \({\mathbf{x}}_{0}\); \({\mathbf{r}}_{\text{init}} = {\mathbf{b}} - {\mathbf{Cx}}_{0}\); \({\mathbf{r}}_{0} = {\mathbf{\psi r}}_{\text{init}}\); \({\mathbf{p}}_{ - 1} = 0\); \(\uptau_{ - 1} = 1\)

2

for \(j = \;0\),…, until convergence

3

\({\mathbf{y}}_{j} = {\mathbf{M}}^{ - 1} {\mathbf{r}}_{j}\)

4

\(\uptau_{j} = {\mathbf{r}}_{j}^{\varvec{'}} {\mathbf{y}}_{j}\)

5

\(\upbeta_{j} =\uptau_{j} /\uptau_{j - 1}\)

6

\(\uptau_{j - 1} =\uptau_{j}\)

7

\({\mathbf{p}}_{j} = {\mathbf{y}}_{j} +\upbeta_{j} {\mathbf{p}}_{j - 1}\)

8

\({\mathbf{w}}_{j} = {\mathbf{{\varvec{\uppsi}} Cp}}_{j}\)

9

\(\upalpha_{j} = {\mathbf{r}}_{j}^{ '} {\mathbf{y}}_{j} /{\mathbf{p}}_{j}^{\varvec{'}} {\mathbf{w}}_{j}\)

10

\({\mathbf{x}}_{j + 1} = {\mathbf{x}}_{j} +\upalpha_{j} {\mathbf{p}}_{j}\)

11

\({\mathbf{r}}_{j + 1} = {\mathbf{r}}_{j} -\upalpha_{j} {\mathbf{w}}_{j}\)

12

end

13

\({\mathbf{x}}_{final} = {\varvec{\upupsilon}}\)

  1. For PCG: \({\varvec{\uppsi}} = {\mathbf{I}}\), \({\varvec{\upupsilon}} = {\mathbf{x}}_{j + 1}\); for DPCG: \({\varvec{\uppsi}} = {\mathbf{P}} = {\mathbf{I}} - {\mathbf{CZ}}_{d} \left( {{\mathbf{Z}}_{d}^{'} {\mathbf{CZ}}_{d} } \right)^{ - 1} {\mathbf{Z}}_{d}^{'}\), \({\varvec{\upupsilon}} = {\mathbf{Z}}_{d} \left( {{\mathbf{Z}}_{d}^{'} {\mathbf{CZ}}_{d} } \right)^{ - 1} {\mathbf{Z}}_{d}^{'} {\mathbf{b}} + {\mathbf{P^{\prime}x}}_{j + 1}\), and \({\mathbf{Z}}_{d}\) is a deflation-subspace matrix
  2. For the PCG implementation: the equation in line 11 \(({\mathbf{r}}_{j + 1} = {\mathbf{r}}_{j} -\upalpha_{j} {\mathbf{w}}_{j} )\varvec{ }\) was replaced by the equation \({\mathbf{r}}_{j + 1} = {\mathbf{b}} - {\mathbf{Ax}}_{j + 1}\) at each 50 iterations [16]