views:

225

answers:

1

Hello!

I am trying to write a function that produces a single solution to an underrepresented system of equations (e.g. the matrix that describes the system is wider than it is tall). In order to do this, I have been looking in the LAPACK documentation for a way to row-reduce a matrix to it's reduced-echelon form, similar to the function rref() in both Mathematica and TI calculators. The closest I came across was http://software.intel.com/en-us/forums/intel-math-kernel-library/topic/53107/ this tiny thread. This thread, however, seems to imply that simply taking the "U" upper triangular matrix (and dividing each row by the diagonal) is the same as the reduced echelon form of a matrix, which I do not believe to be the case. I could code up rref() myself, but I do not believe I could achieve the performance LAPACK is famous for.

1) Is there a better way to simply get any one specific solution to an underrepresented system?
2) If not, is there a way for LAPACK to row-reduce a matrix?

Thanks!

A: 

One often used method for this is the least square solution, see lapack's sgelsx

second
I tried this and it appears to work. Thanks.
Litherum