<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.formulasearchengine.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=137.205.160.0%2F24</id>
	<title>formulasearchengine - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://en.formulasearchengine.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=137.205.160.0%2F24"/>
	<link rel="alternate" type="text/html" href="https://en.formulasearchengine.com/wiki/Special:Contributions/137.205.160.0/24"/>
	<updated>2026-07-09T19:36:55Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.47.0-wmf.7</generator>
	<entry>
		<id>https://en.formulasearchengine.com/w/index.php?title=Speedup&amp;diff=8470</id>
		<title>Speedup</title>
		<link rel="alternate" type="text/html" href="https://en.formulasearchengine.com/w/index.php?title=Speedup&amp;diff=8470"/>
		<updated>2014-01-29T14:50:41Z</updated>

		<summary type="html">&lt;p&gt;137.205.160.45: Removed irrelevant citation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Conjugate gradient illustration.svg|right|thumb|A comparison of the convergence of [[gradient descent]] with optimal step size (in green) and conjugate vector (in red) for minimizing a quadratic function associated with a given linear system. Conjugate gradient, assuming exact arithmetic, converges in at most &#039;&#039;n&#039;&#039; steps where &#039;&#039;n&#039;&#039; is the size of the matrix of the system (here &#039;&#039;n&#039;&#039;=2).]]&lt;br /&gt;
