) 2

1

A¨ $v

² ¬ ( (¨ Y ¬ ©V§ © m

¬

1. Compute . Set and .

!

Y

gg

g W “g y

2. For , until convergence Do:

¢¢

u ©§ y g gg

P ¢ ¢ G ¬ u

3. Compute and ¡

¨ T

¢¢ i ¢ G g ¢ i ¥ ² T £ G ¬ u

gP

g

g

T XY W “ W ¦ P

§¨i P i T G X ¤ ¤ y X T

4. If compute

² u © u u ¬ "U u © © w Xu u ² u y w u u ¨ u u u

5. ¡

u¨Xu

W“

¬ W"U ¨ W ²¨

§§

²

6. Compute

¡

¨

W“

y

7. EndDo

¨ ¡¡µ£ „ ¢

§|5¥ yq¢| ¢ £ ¥§

„ 5| j C¦£¥

5§

C "–© ¡"

§

1B

Vl¬

©§ ²¨

u¨ u¨ u

The residual could also be computed directly as in line 6 of the

W"U W"U "U

W

algorithm, but this would require an additional matrix-vector product.

©'#G ¡078 I C¡¡5 5 ¦ & 7¤¥P5 ¦75

¨6¡ ¢ 8 E B

B AF

I 3 F5 A )Q5 H A

§

F 6EP5 2DB ¡5 ' )

A B)

Sometimes, it is useful to be able to obtain the tridiagonal matrix related to the un- ¢

derlying Lanczos iteration from the coef¬cients of the Conjugate Gradient algorithm 6.17.

§

This tridiagonal matrix can provide valuable eigenvalue information on the matrix . For

example, the largest and smallest eigenvalues of the tridiagonal matrix can approximate

§

the smallest and largest eigenvalues of . This could be used to compute an estimate of

§

the condition number of which in turn can help provide estimates of the error norm from

R RS

the residual norm. Since the Greek letters and have been used in both algorithms,

notations must be changed. Denote by

¬ u ¦¨( u X ( u $¦ ¦ 54 4 ¤ £

H (&

¢

"U

W

the tridiagonal matrix (6.63) associated with the -th step of the Lanczos algorithm. We !

QX ( u ¦

u u e( u

must seek expressions of the coef¬cients in terms of the coef¬cients , obtained S

from the CG algorithm. The key information regarding the correspondence between the

two pairs of coef¬cients resides in the correspondence between the vectors generated by

the two algorithms. From (6.66) it is known that

r± „ ®

i

¬ ¥

u¨ u¦

scalar

’U

W

T T

As a result,

X Xu u T

§¬ §¬

u ¦ ( u §T ¦ ¨( ©¨

uX X W"U u "U u Xu u

W

T ¦

¦( ¨( ¨

"U

W

’U

W

"U

W

Xu u

¨( ¨ T

The denominator is readily available from the coef¬cients of the CG algorithm, but

Xu u

§

the numerator is not. The relation (6.72) can be exploited to obtain

¨ ( ¨©

r± „ ®

i

² u ¬ Xu ¨ uS u

T ¡ ¡

W“ W“

§X uT ¨ ( T u ©

which is then substituted in to get

¨

T

X X

§ ²u § ¬ ²

u¨( u§ uS u u ¢( uS u

¨

¡ ¡ ¡ ¡

W“ W“ W“ W“

}

¬