Reference-LAPACK / lapack

LAPACK development repository
Other
1.46k stars 430 forks source link

fix fails of tests for QR/LQ factorizations #1005

Open dklyuchinskiy opened 3 months ago

dklyuchinskiy commented 3 months ago

Fix fails of tests for QR/LQ factorizations

Hello! This PR is willing to close issue #973.

Briefly speaking, there are some problems, recently appeared after Release 3.12. Functions GELQS/GEQRS were made DEPRECATED and have been replaced by GELS in tests of QR/LQ factorizations. But,

  1. GELS calls specific factorization depending on input size: QR for m >= n and LQ for m < n. Test does not take into account this knowledge and wrong factorization can be called for specific parameters m and n.
  2. Even if parameters, passed to GELS are correct, test can be also failed for matrices near overflow/underflow. I believe, that it happens, since GELS calls scaling routines inside, but previous version GELQS/GEQRS does not. Behavior is also changed in that way.

It is important to point out, that test is failed on the next iteration of parameter K while data is improperly changed on the first iteration. That's why fails are reproduced only on fixed input file.

Thinking of solution, I suggest to call the correct factorization on each iteration of inner loop for parameter K. It will solve any problems, related to occasionally changed data inside the test. Maybe this solution is not fully optimal, since it does not restrict any inputs into GELS, but it can be discussed.