A direct method for the general solution of a system of linear equations

A computationally stable method for the general solution of a system of linear equations is given. The system isATx−B=0, where then-vectorx is unknown and then×q matrixA and theq-vectorB are known. It is assumed that the matrixAT and the augmented matrix [AT,B] are of the same rankm, wherem≤n, so that the system is consistent and solvable. Whenm<n, the method yields the minimum modulus solutionxm and a symmetricn ×n matrixHm of rankn−m, so thatx=xm+Hmy satisfies the system for ally, ann-vector. Whenm=n, the matrixHm reduces to zero andxm becomes the unique solution of the system.The method is also suitable for the solution of a determined system ofn linear equations. When then×n coefficient matrix is ill-conditioned, the method can produce a good solution, while the commonly used elimination method fails.