-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
svd
not working for matrices with a single column
#835
Comments
@loiseaujc I noticed that in your mwe you use only |
Oups, my bad. I'll have to double check in |
Actually, if program main
use stdlib_kinds, only: dp
use stdlib_linalg, only: svd
implicit none
integer, parameter :: m = 1, n = 1
! Sigular value decomposition of A.
real(kind=dp) :: A(m, n)
real(kind=dp) :: U(m, m), S(n), Vt(n, n)
! Random matrix.
call random_number(A)
! Call to stdlib.
call svd(A, S, U, Vt)
end program main |
Sorry all for the late reply, I'm abroad on business travel the whole week. The error apparently comes from a LAPACK limitation, as ! produce r in a, zeroing out other entries
call stdlib_dlaset( 'L', n-1, n-1, zero, zero, a( 2, 1 ), lda ) but it should not take place as the requirement is EDIT: Yes: that code segment is called part of this branch: if( m>=n ) then
! a has at least as many rows as columns. if a has sufficiently
! more rows than columns, first reduce using the qr
! decomposition (if sufficient workspace available) so all provided matrix sizes are OK according to the inputs. |
Oh I see. I was using |
I think we need to fix this @loiseaujc, |
Description
Consider the following MWE
Using
gfortran 13.2.0
, I get this run time error:Expected Behaviour
Computing the SVD of a column vector is admittedly a contrived example but this piece of code is part of larger subroutine in
LightKrylov
iteratively computing the SVD of large-scale matrices using Lanczos Bidiagonalization. Note that if a row vector is considered instead of a column vector, the MWE runs perfectly.Pinging @perazz, @jalvesz, @jvdp1.
Version of stdlib
0.6.1
Platform and Architecture
Linux with Ubuntu 22.04
Additional Information
No response
The text was updated successfully, but these errors were encountered: