Previous Up Next

6.60.4  Algorithme du gradient conjugué : conjugate_gradient

conjugate_gradient(A,y,x0,eps) met en œuvre l’algorithme du gradient conjugué pour résoudre A*x=y à eps près, lorsque A est une matrice symétrique définie positive et x0 une solution initiale approchée optionnelle.
On tape :

conjugate_gradient([[2,1],[1,5]],[1,0])

On obtient :

[5/9,-1/9]

On tape :

conjugate_gradient([[2,1],[1,5]],[1,0],[0.55,-0.11],1e-2)

On obtient :

[0.555,-0.11]

On tape :

conjugate_gradient([[2,1],[1,5]],[1,0],[0.55,-0.11],1e-10)

On obtient :

[0.555555555556,-0.111111111111]

Previous Up Next