QR decomposition method for finding the root of linear equations