conjugate gradient method to solve linear systems