Question about an old IMSL routine LEQT2F

I’m trying to recreate a program I wrote in grad school about 40 years ago that used the IMSL LEQT2F routine to solve an overdetermined matrix system. Unfortunately I can’t find any mention of the routine on the current IMSL documentation. I think it’s been replaced by a newer routine. My main question is does anyone know what the underlying solution method (QR, normal equations/LU factorization etc) was used in this routine. I presume there are equivalent routines in LAPACK, MKL etc.

1 Like

ChatGPT, citing a 1982 NASA report, says

LEQT2F was not (by itself) an “overdetermined least-squares” solver. In the older IMSL Fortran libraries it is documented as:

  • “Linear equation solution - full storage mode - high accuracy solution” (i.e., it solves a square system A X = B).

  • Internally it used an LU decomposition via the Crout algorithm, with an optional accuracy test and iterative improvement (refinement).

So the underlying method was LU factorization (Crout variant) + optional iterative refinement, not QR.

1 Like

@Beliavsky, Thanks. You are correct. I took a closer look at the code and found the theory writeup I did on it that I had stored separate from the code listing. The system matrix solved by LEQT2F was formed from the normal equations. I was thrown by the comment I had in the code about solving an overdetermined system. Amazing how much you can forget in a mere 40 years :grinning_face:

1 Like