According the documentation, DORMQR forms e.g. the product QC, overwriting the result on C (which may be any real rectangular matrix). Assume Q is m x n. Then, to be able to form the product, C must be n x p, and the result will be m x p. The documentation tells that the third argument M shall be the number of rows of C and the fourth argument shall be the number of columns of C. Finally, argument 9 shall be the matrix C, and C will be overwritten by the result, i.e. QC.

Under the above assumption, my interpretation is that M = n and N = p. But the result, overwritten C, is m x p. If m > n, as is often the case (recall that Q is assumed to come from DGEQRF), it implies that a matrix with m > n rows will overwrite a matrix with n rows, which cannot work - there would not be space enough. So I conclude that the above choice of M and N is incorrect. Should I put M = m instead? But this violates the actual number of rows in C. So what

is the correct value of M ?

I am really looking forward to your answer with extremely great interest, so I (and other users) may be able to use the routine.

Best regards,

Roger Andersson