1

I am trying to use the Intel LAPACK library to find the QR factorization of a randomly generated matrix. I want the program to find the two matrices, Q and R. But, I'm having issues with the LAPACK documentation in trying to find out how or which routines can actually provide this functionality.

dgeqrfp looks like the right function to use, but it says it doesn't return Q explicitly.

This is my first time using LAPACK, so any help in trying to get this going would be very helpful. Thanks.

user1362058
  • 751
  • 1
  • 5
  • 14
  • 2
    Possible duplicate of [Solving a linear system with Lapack's dgeqrf\_](http://stackoverflow.com/questions/21970510/solving-a-linear-system-with-lapacks-dgeqrf) – DYZ Apr 28 '17 at 21:14
  • @DYZ That is definitely a similar question but using c++ and I don't understand it. I tried getting it to work in C and couldn't get it to work. I guess I'm looking for someone to explain it in C so I can understand how it works. – user1362058 Apr 28 '17 at 22:20
  • But please look at the first answer. LAPACK is a C library, and they actually use it in a C way. – DYZ Apr 28 '17 at 22:21
  • @DYZ Ok, I'll have to look into it a little deeper to figure out why my implementation of that answer didn't work then. Thanks. – user1362058 Apr 28 '17 at 22:44

1 Answers1

0

Use dorgqr to produce the Q matrix.

Documentation on dorgqr

soegaard
  • 30,661
  • 4
  • 57
  • 106