stdlib icon indicating copy to clipboard operation
stdlib copied to clipboard

Pivoting QR decomposition

Open loiseaujc opened this issue 2 months ago • 4 comments

Following #930, this PR extends the qr interface to enable the computation of the QR factorization with column pivoting. It is based on the xGEQP3 driver from lapack.

Proposed interfaces

  • call qr(a, q, r, pivots [, overwrite_a, storage, err])

where a is the matrix to be factorized, q the orthonormal basis for colspan(a), r the upper triangular matrix and pivots an integer array with indices of the pivoted columns.

Progress

  • [x] Interface
  • [x] Base implementation
  • [x] Tests
  • [x] In-code documentation
  • [x] Specifications
  • [x] Example

Ping: @perazz, @jvdp1, @jalvesz

loiseaujc avatar Oct 20 '25 12:10 loiseaujc

I think this PR is almost ready to be reviewed. I have the specs left to write but this should pretty quick as it mainly is a small modification of the qr specs. I'll try to do that by the end of the week. It seems like there is a small issue with the unbuntu-22.04/cmake/inter-classic 2021.10 setup though. Not sure what it is and I don't have the intel compilers on my laptop so I can't really dig into it at the moment.

loiseaujc avatar Oct 22 '25 10:10 loiseaujc

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :warning: Please upload report for BASE (master@9e4c230). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1045   +/-   ##
=========================================
  Coverage          ?   25.12%           
=========================================
  Files             ?      570           
  Lines             ?   234201           
  Branches          ?    41276           
=========================================
  Hits              ?    58854           
  Misses            ?   175347           
  Partials          ?        0           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Nov 04 '25 14:11 codecov[bot]

Modulo the issue with the unbuntu-22.04/cmake/intel-classic 2021.10 setup which I haven't been able to investigate yet, this PR is ready for review.

loiseaujc avatar Nov 05 '25 09:11 loiseaujc

For the build unbuntu-22.04, cmake, intel-classic 2021-10, it seems the computations are successful (at least according to the linalg_state_type returned) but when comparing A and QR P.T, the test fails. Without having this particular intel compiler on my laptop I unfortunately can't say much more than that.

loiseaujc avatar Nov 10 '25 14:11 loiseaujc