Solve a linear system with the preconditioned conjugated-gradient method. [x] = conjugategradient(fun,b,tol,maxit,pc,pc2,x0); [x,Q,T] = conjugategradient(fun,b,tol,maxit,pc,pc2,x0); solves for x A x = b using the preconditioned conjugated-gradient method. It provides also an approximation of A: A \sim Q*T*Q' J(x) = 1/2 (x' b - x' A x) ∇ J = b - A x A x = b - ∇ J b = ∇ J(0) the columns of Q are the Lanczos vectors
Package: divand