In [[mathematics]], the &#039;&#039;&#039;conjugate gradient method&#039;&#039;&#039; is an [[algorithm]] for the [[numerical solution]] of particular [[system of linear equations|systems of linear equations]], namely those whose matrix is [[symmetric matrix|symmetric]] and [[positive-definite matrix|positive-definite]]. The conjugate gradient method is often implemented as an [[iterative method|iterative algorithm]], applicable to [[sparse matrix|sparse]] systems that are too large to be handled by a direct implementation or other direct methods such as the [[Cholesky decomposition]]. Large sparse systems often arise when numerically solving [[partial differential equation]]s or optimization problems.&lt;br /&gt;
&lt;br /&gt;
The conjugate gradient method can also be used to solve unconstrained [[Mathematical optimization|optimization]] problems such as [[energy minimization]]. It was developed by [[Magnus Hestenes]] and [[Eduard Stiefel]].&amp;lt;ref&amp;gt;{{cite web|last=Straeter|first=T. A.|title=On the Extension of the Davidon-Broyden Class of Rank One, Quasi-Newton Minimization Methods to an Infinite Dimensional Hilbert Space with Applications to Optimal Control Problems|url=http://hdl.handle.net/2060/19710026200|work=NASA Technical Reports Server|publisher=NASA|accessdate=10 October 2011}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The [[biconjugate gradient method]] provides a generalization to non-symmetric matrices. Various [[nonlinear conjugate gradient method]]s seek minima of nonlinear equations.&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
{|class=&amp;quot;infobox bordered&amp;quot; style=&amp;quot;width: 22em; text-align: left; font-size: 95%;&amp;quot;&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; style=&amp;quot;text-align:center;&amp;quot; | [[File:Banana-ConjGrad.gif|420px| ]]&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&#039;&#039;&#039;Conjugate gradient search over Rosenbrock banana function&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description of the method==&lt;br /&gt;
&lt;br /&gt;
Suppose we want to solve the following [[system of linear equations]]&lt;br /&gt;
:&#039;&#039;&#039;Ax&#039;&#039;&#039; = &#039;&#039;&#039;b&#039;&#039;&#039;&lt;br /&gt;
for the vector &#039;&#039;&#039;x&#039;&#039;&#039; where the known &#039;&#039;n&#039;&#039;-by-&#039;&#039;n&#039;&#039; matrix &#039;&#039;&#039;A&#039;&#039;&#039; is [[Symmetric matrix|symmetric]] (i.e. &#039;&#039;&#039;A&#039;&#039;&#039;&amp;lt;sup&amp;gt;T&amp;lt;/sup&amp;gt; = &#039;&#039;&#039;A&#039;&#039;&#039;), [[positive definite matrix|positive definite]] (i.e. &#039;&#039;&#039;x&#039;&#039;&#039;&amp;lt;sup&amp;gt;T&amp;lt;/sup&amp;gt;&#039;&#039;&#039;Ax&#039;&#039;&#039; &amp;gt; 0 for all non-zero vectors &#039;&#039;&#039;x&#039;&#039;&#039; in &#039;&#039;&#039;R&#039;&#039;&#039;&amp;lt;sup&amp;gt;&#039;&#039;n&#039;&#039;&amp;lt;/sup&amp;gt;), and [[real number|real]], and &#039;&#039;&#039;b&#039;&#039;&#039; is known as well.&lt;br /&gt;
&lt;br /&gt;
We denote the unique solution of this system by &amp;lt;math&amp;gt;\scriptstyle \mathbf{x}_*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==The conjugate gradient method as a direct method==&lt;br /&gt;
&lt;br /&gt;
We say that two non-zero vectors &#039;&#039;u&#039;&#039; and &#039;&#039;v&#039;&#039; are [[Inner automorphism|conjugate]] (with respect to &#039;&#039;A&#039;&#039;) if&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \mathbf{u}^\mathrm{T} \mathbf{A} \mathbf{v} = 0. &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &#039;&#039;&#039;A&#039;&#039;&#039; is symmetric and positive definite, the left-hand side defines an [[inner product space|inner product]]&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \langle \mathbf{u},\mathbf{v} \rangle_\mathbf{A} := \langle \mathbf{A} \mathbf{u}, \mathbf{v}\rangle = \langle \mathbf{u},  \mathbf{A}^\mathrm{T} \mathbf{v}\rangle = \langle \mathbf{u}, \mathbf{A}\mathbf{v} \rangle = \mathbf{u}^\mathrm{T} \mathbf{A} \mathbf{v}. &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two vectors are conjugate if they are orthogonal with respect to this inner product.&lt;br /&gt;
Being conjugate is a symmetric relation: if &#039;&#039;&#039;u&#039;&#039;&#039; is conjugate to &#039;&#039;&#039;v&#039;&#039;&#039;, then &#039;&#039;&#039;v&#039;&#039;&#039; is conjugate to &#039;&#039;&#039;u&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Suppose that &amp;lt;math&amp;gt;P=\{\mathbf{p}_k: \forall i\neq k \in [1,n] \subset \mathbb{N}, \langle\mathbf{p}_i,\mathbf{p}_k\rangle_{A}=0  \}&amp;lt;/math&amp;gt; is a set of &#039;&#039;n&#039;&#039; mutually conjugate directions. Then &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; is a [[basis (linear algebra)|basis]] of &amp;lt;math&amp;gt;\mathbb{R}^n&amp;lt;/math&amp;gt;, so within &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; we can expand the solution &amp;lt;math&amp;gt;\mathbf{x}_*&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;\mathbf{Ax} = \mathbf{b}&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \mathbf{x}_* = \sum^{n}_{i=1} \alpha_i \mathbf{p}_i&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and we see that &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \mathbf{b}=\mathbf{A}\mathbf{x}_* = \sum^{n}_{i=1} \alpha_i  \mathbf{A} \mathbf{p}_i.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For any &amp;lt;math&amp;gt;\mathbf{p}_k \in P&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \mathbf{p}_k^\mathrm{T} \mathbf{b}=\mathbf{p}_k^\mathrm{T} \mathbf{A}\mathbf{x}_* = \sum^{n}_{i=1} \alpha_i\mathbf{p}_k^\mathrm{T} \mathbf{A} \mathbf{p}_i=\alpha_k\mathbf{p}_k^\mathrm{T} \mathbf{A} \mathbf{p}_k.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(because &amp;lt;math&amp;gt;\forall i\neq k, p_i, p_k&amp;lt;/math&amp;gt; are mutually conjugate)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \alpha_k = \frac{\mathbf{p}_k^\mathrm{T} \mathbf{b}}{\mathbf{p}_k^\mathrm{T} \mathbf{A} \mathbf{p}_k} = \frac{\langle \mathbf{p}_k, \mathbf{b}\rangle}{\,\,\,\langle \mathbf{p}_k,  \mathbf{p}_k\rangle_\mathbf{A}} = \frac{\langle \mathbf{p}_k, \mathbf{b}\rangle}{\,\,\,\|\mathbf{p}_k\|_\mathbf{A}^2}. &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This result is perhaps most transparent by considering the inner product defined above.&lt;br /&gt;
&lt;br /&gt;
This gives the following method for solving the equation &#039;&#039;&#039;Ax&#039;&#039;&#039; = &#039;&#039;&#039;b&#039;&#039;&#039;: find a sequence of &#039;&#039;n&#039;&#039; conjugate directions, and then compute the coefficients &amp;lt;math&amp;gt;\scriptstyle \alpha_k&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==The conjugate gradient method as an iterative method==&lt;br /&gt;
&lt;br /&gt;
If we choose the conjugate vectors &#039;&#039;&#039;p&#039;&#039;&#039;&amp;lt;sub&amp;gt;&#039;&#039;k&#039;&#039;&amp;lt;/sub&amp;gt; carefully, then we may not need all of them to obtain a good approximation to the solution &amp;lt;math&amp;gt;\scriptstyle \mathbf{x}_*&amp;lt;/math&amp;gt;. So, we want to regard the conjugate gradient method as an iterative method. This also allows us to approximately solve systems where &#039;&#039;n&#039;&#039; is so large that the direct method would take too much time.&lt;br /&gt;
 &lt;br /&gt;
We denote the initial guess for &amp;lt;math&amp;gt;\scriptstyle \mathbf{x}_*&amp;lt;/math&amp;gt; by &#039;&#039;&#039;x&#039;&#039;&#039;&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;. We can assume without loss of generality that &#039;&#039;&#039;x&#039;&#039;&#039;&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = 0 (otherwise, consider the system &#039;&#039;&#039;Az&#039;&#039;&#039; = &#039;&#039;&#039;b&#039;&#039;&#039; − &#039;&#039;&#039;Ax&#039;&#039;&#039;&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; instead). Starting with &#039;&#039;&#039;x&#039;&#039;&#039;&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; we search for the solution and in each iteration we need a metric to tell us whether we are closer to the solution &amp;lt;math&amp;gt;\scriptstyle \mathbf{x}_*&amp;lt;/math&amp;gt; (that is unknown to us). This metric comes from the fact that the solution &amp;lt;math&amp;gt;\scriptstyle \mathbf{x}_*&amp;lt;/math&amp;gt; is also the unique minimizer of the following [[quadratic function]]; so if f(&#039;&#039;&#039;x&#039;&#039;&#039;) becomes smaller in an iteration it means that we are closer to &amp;lt;math&amp;gt;\scriptstyle \mathbf{x}_*&amp;lt;/math&amp;gt;.&lt;br /&gt;
:&amp;lt;math&amp;gt; f(\mathbf{x}) = \frac12 \mathbf{x}^\mathrm{T} \mathbf{A}\mathbf{x} - \mathbf{x}^\mathrm{T} \mathbf{b} , \quad \mathbf{x}\in\mathbf{R}^n. &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Note that the +c has been added to the equation above. Without the c the trivial solution of x=0 is the minimum and the solution of the original equation. If x0 is the minimum, then the quadratic can be described as (x^T-x0^T)*A*(x-x0)-c0=0 (c0 is f at the minimum while x0 is the solution at the minimum). Expanding this you get x^T*X*x-x^T*b+c where b=2*A*x0 and c=x0^T*A*x0-c0 ... wait a minute... for the purposes of minimization c0 does not matter... if this is the case then c0 could be selected such that c0=x0^T*A*x0 in which case the original form x^T*X*x-x^T*b is still valid... --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This suggests taking the first basis vector &#039;&#039;&#039;p&#039;&#039;&#039;&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; to be the negative  of the gradient of &#039;&#039;f&#039;&#039; at &#039;&#039;&#039;x&#039;&#039;&#039; = &#039;&#039;&#039;x&#039;&#039;&#039;&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;. The gradient of &#039;&#039;f&#039;&#039; equals &#039;&#039;&#039;Ax&#039;&#039;&#039;&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;amp;minus;&#039;&#039;&#039;b&#039;&#039;&#039;.  Starting with a &amp;quot;guessed solution&amp;quot; &#039;&#039;&#039;x&#039;&#039;&#039;&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; (we can always guess that &amp;lt;math&amp;gt;\scriptstyle \mathbf{x}_*&amp;lt;/math&amp;gt; is &#039;&#039;&#039;0&#039;&#039;&#039; and set &#039;&#039;&#039;x&#039;&#039;&#039;&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; to &#039;&#039;&#039;0&#039;&#039;&#039; if we have no reason to guess for anything else), this means we take &#039;&#039;&#039;p&#039;&#039;&#039;&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = &#039;&#039;&#039;b&#039;&#039;&#039;&amp;amp;minus;&#039;&#039;&#039;Ax&#039;&#039;&#039;&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;. The other vectors in the basis will be conjugate to the gradient, hence the name &#039;&#039;conjugate gradient method&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Let &#039;&#039;&#039;r&#039;&#039;&#039;&amp;lt;sub&amp;gt;&#039;&#039;k&#039;&#039;&amp;lt;/sub&amp;gt; be the [[residual (numerical analysis)|residual]] at the &#039;&#039;k&#039;&#039;th step:&lt;br /&gt;
:&amp;lt;math&amp;gt; \mathbf{r}_k = \mathbf{b} - \mathbf{Ax}_k.  \, &amp;lt;/math&amp;gt;&lt;br /&gt;
Note that &#039;&#039;&#039;r&#039;&#039;&#039;&amp;lt;sub&amp;gt;&#039;&#039;k&#039;&#039;&amp;lt;/sub&amp;gt; is the negative gradient of &#039;&#039;f&#039;&#039; at &#039;&#039;&#039;x&#039;&#039;&#039; = &#039;&#039;&#039;x&#039;&#039;&#039;&amp;lt;sub&amp;gt;&#039;&#039;k&#039;&#039;&amp;lt;/sub&amp;gt;, so the [[gradient descent]] method would be to move in the direction &#039;&#039;&#039;r&#039;&#039;&#039;&amp;lt;sub&amp;gt;&#039;&#039;k&#039;&#039;&amp;lt;/sub&amp;gt;. Here, we insist that the directions &#039;&#039;&#039;p&#039;&#039;&#039;&amp;lt;sub&amp;gt;&#039;&#039;k&#039;&#039;&amp;lt;/sub&amp;gt; be conjugate to each other. We also require that the next search direction be built out of the current residue and all previous search directions, which is reasonable enough in practice.&lt;br /&gt;
&lt;br /&gt;
The conjugation constraint is an  orthonormal-type constraint and hence the algorithm bears resemblance to [[Gram–Schmidt process|Gram-Schmidt orthonormalization]].  &lt;br /&gt;
&lt;br /&gt;
This gives the following expression:&lt;br /&gt;
:&amp;lt;math&amp;gt; \mathbf{p}_{k} = \mathbf{r}_{k} - \sum_{i &amp;lt; k}\frac{\mathbf{p}_i^\mathrm{T} \mathbf{A} \mathbf{r}_{k}}{\mathbf{p}_i^\mathrm{T}\mathbf{A} \mathbf{p}_i} \mathbf{p}_i &amp;lt;/math&amp;gt;&lt;br /&gt;
(see the picture at the top of the article for the effect of the conjugacy constraint on convergence). Following this direction, the next optimal location is given by&lt;br /&gt;
:&amp;lt;math&amp;gt; \mathbf{x}_{k+1} = \mathbf{x}_k + \alpha_k \mathbf{p}_k &amp;lt;/math&amp;gt;&lt;br /&gt;
with &lt;br /&gt;
:&amp;lt;math&amp;gt; \alpha_{k} = \frac{\mathbf{p}_k^\mathrm{T} \mathbf{b}}{\mathbf{p}_k^\mathrm{T} \mathbf{A} \mathbf{p}_k} = \frac{\mathbf{p}_k^\mathrm{T} (\mathbf{r}_{k-1}+\mathbf{Ax}_{k-1})}{\mathbf{p}_{k}^\mathrm{T} \mathbf{A} \mathbf{p}_{k}} = \frac{\mathbf{p}_{k}^\mathrm{T} \mathbf{r}_{k-1}}{\mathbf{p}_{k}^\mathrm{T} \mathbf{A} \mathbf{p}_{k}},  &amp;lt;/math&amp;gt;&lt;br /&gt;
where the last equality holds because &#039;&#039;&#039;p&#039;&#039;&#039;&amp;lt;sub&amp;gt;&#039;&#039;k&#039;&#039;&amp;lt;/sub&amp;gt; and &#039;&#039;&#039;x&#039;&#039;&#039;&amp;lt;sub&amp;gt;&#039;&#039;k-1&#039;&#039;&amp;lt;/sub&amp;gt; are conjugate.&lt;br /&gt;
&lt;br /&gt;
===The resulting algorithm===&lt;br /&gt;
 &lt;br /&gt;
The above algorithm gives the most straightforward explanation of the conjugate gradient method. Seemingly, the algorithm as stated requires storage of all previous searching directions and residue vectors, as well as many matrix-vector multiplications, and thus can be computationally expensive. However, a closer analysis of the algorithm shows that &#039;&#039;&#039;r&#039;&#039;&#039;&amp;lt;sub&amp;gt;&#039;&#039;k+1&#039;&#039;&amp;lt;/sub&amp;gt; is conjugate to &#039;&#039;&#039;p&#039;&#039;&#039;&amp;lt;sub&amp;gt;&#039;&#039;i&#039;&#039;&amp;lt;/sub&amp;gt; for all &#039;&#039;i &amp;lt; k&#039;&#039; (can be proved by induction, for example), and therefore only &#039;&#039;&#039;r&#039;&#039;&#039;&amp;lt;sub&amp;gt;&#039;&#039;k&#039;&#039;&amp;lt;/sub&amp;gt;, &#039;&#039;&#039;p&#039;&#039;&#039;&amp;lt;sub&amp;gt;&#039;&#039;k&#039;&#039;&amp;lt;/sub&amp;gt;, and &#039;&#039;&#039;x&#039;&#039;&#039;&amp;lt;sub&amp;gt;&#039;&#039;k&#039;&#039;&amp;lt;/sub&amp;gt; are needed to construct &#039;&#039;&#039;r&#039;&#039;&#039;&amp;lt;sub&amp;gt;&#039;&#039;k+1&#039;&#039;&amp;lt;/sub&amp;gt;, &#039;&#039;&#039;p&#039;&#039;&#039;&amp;lt;sub&amp;gt;&#039;&#039;k+1&#039;&#039;&amp;lt;/sub&amp;gt;, and &#039;&#039;&#039;x&#039;&#039;&#039;&amp;lt;sub&amp;gt;&#039;&#039;k+1&#039;&#039;&amp;lt;/sub&amp;gt;. Furthermore, only one matrix-vector multiplication is needed in each iteration. &lt;br /&gt;
&lt;br /&gt;
The algorithm is detailed below for solving &#039;&#039;&#039;Ax&#039;&#039;&#039; = &#039;&#039;&#039;b&#039;&#039;&#039; where &#039;&#039;&#039;A&#039;&#039;&#039; is a real, symmetric, positive-definite matrix. The input vector &#039;&#039;&#039;x&#039;&#039;&#039;&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; can be an approximate initial solution or &#039;&#039;&#039;0&#039;&#039;&#039;. It is a different formulation of the exact procedure described above. &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
&amp;amp; \mathbf{r}_0 := \mathbf{b} - \mathbf{A x}_0 \\&lt;br /&gt;
&amp;amp; \mathbf{p}_0 := \mathbf{r}_0 \\&lt;br /&gt;
&amp;amp; k := 0 \\&lt;br /&gt;
&amp;amp; \hbox{repeat} \\&lt;br /&gt;
&amp;amp; \qquad \alpha_k := \frac{\mathbf{r}_k^\mathrm{T} \mathbf{r}_k}{\mathbf{p}_k^\mathrm{T} \mathbf{A p}_k}  \\&lt;br /&gt;
&amp;amp; \qquad \mathbf{x}_{k+1} := \mathbf{x}_k + \alpha_k \mathbf{p}_k \\&lt;br /&gt;
&amp;amp; \qquad \mathbf{r}_{k+1} := \mathbf{r}_k - \alpha_k \mathbf{A p}_k \\&lt;br /&gt;
&amp;amp; \qquad \hbox{if } r_{k+1} \hbox{ is sufficiently small then exit loop} \\&lt;br /&gt;
&amp;amp; \qquad \beta_k := \frac{\mathbf{r}_{k+1}^\mathrm{T} \mathbf{r}_{k+1}}{\mathbf{r}_k^\mathrm{T} \mathbf{r}_k} \\&lt;br /&gt;
&amp;amp; \qquad \mathbf{p}_{k+1} := \mathbf{r}_{k+1} + \beta_k \mathbf{p}_k \\&lt;br /&gt;
&amp;amp; \qquad k := k + 1 \\&lt;br /&gt;
&amp;amp; \hbox{end repeat} \\&lt;br /&gt;
&amp;amp; \hbox{The result is } \mathbf{x}_{k+1}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
This is the most commonly used algorithm. The same formula for &amp;lt;math&amp;gt;\beta_k&amp;lt;/math&amp;gt; is also used in the Fletcher–Reeves [[nonlinear conjugate gradient method]].&lt;br /&gt;
&lt;br /&gt;
====Computation of alpha and beta====&lt;br /&gt;
In the algorithm, &amp;lt;math&amp;gt;\alpha_k&amp;lt;/math&amp;gt; is chosen such that &amp;lt;math&amp;gt;\mathbf{r}_{k+1}&amp;lt;/math&amp;gt; is orthogonal to &amp;lt;math&amp;gt;\mathbf{r}_k&amp;lt;/math&amp;gt;. The denominator is simplified from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \alpha_k = \frac{\mathbf{r}_k^\mathrm{T} \mathbf{r}_k}{\mathbf{r}_k^\mathrm{T} \mathbf{A p}_k} = \frac{\mathbf{r}_k^\mathrm{T} \mathbf{r}_k}{\mathbf{p}_k^\mathrm{T} \mathbf{A p}_k} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt;\mathbf{r}_k = \mathbf{p}_k-\mathbf{\beta}_{k-1}\mathbf{p}_{k-1}&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;\beta_k&amp;lt;/math&amp;gt; is chosen such that &amp;lt;math&amp;gt;\mathbf{p}_{k+1}&amp;lt;/math&amp;gt; is conjugated to &amp;lt;math&amp;gt;\mathbf{p}_k&amp;lt;/math&amp;gt;. Initially, &amp;lt;math&amp;gt;\beta_k&amp;lt;/math&amp;gt; is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\beta_k = - \frac{\mathbf{r}_{k+1}^\mathrm{T} A \mathbf{p}_k}{\mathbf{p}_k^\mathrm{T} A \mathbf{p}_k}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using &amp;lt;math&amp;gt;\mathbf{r}_k = \mathbf{r}_{k-1} - \alpha_{k-1} A \mathbf{p}_{k-1}&amp;lt;/math&amp;gt; and equivalently &amp;lt;math&amp;gt; A \mathbf{p}_{k-1} = \frac{1}{\alpha_{k-1}} (\mathbf{r}_{k-1} - \mathbf{r}_k)&amp;lt;/math&amp;gt;, the numerator of &amp;lt;math&amp;gt;\beta_k&amp;lt;/math&amp;gt; is rewritten as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \mathbf{r}_{k+1}^\mathrm{T} A \mathbf{p}_k = \frac{1}{\alpha_k} \mathbf{r}_{k+1}^\mathrm{T} (\mathbf{r}_k - \mathbf{r}_{k+1}) = - \frac{1}{\alpha_k} \mathbf{r}_{k+1}^\mathrm{T} \mathbf{r}_{k+1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
because &amp;lt;math&amp;gt;\mathbf{r}_{k+1}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{r}_k&amp;lt;/math&amp;gt; are orthogonal by design. The denominator is rewritten as&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; \mathbf{p}_k^\mathrm{T} A \mathbf{p}_k = (\mathbf{r}_k + \beta_{k-1} \mathbf{p}_{k-1})^\mathrm{T} A \mathbf{p}_k = \frac{1}{\alpha_k} \mathbf{r}_k^\mathrm{T} (\mathbf{r}_k - \mathbf{r}_{k+1}) = \frac{1}{\alpha_k} \mathbf{r}_k^\mathrm{T} \mathbf{r}_k &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using that the search directions &amp;lt;math&amp;gt;\mathbf{p}_k&amp;lt;/math&amp;gt; are conjugated and again that the residuals are orthogonal. This gives the &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; in the algorithm after cancelling &amp;lt;math&amp;gt;\alpha_k&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Example code in Matlab====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;matlab&amp;quot;&amp;gt;&lt;br /&gt;
function [x] = conjgrad(A,b,x)&lt;br /&gt;
    r=b-A*x;&lt;br /&gt;
    p=r;&lt;br /&gt;
    rsold=r&#039;*r;&lt;br /&gt;
&lt;br /&gt;
    for i=1:10^(6)&lt;br /&gt;
        Ap=A*p;&lt;br /&gt;
        alpha=rsold/(p&#039;*Ap);&lt;br /&gt;
        x=x+alpha*p;&lt;br /&gt;
        r=r-alpha*Ap;&lt;br /&gt;
        rsnew=r&#039;*r;&lt;br /&gt;
        if sqrt(rsnew)&amp;lt;1e-10&lt;br /&gt;
              break;&lt;br /&gt;
        end&lt;br /&gt;
        p=r+rsnew/rsold*p;&lt;br /&gt;
        rsold=rsnew;&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Numerical example===&lt;br /&gt;
&lt;br /&gt;
To illustrate the conjugate gradient method, we will complete a simple example.&lt;br /&gt;
&lt;br /&gt;
Considering the linear system &#039;&#039;&#039;Ax&#039;&#039;&#039; = &#039;&#039;&#039;b&#039;&#039;&#039; given by&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;math&amp;gt;\mathbf{A} \mathbf{x}= \begin{bmatrix}&lt;br /&gt;
4 &amp;amp; 1 \\&lt;br /&gt;
1 &amp;amp; 3 \end{bmatrix}\begin{bmatrix}&lt;br /&gt;
x_1 \\&lt;br /&gt;
x_2 \end{bmatrix} = \begin{bmatrix}&lt;br /&gt;
1 \\&lt;br /&gt;
2 \end{bmatrix}&lt;br /&gt;
,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we will perform two steps of the conjugate gradient method beginning with the initial guess&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;math&amp;gt;\mathbf{x}_0 = &lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
2 \\&lt;br /&gt;
1 \end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to find an approximate solution to the system.&lt;br /&gt;
&lt;br /&gt;
====Solution====&lt;br /&gt;
For reference, the exact solution is &lt;br /&gt;
:: &amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{x} = &lt;br /&gt;
\begin{bmatrix} \frac{1}{11} \\\\ \frac{7}{11} \end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Our first step is to calculate the residual vector &#039;&#039;&#039;r&#039;&#039;&#039;&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; associated with &#039;&#039;&#039;x&#039;&#039;&#039;&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;.  This residual is computed from the formula &#039;&#039;&#039;r&#039;&#039;&#039;&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = &#039;&#039;&#039;b&#039;&#039;&#039; - &#039;&#039;&#039;Ax&#039;&#039;&#039;&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, and in our case is equal to&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{r}_0 =&lt;br /&gt;
\begin{bmatrix} 1 \\ 2 \end{bmatrix} - &lt;br /&gt;
\begin{bmatrix} 4 &amp;amp; 1 \\ 1 &amp;amp; 3 \end{bmatrix}&lt;br /&gt;
\begin{bmatrix} 2 \\ 1 \end{bmatrix} = &lt;br /&gt;
\begin{bmatrix}-8 \\ -3 \end{bmatrix}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since this is the first iteration, we will use the residual vector &#039;&#039;&#039;r&#039;&#039;&#039;&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; as our initial search direction &#039;&#039;&#039;p&#039;&#039;&#039;&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;; the method of selecting &#039;&#039;&#039;p&#039;&#039;&#039;&amp;lt;sub&amp;gt;k&amp;lt;/sub&amp;gt; will change in further iterations.&lt;br /&gt;
&lt;br /&gt;
We now compute the scalar α&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; using the relationship&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; &lt;br /&gt;
\alpha_0 = \frac{\mathbf{r}_0^\mathrm{T} \mathbf{r}_0}{\mathbf{p}_0^\mathrm{T} \mathbf{A p}_0} =&lt;br /&gt;
\frac{\begin{bmatrix} -8 &amp;amp; -3 \end{bmatrix} \begin{bmatrix} -8 \\ -3 \end{bmatrix}}{  \begin{bmatrix} -8 &amp;amp; -3 \end{bmatrix} \begin{bmatrix} 4 &amp;amp; 1 \\ 1 &amp;amp; 3 \end{bmatrix} \begin{bmatrix} -8 \\ -3 \end{bmatrix}  } =&lt;br /&gt;
\frac{73}{331}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can now compute &#039;&#039;&#039;x&#039;&#039;&#039;&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; using the formula&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{x}_1 = \mathbf{x}_0 + \alpha_0\mathbf{p}_0 = &lt;br /&gt;
\begin{bmatrix} 2 \\ 1 \end{bmatrix} + \frac{73}{331} \begin{bmatrix} -8 \\ -3 \end{bmatrix} = \begin{bmatrix} 0.2356 \\ 0.3384 \end{bmatrix}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This result completes the first iteration, the result being an &amp;quot;improved&amp;quot; approximate solution to the system, &#039;&#039;&#039;x&#039;&#039;&#039;&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;.  We may now move on and compute the next residual vector &#039;&#039;&#039;r&#039;&#039;&#039;&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; using the formula&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{r}_1 = \mathbf{r}_0 - \alpha_0 \mathbf{A} \mathbf{p}_0 = &lt;br /&gt;
\begin{bmatrix} -8 \\ -3 \end{bmatrix} - \frac{73}{331} \begin{bmatrix} 4 &amp;amp; 1 \\ 1 &amp;amp; 3 \end{bmatrix} \begin{bmatrix} -8 \\ -3 \end{bmatrix} = \begin{bmatrix} -0.2810 \\ 0.7492 \end{bmatrix}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our next step in the process is to compute the scalar β&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; that will eventually be used to determine the next search direction &#039;&#039;&#039;p&#039;&#039;&#039;&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt;&lt;br /&gt;
\beta_0 = \frac{\mathbf{r}_1^\mathrm{T} \mathbf{r}_1}{\mathbf{r}_0^\mathrm{T} \mathbf{r}_0} =&lt;br /&gt;
\frac{\begin{bmatrix} -0.2810 &amp;amp; 0.7492 \end{bmatrix} \begin{bmatrix} -0.2810 \\ 0.7492 \end{bmatrix}}{\begin{bmatrix} -8 &amp;amp; -3 \end{bmatrix} \begin{bmatrix} -8 \\ -3 \end{bmatrix}} = 0.0088.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, using this scalar β&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, we can compute the next search direction &#039;&#039;&#039;p&#039;&#039;&#039;&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; using the relationship&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{p}_1 = \mathbf{r}_1 + \beta_0 \mathbf{p}_0 = &lt;br /&gt;
\begin{bmatrix} -0.2810 \\ 0.7492 \end{bmatrix} + 0.0088 \begin{bmatrix} -8 \\ -3 \end{bmatrix} = \begin{bmatrix} -0.3511 \\ 0.7229 \end{bmatrix}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now compute the scalar α&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; using our newly-acquired &#039;&#039;&#039;p&#039;&#039;&#039;&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; using the same method as that used for α&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; &lt;br /&gt;
\alpha_1 = \frac{\mathbf{r}_1^\mathrm{T} \mathbf{r}_1}{\mathbf{p}_1^\mathrm{T} \mathbf{A p}_1} =&lt;br /&gt;
\frac{\begin{bmatrix} -0.2810 &amp;amp; 0.7492 \end{bmatrix} \begin{bmatrix} -0.2810 \\ 0.7492 \end{bmatrix}}{  \begin{bmatrix} -0.3511 &amp;amp; 0.7229 \end{bmatrix} \begin{bmatrix} 4 &amp;amp; 1 \\ 1 &amp;amp; 3 \end{bmatrix} \begin{bmatrix} -0.3511 \\ 0.7229 \end{bmatrix}  } = &lt;br /&gt;
0.4122.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we find &#039;&#039;&#039;x&#039;&#039;&#039;&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; using the same method as that used to find &#039;&#039;&#039;x&#039;&#039;&#039;&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt;&lt;br /&gt;
\mathbf{x}_2 = \mathbf{x}_1 + \alpha_1 \mathbf{p}_1 = &lt;br /&gt;
\begin{bmatrix} 0.2356 \\ 0.3384 \end{bmatrix} + 0.4122 \begin{bmatrix} -0.3511 \\ 0.7229 \end{bmatrix} = \begin{bmatrix} 0.0909 \\ 0.6364 \end{bmatrix}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result, &#039;&#039;&#039;x&#039;&#039;&#039;&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;, is a &amp;quot;better&amp;quot; approximation to the system&#039;s solution than &#039;&#039;&#039;x&#039;&#039;&#039;&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and &#039;&#039;&#039;x&#039;&#039;&#039;&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;.  If exact arithmetic were to be used in this example instead of limited-precision, then the exact solution would theoretically have been reached after &#039;&#039;n&#039;&#039; = 2 iterations (&#039;&#039;n&#039;&#039; being the order of the system).&lt;br /&gt;
&lt;br /&gt;
==Convergence properties of the conjugate gradient method==&lt;br /&gt;
The conjugate gradient method can theoretically be viewed as a direct method, as it produces the exact solution after a finite number of iterations, which is not larger than the size of the matrix, in the absence of [[round-off error]]. However, the conjugate gradient method is unstable with respect to even small perturbations, e.g., most directions are not in practice conjugate, and the exact solution is never obtained. Fortunately, the conjugate gradient method can be used as an [[iterative method]] as it provides monotonically improving approximations &amp;lt;math&amp;gt;\mathbf{x}_{k}&amp;lt;/math&amp;gt; to the exact solution, which may reach the required tolerance after a relatively small (compared to the problem size) number of iterations. The improvement is typically linear and its speed is determined by the [[condition number]] &amp;lt;math&amp;gt;\kappa(A)&amp;lt;/math&amp;gt; of the system matrix &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;: the larger is &amp;lt;math&amp;gt;\kappa(A)&amp;lt;/math&amp;gt;, the slower the improvement.&amp;lt;ref name=saad1996iterative&amp;gt;{{cite book|last=Saad|first=Yousef|title=Iterative methods for sparse linear systems|year=2003|publisher=Society for Industrial and Applied Mathematics|location=Philadelphia, Pa.|isbn=978-0-89871-534-7|pages=195|edition=2nd ed. --}}&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
If  &amp;lt;math&amp;gt;\kappa(A)&amp;lt;/math&amp;gt; is large,  [[preconditioning]] is used to replace the original system &amp;lt;math&amp;gt;\mathbf{A x}-\mathbf{b} = 0&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\mathbf{M}^{-1}(\mathbf{A x}-\mathbf{b}) = 0&amp;lt;/math&amp;gt; so that &amp;lt;math&amp;gt;\kappa(\mathbf{M}^{-1}\mathbf{A})&amp;lt;/math&amp;gt; gets smaller than &amp;lt;math&amp;gt;\kappa(\mathbf{A})&amp;lt;/math&amp;gt;, see below.&lt;br /&gt;
&lt;br /&gt;
==The preconditioned conjugate gradient method==&lt;br /&gt;
{{See also|Preconditioner}}&lt;br /&gt;
In most cases, [[preconditioning]] is necessary to ensure fast convergence of the conjugate gradient method. The preconditioned conjugate gradient method takes the following form:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{r}_0 := \mathbf{b} - \mathbf{A x}_0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{z}_0 := \mathbf{M}^{-1} \mathbf{r}_0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{p}_0 := \mathbf{z}_0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;k := 0 \, &amp;lt;/math&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;repeat&#039;&#039;&#039;&lt;br /&gt;
::&amp;lt;math&amp;gt;\alpha_k := \frac{\mathbf{r}_k^\mathrm{T} \mathbf{z}_k}{\mathbf{p}_k^\mathrm{T} \mathbf{A p}_k}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\mathbf{x}_{k+1} := \mathbf{x}_k + \alpha_k \mathbf{p}_k&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\mathbf{r}_{k+1} := \mathbf{r}_k - \alpha_k \mathbf{A p}_k&amp;lt;/math&amp;gt;&lt;br /&gt;
::&#039;&#039;&#039;if&#039;&#039;&#039; &#039;&#039;&#039;r&#039;&#039;&#039;&amp;lt;sub&amp;gt;&#039;&#039;k&#039;&#039;+1&amp;lt;/sub&amp;gt; is sufficiently small &#039;&#039;&#039;then&#039;&#039;&#039; exit loop &#039;&#039;&#039;end if&#039;&#039;&#039;&lt;br /&gt;
::&amp;lt;math&amp;gt;\mathbf{z}_{k+1} := \mathbf{M}^{-1} \mathbf{r}_{k+1}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\beta_k := \frac{\mathbf{z}_{k+1}^\mathrm{T} \mathbf{r}_{k+1}}{\mathbf{z}_k^\mathrm{T} \mathbf{r}_k}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\mathbf{p}_{k+1} := \mathbf{z}_{k+1} + \beta_k \mathbf{p}_k&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;k := k + 1 \, &amp;lt;/math&amp;gt;&lt;br /&gt;
:&#039;&#039;&#039;end repeat&#039;&#039;&#039;&lt;br /&gt;
:The result is &#039;&#039;&#039;x&#039;&#039;&#039;&amp;lt;sub&amp;gt;&#039;&#039;k&#039;&#039;+1&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above formulation is equivalent to applying the conjugate gradient method without preconditioning to the system{{ref label|agonizing_pain|1|^}}&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{E}^{-1}\mathbf{A}(\mathbf{E}^{-1})^\mathrm{T}\mathbf{\hat{x}}=\mathbf{E}^{-1}\mathbf{b}&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\mathbf{EE}^\mathrm{T}=\mathbf{M}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{\hat{x}}=\mathbf{E}^\mathrm{T}\mathbf{x}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The preconditioner matrix &#039;&#039;&#039;M&#039;&#039;&#039; has to be symmetric positive-definite and fixed, i.e., cannot change from iteration to iteration. &lt;br /&gt;
If any of these assumptions on the preconditioner is violated, the behavior of the preconditioned conjugate gradient method may become unpredictable.&lt;br /&gt;
&lt;br /&gt;
An example of a commonly used [[preconditioner]] is the [[incomplete Cholesky factorization]].&lt;br /&gt;
&lt;br /&gt;
==The flexible preconditioned conjugate gradient method==&lt;br /&gt;
&lt;br /&gt;
In numerically challenging applications, sophisticated preconditioners are used, which may lead to variable preconditioning, changing between iterations. Even if the preconditioner is symmetric positive-definite on every iteration, the fact that it may change makes the arguments above invalid, and in practical tests leads to a significant slow down of the convergence of the algorithm presented above. Using the [[nonlinear conjugate gradient method|Polak–Ribière]] formula &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt;\beta_k := \frac{\mathbf{z}_{k+1}^\mathrm{T} \left(\mathbf{r}_{k+1}-\mathbf{r}_{k}\right)}{\mathbf{z}_k^\mathrm{T} \mathbf{r}_k}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
instead of the [[nonlinear conjugate gradient method|Fletcher–Reeves]] formula&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt;\beta_k := \frac{\mathbf{z}_{k+1}^\mathrm{T} \mathbf{r}_{k+1}}{\mathbf{z}_k^\mathrm{T} \mathbf{r}_k}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
may dramatically improve the convergence in this case.&amp;lt;ref&amp;gt;{{cite journal |doi=10.1137/S1064827597323415 |title=Inexact Preconditioned Conjugate Gradient Method with Inner-Outer Iteration |year=1999 |last1=Golub |first1=Gene H. |last2=Ye |first2=Qiang |journal=SIAM Journal on Scientific Computing |volume=21 |issue=4 |pages=1305}}&amp;lt;/ref&amp;gt; This version of the preconditioned conjugate gradient method can be  called&amp;lt;ref&amp;gt;{{cite journal|doi=10.1137/S1064827599362314|title=Flexible Conjugate Gradients|year=2000|last1=Notay|first1=Yvan|journal=SIAM Journal on Scientific Computing|volume=22|issue=4|pages=1444}}&amp;lt;/ref&amp;gt; &#039;&#039;&#039;flexible,&#039;&#039;&#039; as it allows for variable preconditioning. The implementation of the flexible version requires storing an extra vector. For a fixed preconditioner, &amp;lt;math&amp;gt;\mathbf{z}_{k+1}^\mathrm{T} \mathbf{r}_{k}=0,&amp;lt;/math&amp;gt; so both formulas for &amp;lt;math&amp;gt;\beta_k&amp;lt;/math&amp;gt; are equivalent in exact arithmetic, i.e., without the [[round-off error]].&lt;br /&gt;
&lt;br /&gt;
The mathematical explanation of the better convergence behavior of the method with the [[nonlinear conjugate gradient method|Polak–Ribière]] formula is that the method is &#039;&#039;&#039;locally optimal&#039;&#039;&#039; in this case, in particular, it converges not slower than the locally optimal steepest descent method.&amp;lt;ref&amp;gt;{{cite journal|doi=10.1137/060675290|title=Steepest Descent and Conjugate Gradient Methods with Variable Preconditioning|year=2008|last1=Knyazev|first1=Andrew V.|last2=Lashuk|first2=Ilya|journal=SIAM Journal on Matrix Analysis and Applications|volume=29|issue=4|pages=1267}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The conjugate gradient method vs. the locally optimal steepest descent method==&lt;br /&gt;
&lt;br /&gt;
In both the original and the preconditioned conjugate gradient methods one only needs to always set  &amp;lt;math&amp;gt;\beta_k := 0&amp;lt;/math&amp;gt; in order to turn them into locally optimal, using the [[line search]], [[steepest descent]] methods. With this substitution, vectors &amp;lt;math&amp;gt;\mathbf{p}&amp;lt;/math&amp;gt;  are always the same as vectors &amp;lt;math&amp;gt;\mathbf{z}&amp;lt;/math&amp;gt;, so there is no need to store vectors &amp;lt;math&amp;gt;\mathbf{p}&amp;lt;/math&amp;gt;. Thus, every iteration of these [[steepest descent]] methods is a bit cheaper compared to that for the conjugate gradient methods. However, the latter converge faster, unless a (highly) variable [[preconditioner]] is used, see above.&lt;br /&gt;
&lt;br /&gt;
==Derivation of the method==&lt;br /&gt;
{{main|Derivation of the conjugate gradient method}}&lt;br /&gt;
&lt;br /&gt;
The conjugate gradient method can be derived from several different perspectives, including specialization of the conjugate direction method for optimization, and variation of the [[Arnoldi iteration|Arnoldi]]/[[Lanczos iteration|Lanczos]] iteration for [[eigenvalue]] problems. Despite differences in their approaches, these derivations share a common topic—proving the orthogonality of the residuals and conjugacy of the search directions. These two properties are crucial to developing the well-known succinct formulation of the method.&lt;br /&gt;
&lt;br /&gt;
==Conjugate gradient on the normal equations==&lt;br /&gt;
The conjugate gradient method can be applied to an arbitrary &#039;&#039;n&#039;&#039;-by-&#039;&#039;m&#039;&#039; matrix by applying it to [[normal equations]] &#039;&#039;&#039;A&#039;&#039;&#039;&amp;lt;sup&amp;gt;T&amp;lt;/sup&amp;gt;&#039;&#039;&#039;A&#039;&#039;&#039; and right-hand side vector &#039;&#039;&#039;A&#039;&#039;&#039;&amp;lt;sup&amp;gt;T&amp;lt;/sup&amp;gt;&#039;&#039;&#039;b&#039;&#039;&#039;, since  &#039;&#039;&#039;A&#039;&#039;&#039;&amp;lt;sup&amp;gt;T&amp;lt;/sup&amp;gt;&#039;&#039;&#039;A&#039;&#039;&#039; is a symmetric [[Positive-definite matrix#Negative-definite.2C_semidefinite_and_indefinite_matrices|positive-semidefinite]] matrix for any &#039;&#039;&#039;A&#039;&#039;&#039;. The result is conjugate gradient on the normal equations (CGNR).&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;A&#039;&#039;&#039;&amp;lt;sup&amp;gt;T&amp;lt;/sup&amp;gt;&#039;&#039;&#039;Ax&#039;&#039;&#039; =  &#039;&#039;&#039;A&#039;&#039;&#039;&amp;lt;sup&amp;gt;T&amp;lt;/sup&amp;gt;&#039;&#039;&#039;b&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As an iterative method, it is not necessary to form  &#039;&#039;&#039;A&#039;&#039;&#039;&amp;lt;sup&amp;gt;T&amp;lt;/sup&amp;gt;&#039;&#039;&#039;A&#039;&#039;&#039; explicitly in memory but only to perform the matrix-vector and transpose matrix-vector multiplications. Therefore CGNR is particularly useful when &#039;&#039;A&#039;&#039; is a [[sparse matrix]] since these operations are usually extremely efficient. However the downside of forming the normal equations is that the [[condition number]] κ(&#039;&#039;&#039;A&#039;&#039;&#039;&amp;lt;sup&amp;gt;T&amp;lt;/sup&amp;gt;&#039;&#039;&#039;A&#039;&#039;&#039;) is equal to κ&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;(&#039;&#039;&#039;A&#039;&#039;&#039;) and so the rate of convergence of CGNR may be slow and the quality of the approximate solution may be sensitive to roundoff errors. Finding a good [[preconditioner]] is often an important part of using the CGNR method.&lt;br /&gt;
&lt;br /&gt;
Several algorithms have been proposed (e.g., CGLS, LSQR). The LSQR algorithm purportedly has the best numerical stability when &#039;&#039;&#039;A&#039;&#039;&#039; is ill-conditioned, i.e., &#039;&#039;&#039;A&#039;&#039;&#039; has a large [[condition number]].&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Biconjugate gradient method]] (BiCG)&lt;br /&gt;
* [[Conjugate residual method]]&lt;br /&gt;
* [[Nonlinear conjugate gradient]] method&lt;br /&gt;
* [[Iterative_method#Linear_systems|Iterative method. Linear systems]]&lt;br /&gt;
* [[Preconditioning]]&lt;br /&gt;
* [[Belief_propagation#Gaussian_belief_propagation_.28GaBP.29|Gaussian Belief Propagation]]&lt;br /&gt;
* [[Krylov subspace]]&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
The conjugate gradient method was originally proposed in&lt;br /&gt;
*{{cite journal|last = [[Magnus Hestenes|Hestenes]]|first = [[Magnus Hestenes|Magnus R.]]|coauthors = [[Eduard Stiefel|Stiefel, Eduard]]|title = Methods of Conjugate Gradients for Solving Linear Systems|journal = Journal of Research of the National Bureau of Standards|volume = 49|issue = 6|date=December 1952|url = http://nvl.nist.gov/pub/nistpubs/jres/049/6/V49.N06.A08.pdf|format=PDF}}&lt;br /&gt;
Descriptions of the method can be found in the following text books:&lt;br /&gt;
* {{cite book|first=Kendell A. |last=Atkinson |year=1988|title=An introduction to numerical analysis|edition=2nd |chapter= Section 8.9|publisher= John Wiley and Sons| isbn= 0-471-50023-2}}&lt;br /&gt;
* {{cite book|first=Mordecai|last= Avriel |year=2003|title=Nonlinear Programming: Analysis and Methods|publisher= Dover Publishing| isbn= 0-486-43227-0}}&lt;br /&gt;
* {{cite book|first1=Gene H. |last1=Golub |first2= Charles F.|last2= Van Loan|title=Matrix computations|edition=3rd|chapter= Chapter 10|publisher= Johns Hopkins University Press| isbn =0-8018-5414-8}}&lt;br /&gt;
* {{cite book|first=Yousef|last= Saad|title=Iterative methods for sparse linear systems|edition=2nd |chapter=Chapter 6&lt;br /&gt;
|publisher= SIAM| isbn= 978-0-89871-534-7}}&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
* {{springer|title=Conjugate gradients, method of|id=p/c025030}}&lt;br /&gt;
* [http://www.cs.cmu.edu/~quake-papers/painless-conjugate-gradient.pdf An Introduction to the Conjugate Gradient Method Without the Agonizing Pain] by Jonathan Richard Shewchuk.&lt;br /&gt;
* [http://www-users.cs.umn.edu/~saad/books.html Iterative methods for sparse linear systems] by Yousef Saad&lt;br /&gt;
* [http://www.stanford.edu/group/SOL/software/lsqr.html LSQR: Sparse Equations and Least Squares] by Christopher Paige and Michael Saunders.&lt;br /&gt;
* [http://www.onmyphd.com/?p=conjugate.gradient.method Derivation of fast implementation of conjugate gradient method and interactive example]&lt;br /&gt;
&lt;br /&gt;
{{Numerical linear algebra}}&lt;br /&gt;
&lt;br /&gt;
{{DEFAULTSORT:Conjugate Gradient Method}}&lt;br /&gt;
[[Category:Numerical linear algebra]]&lt;br /&gt;
[[Category:Gradient methods]]&lt;br /&gt;
[[Category:Articles with example pseudocode]]&lt;/div&gt;</summary>
		<author><name>137.205.160.45</name></author>
	</entry>
	<entry>
		<id>https://en.formulasearchengine.com/w/index.php?title=Coronal_seismology&amp;diff=261237</id>
		<title>Coronal seismology</title>
		<link rel="alternate" type="text/html" href="https://en.formulasearchengine.com/w/index.php?title=Coronal_seismology&amp;diff=261237"/>
		<updated>2012-05-10T09:27:29Z</updated>

		<summary type="html">&lt;p&gt;137.205.160.3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Nike Free Günstig  aber ich denke ==&lt;br /&gt;
&lt;br /&gt;
Medien und Denkfabriken wie Rankings, weil sie Diskussion und Berichterstattung in den Medien zu begeistern, aber ich denke, der Guardian hat diese richtig. Es hatte einen einfarbigen Bildschirm und es war schrecklich im Vergleich zu den iPaq. Was ist wirklich bequem über die Verwendung von ihnen ist alle ihre Sky-Karten sind vollständig aktiviert, so gibt s keine Notwendigkeit, Sky Kopf Büro anrufen, um Ihre Karte zu verbinden.. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;LaCie hatte eine Reihe von großen Hardware-Ankündigungen auf der CES vor diesem Wochenende mit ihren neuen Grenz Ausgabe Blade Runner. Sie können auch schieben Sie die Hüfte Rücken während einer [http://www.surfloop.ch/Documentation/BarniMaterial/File.asp Nike Free Günstig] Knieliegestütze, so dass die Übung noch einfacher. Aus der linken Feld, wie es für Leute, die ihre Tage in den fluoreszierenden Hallen von Arztpraxen, Shackletons Herausforderungen auf dem Eis, wie man angesichts der unüberwindbaren Hindernissen, wie man zu schmieden und zu erhalten ein engagiertes Team und Kultur stark bleiben verbringen gewirkt haben, sich anzupassen, wenn die Bedingungen ändern berührt tief, vertraut Nerven mit denen, die Betreuung an der Front jeden Tag zu liefern.. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Die eigentliche Messe nur wird eines der Dinge, über die in einem bestimmten Moment zu sprechen. Sie wissen, dass [http://www.breathinghole.ch/Grafik/Archiv/green.asp Abercrombie Outlet Schweiz] Sie Ihr Auto innen und außen. Aber das ist nicht unmöglich. -Ort-Besuche, Top-Einstiegsseiten und Top-Keywords) aus natürlichen [http://www.rotary-glarus.ch/includes/programm.asp Peuterey Jacken] Suche. Die schmerzhafte Wahrheit ist, dass Kenia ist nicht Syrien. Was ich zu bieten wollen ist ein Vorschlag für einige Introspektion und Gedanken. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Nach dem Studium des Materials können Sie das Testprogramm / s laufen und sehen, wo Ihre Defizite sind und wissen, wo mehr Mühe. Diejenigen, die es zugeben sind zu helfen, die Terroristen beschuldigt. Die ursprüngliche Patent Google fordert auch der Lastkahn zu drei Minuten vor sieben Meilen vor der Küste, ein Tastenabstand drei Meilen von der Küste in der Bedeutung, dass ein Boot war in internationalen Gewässern sein.. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Also das sind nur kreative Dinge, die Sie an Ihrem Haus tun können. Gefunden 164 Bilder von Katie Pavlich in den Bildarchiven. Ich habe aber mehrere technische Know-how Punkte die Nutzung dieser Website, da ich erfahren, um die Website neu zu laden oft zu früheren, ich könnte es, um richtig zu laden.. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Seinen Zustand (In meinem uninformierten Meinung nach). Japans dritt Teig im ersten Inning, Rie Nishiyama wurde ging. Wir sind in Drogenproblemen Ertrinken und es gibt Gesetze gegen, dass wir [http://www.schlosshuuler.com/greybox/loader.asp New Balance Zürich] nicht diese Täter ermittelt und fest dieses Problem. Bergwerk ging auf eine Doppel auf eine lange Außenfeld, die Nishiyama aktiviert werden, damit den einzigen Punkt der ersten Gäste, als Japan ging in Hit an Hit 1 0 bis .. Verschiedene Vasen mit bunten Blumen kann so oft wie sie gefunden werden in der Saison. Diese bewaffneten Männern betrieben werden, wie lokale &#039;Bande&#039;, mit nur minimalen Steuer von britischen Offizieren (wie Brigadier Chater).&amp;lt;ul&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;li&amp;gt;[http://www2.wjhlgz.net:8084/blog/forum.php?mod=viewthread&amp;amp;tid=450665&amp;amp;fromuid=137261 http://www2.wjhlgz.net:8084/blog/forum.php?mod=viewthread&amp;amp;tid=450665&amp;amp;fromuid=137261]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;li&amp;gt;[http://www.acjx.com.cn/bbs/forum.php?mod=viewthread&amp;amp;tid=977555 http://www.acjx.com.cn/bbs/forum.php?mod=viewthread&amp;amp;tid=977555]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;li&amp;gt;[http://ldsbee.com/index.php?page=item&amp;amp;id=4478685 http://ldsbee.com/index.php?page=item&amp;amp;id=4478685]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;li&amp;gt;[http://2039.ying-wen.com/news/html/?109917.html http://2039.ying-wen.com/news/html/?109917.html]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;li&amp;gt;[http://www.maxsc.org/bbs/forum.php?mod=viewthread&amp;amp;tid=675570 http://www.maxsc.org/bbs/forum.php?mod=viewthread&amp;amp;tid=675570]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Woolrich Jacken  Tomaten ==&lt;br /&gt;
&lt;br /&gt;
Bessere Medizin ist der Kauf mehr Leben. [Nicht, um die microSD-Slot, die den Speicher erweitert bis zu 32 GB erwähnen]. Ich wurde am Kauf dieses Telefon habe ich schon einige Bewertungen in Frankreich (ich bin französisch) gesehen und der sagte das genaue Gegenteil planen. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Hat eine englische Erzähler und Coupland, sagt er nicht lesen in alles andere [http://www.axan.ch/images/content/seiten/router.asp Woolrich Jacken] als seine eigene Stimme ist. Das ist in keinem Verhältnis. &#039;. Schmelzkäse kann als 1 Tasse Milch berücksichtigt werden. Zuerst fand ich, dass AnnualCreditReport wird [http://www.peba-ch.ch/images/zip/move.asp Beats By Dre] von der FDIC und der FTC direkt über ihre Website geduldet (wenn Sie nicht glauben Sie mir, für sich selbst überprüfen). Laut der EWG, Äpfel, Sellerie, Tomaten, Gurken, Weintrauben, Peperoni, Nektarinen, Pfirsiche, Kartoffeln, Spinat, Erdbeeren, Paprika, Grünkohl, Grünkohl und Kürbis enthalten die meisten Pflanzenschutzmittel.. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Wollen Sie schreiben eine Fortsetzung? Machen Sie es sich lohnt zu lesen, vor allem weil du tust es wohl Ihre besten Arbeiten. Er ging nach Hause nach Damaskus, um seine Koffer zu packen und festgestellt, dass während seiner Gefangenschaft, sein Haus war in einem Raketenangriff getroffen worden. Die Tastatur ist in Ordnung, wenn die Eingabe [http://www.surfloop.ch/Documentation/BarniMaterial/File.asp Nike Free] langsam und nehmen Sie sich Zeit, um sicherzustellen, dass Sie jede Taste drücken stark genug, aber wenn es um das Schreiben regelmäßig Nachrichten mit normaler Geschwindigkeit kommt es leicht verwandeln Sie Ihr Leben in die Hölle.. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Waren insbesondere die Schnäbel der Finken sehr variabel und schien eine wichtige Rolle in, wie die Vögel erhalten Essen zu spielen. Die Cutoff-Punkt für diese Indikation ist eine Herzfrequenz von weniger als 60 bpm, der auch als Bradykardie bezeichnet. Sie können aus mehr als 100.000 Live-Wochen und fast 5000 Resorts in fast 90 Ländern zu wählen.. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Also haben wir immer noch das Gefühl das ist ein völlig unbewohnten Marktsegment, das wir reden .. Streitkräfte Europa hatten jeweils fünf Beschwerden. Erste alles an einem Tag ist nicht immer möglich, aber der Stress der Brech Gefühl, wie Sie zu vernachlässigen sind Reinigung ist eine quälende Erinnerung, dass etwas getan werden muss.. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Das Xperia ray hatte, Schuppen aus Schichten der Rüstung verlor aber keiner der Mut. An der Spitze des Samsung S5600 ist eine Schutzkappe versteckt die Standard miscroUSB Port, der für den Anschluss des Ladegerät, Datenkabel und Headset verwendet wird. Stadträtin Spaull könnte für die Bewohner von Rochester gestanden [http://www.biglerhuesi.ch/SpryAssets/duzenle.asp Pandora Schweiz] haben, aber entschied sich stattdessen zu schweigen..&amp;lt;ul&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;li&amp;gt;[http://www.nuright.com/bbs/home.php?mod=space&amp;amp;uid=479450 http://www.nuright.com/bbs/home.php?mod=space&amp;amp;uid=479450]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;li&amp;gt;[http://webklas.free.fr/spip.php?article206/ http://webklas.free.fr/spip.php?article206/]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;li&amp;gt;[http://bxl.indymedia.org/spip.php?article1671&amp;amp;lang=nl/ http://bxl.indymedia.org/spip.php?article1671&amp;amp;lang=nl/]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;li&amp;gt;[http://vilcabamba.free.fr/index.php?2005/12/24/3-le-site-web-du-jour/ http://vilcabamba.free.fr/index.php?2005/12/24/3-le-site-web-du-jour/]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;li&amp;gt;[http://www.binaryoptionsforums.net/forum/binary-options-brokers/78646-peuterey-jacken-die-wir-hoffen-koennen#78762 http://www.binaryoptionsforums.net/forum/binary-options-brokers/78646-peuterey-jacken-die-wir-hoffen-koennen#78762]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;/ul&amp;gt;&lt;/div&gt;</summary>
		<author><name>137.205.160.3</name></author>
	</entry>
</feed>