LION.classical_algorithms.conjugate_gradient¶
- LION.classical_algorithms.conjugate_gradient(matmul_closure, d, x0, max_iter, tol)[source]¶
Solves A x =
dby the conjugate gradient method, A symmetric positive definite, given asmatmul_closure(x)= A x. Starts fromx0; stops aftermax_iteriterations or when the relative residual ||d - A x|| / ||d|| is belowtol. Returns x.