(Difference between revisions)
 Revision as of 14:56, 27 July 2006 (view source)Derouler (Talk | contribs)m (→Reference)← Older edit Latest revision as of 15:04, 27 July 2006 (view source)Derouler (Talk | contribs) m (→Algorithm: Made the use of = and := consistent) (One intermediate revision not shown) Line 16: Line 16: :
:
:  r := b - A$\cdot$x
:  r := b - A$\cdot$x
- :  rtilde = r
+ :  rtilde := r
:
:
:  for i := 1 step 1 until max_itr do :  for i := 1 step 1 until max_itr do ::      solve (M$\cdot$z = r )
::      solve (M$\cdot$z = r )
::      solve (MT$\cdot$ztilde = rtilde )
::      solve (MT$\cdot$ztilde = rtilde )
- ::      rho_1 = z$\cdot$rtilde
+ ::      rho_1 := z$\cdot$rtilde
::      if i = 1 then ::      if i = 1 then :::        p := z
:::        p := z
:::        ptilde := ztilde
:::        ptilde := ztilde
::        else
::        else
- :::        beta = (rho_1/rho_2)
+ :::        beta := (rho_1/rho_2)
- :::        p = z + beta * p
+ :::        p := z + beta * p
- :::        ptilde = ztilde + beta * ptilde
+ :::        ptilde := ztilde + beta * ptilde
::      end if
::      end if
::      q := A$\cdot$p
::      q := A$\cdot$p
::      qtilde := AT$\cdot$ptilde
::      qtilde := AT$\cdot$ptilde
- ::      alpha = rho_1 / (ptilde$\cdot$q)
+ ::      alpha := rho_1 / (ptilde$\cdot$q)
- ::      x = x + alpha * p
+ ::      x := x + alpha * p
- ::      r = r - alpha * q
+ ::      r := r - alpha * q
- ::      rtilde = rtilde - alpha * qtilde
+ ::      rtilde := rtilde - alpha * qtilde
- ::      rho_2 = rho_1
+ ::      rho_2 := rho_1
:  end (i-loop) :  end (i-loop) :

Line 42: Line 42: :  return TRUE
:  return TRUE
---- ---- - === Reference === === Reference === - #'''Richard Barret, Michael Berry, Tony F. Chan, James Demmel, June M. Donato, Jack Dongarra, Victor Eijihout, Roldan Pozo, Charles Romine, Henk Van der Vorst''', "Templates for the Solution of Linear Systems: Building Blocks for Iterative Methods", Philadelphia, PA: SIAM, 1994. [http://www.netlib.org/linalg/html_templates/Templates.html | http://www.netlib.org/linalg/html_templates/Templates.html] + #'''Richard Barret, Michael Berry, Tony F. Chan, James Demmel, June M. Donato, Jack Dongarra, Victor Eijihout, Roldan Pozo, Charles Romine, Henk Van der Vorst''', "Templates for the Solution of Linear Systems: Building Blocks for Iterative Methods", Philadelphia, PA: SIAM, 1994. [http://www.netlib.org/linalg/html_templates/node32.html | http://www.netlib.org/linalg/html_templates/Templates.html] ---- ---- Return to [[Numerical methods | Numerical Methods]] Return to [[Numerical methods | Numerical Methods]]

## Contents

Biconjugate gradient method could be summarized as follows

### System of equation

For the given system of equation
Ax = b ;
b = source vector
x = solution variable for which we seek the solution
A = coefficient matrix

M = the preconditioning matrix constructed by matrix A

### Algorithm

Allocate temperary vectors r,z,p,q, rtilde,ztilde,qtilde
Allocate temerary reals rho_1, rho_2 , alpha, beta

r := b - A$\cdot$x
rtilde := r

for i := 1 step 1 until max_itr do
solve (M$\cdot$z = r )
solve (MT$\cdot$ztilde = rtilde )
rho_1 := z$\cdot$rtilde
if i = 1 then
p := z
ptilde := ztilde
else
beta := (rho_1/rho_2)
p := z + beta * p
ptilde := ztilde + beta * ptilde
end if
q := A$\cdot$p
qtilde := AT$\cdot$ptilde
alpha := rho_1 / (ptilde$\cdot$q)
x := x + alpha * p
r := r - alpha * q
rtilde := rtilde - alpha * qtilde
rho_2 := rho_1
end (i-loop)

deallocate all temp memory
return TRUE

### Reference

1. Richard Barret, Michael Berry, Tony F. Chan, James Demmel, June M. Donato, Jack Dongarra, Victor Eijihout, Roldan Pozo, Charles Romine, Henk Van der Vorst, "Templates for the Solution of Linear Systems: Building Blocks for Iterative Methods", Philadelphia, PA: SIAM, 1994. | http://www.netlib.org/linalg/html_templates/Templates.html