Skip to content

Conversation

@scr2016
Copy link
Contributor

@scr2016 scr2016 commented Oct 29, 2022

Description
added new routines [S,D,C,Z]GELST and test code for the least squares
squares algorithm that solves overdetermined or underdetermined systems for GE matrices using QR or LQ factorization with compact WY representation of Q inside the routine.

*GELST is similar to *GELS, but unlike *GELS does not compute triangular blocks twice, i.e. runs faster.

modified: SRC/Makefile
new file: SRC/cgelst.f
new file: SRC/dgelst.f
new file: SRC/sgelst.f
new file: SRC/zgelst.f
modified: TESTING/LIN/alahd.f
modified: TESTING/LIN/cdrvls.f
modified: TESTING/LIN/cerrls.f
modified: TESTING/LIN/ddrvls.f
modified: TESTING/LIN/derrls.f
modified: TESTING/LIN/sdrvls.f
modified: TESTING/LIN/serrls.f
modified: TESTING/LIN/zdrvls.f

squares algorithm that solves overdetermined or underdetermined systems for
GE matrices using QR or LQ factorization with compact WY representation
of Q inside the routine.

*GELST is similar to *GELS, but unlike *GELS does not compute triangular blocks
twice, i.e. runs faster.

modified:   SRC/Makefile
new file:   SRC/cgelst.f
new file:   SRC/dgelst.f
new file:   SRC/sgelst.f
new file:   SRC/zgelst.f
modified:   TESTING/LIN/alahd.f
modified:   TESTING/LIN/cdrvls.f
modified:   TESTING/LIN/cerrls.f
modified:   TESTING/LIN/ddrvls.f
modified:   TESTING/LIN/derrls.f
modified:   TESTING/LIN/sdrvls.f
modified:   TESTING/LIN/serrls.f
modified:   TESTING/LIN/zdrvls.f
@scr2016 scr2016 self-assigned this Oct 29, 2022
@scr2016 scr2016 requested a review from langou October 29, 2022 11:07
@angsch
Copy link
Collaborator

angsch commented Oct 29, 2022

@scr2016 Is there a particular reason why your changes are a separate routine and not an upgrade of GELS? Your changes appear fully compatible with GELS and could be a great modernization that could be widely picked up by, say, octave or Julia, which likely call GELS as the de facto standard LS solver.

Edit: I mixed up geqrt and geqrt3. Sorry. Have you considered interleaving the QR factorization and the transform of B, which reduces the workspace to a single triangular factor? Sketched for QR, $m \geq n$:

do i = 1, nb
  ib = min(nb,n-i+1) ! No special treatment of the last block
  ! Compute QR factorization of panel A(i:end, i:i+ib-1)
  call geqrt()
  ! Trailing matrix update H**T * A(i:m,i+ib:n)
  call larfb()
  ! Transform H**T * B(i:m,1:nrhs)
  call larfb()

Then your change is really fully compatible with GELS

@dbielich
Copy link
Contributor

dbielich commented Nov 4, 2022

I see edits to all TESTING/LIN/Xerrls.f files except TESTING/LIN/zerrls.f.

So there is no way to check any errors from the double complex code currently.

modified TESTING/LIN/zerrls.f accordingly. Also fixed comments typo in
[S,D,C,Z]GELST.
modified:   SRC/cgelst.f
modified:   SRC/dgelst.f
modified:   SRC/sgelst.f
modified:   SRC/zgelst.f
modified:   TESTING/LIN/zerrls.f
@langou langou merged commit e725304 into Reference-LAPACK:master Nov 10, 2022
@julielangou julielangou added this to the LAPACK 3.11.0 milestone Nov 12, 2022
@abiiget765
Copy link

verify-elf: ERROR: ./usr/lib64/liblapack.so.3.12.0: undefined symbol: cdotc_64_
verify-elf: ERROR: ./usr/lib64/liblapack.so.3.12.0: undefined symbol: zherk_64_
verify-elf: ERROR: ./usr/lib64/liblapack.so.3.12.0: undefined symbol: ctpmv_64_
verify-elf: ERROR: ./usr/lib64/liblapack.so.3.12.0: undefined symbol: sgemv_64_
verify-elf: ERROR: ./usr/lib64/liblapack.so.3.12.0: undefined symbol: strsm_64_
verify-elf: ERROR: ./usr/lib64/liblapack.so.3.12.0: undefined symbol: cdotu_64_
verify-elf: ERROR: ./usr/lib64/liblapack.so.3.12.0: undefined symbol: cgbmv_64_
verify-elf: ERROR: ./usr/lib64/liblapack.so.3.12.0: undefined symbol: ssbmv_64_
verify-elf: ERROR: ./usr/lib64/liblapack.so.3.12.0: undefined symbol: zher2_64_
verify-elf: ERROR: ./usr/lib64/liblapack.so.3.12.0: undefined symbol: zgerc_64_
verify-elf: ERROR: ./usr/lib64/liblapack.so.3.12.0: undefined symbol: ctpsv_64_
verify-elf: ERROR: ./usr/lib64/liblapack.so.3.12.0: undefined symbol: dgemv_64_
verify-elf: ERROR: ./usr/lib64/liblapack.so.3.12.0: undefined symbol: dtbsv_64_
verify-elf: ERROR: ./usr/lib64/liblapack.so.3.12.0: undefined symbol: ztrmm_64_
verify-elf: ERROR: ./usr/lib64/liblapack.so.3.12.0: undefined symbol: ztbsv_64_
verify-elf: ERROR: ./usr/lib64/liblapack.so.3.12.0: undefined symbol: cherk_64_
verify-elf: ERROR: ./usr/lib64/liblapack.so.3.12.0: undefined symbol: zaxpy_64_

@martin-frbg
Copy link
Collaborator

probably same as #1147 - if you're building with a non-default BLAS you need to make sure that it has the 64bit integer versions of the functions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants