thomas algorithm can be used to solve