If m >= n, S3L_gen_lsq finds the least squares solution of an overdetermined system. That is, it solves the least squares problem:
minimize || B - A*X || |
On output, the first n rows of B hold the least squares solution X.
If m < n, S3L_gen_lsq finds the minimum norm solution of an underdetermined system:
A * X = B(1:m,:) |
On output, B holds the minimum norm solution X.