Iterative method for solving linear equations