Module iterative_methods::conjugate_gradient[][src]

Expand description

Implementation of conjugate gradient following lecture notes by Shen. Thanks Shen!

Pseudo code: Set r_0 = Ax_0 - b and p_0 =-r_0, k=0 while r_k != 0: alpha_k = ||r_k||^2 / ||p_k||^2_A x_{k+1} = x_k + alpha_kp_k r_{k+1} = r_K + alpha_kAp_k beta_k = ||r_{k+1}||^2 / ||r_k||^2 p_{k+1} = -r_k + beta_k * p_k k += 1

Structs

ConjugateGradient

Store the state of a conjugate gradient computation.