Just the minimal changes to qr_solve.cpp and .h to get rid of malloc() and free(). Saves about 656 bytes of progmem (library-code) and 22 bytes for static variables. Should use exactly the same amount of stack as it did before on the heap.
Changed level to compensation
The code for the LSQ solver (qr_solve) is copyrighted by John Burkardt and released under LGPL here: http://people.sc.fsu.edu/~%20jburkardt/c_src/qr_solve/qr_solve.html (see qr_solve.cpp for further copyright information)