Closed
Description
Description
Consider the following MWE
program main
use stdlib_kinds, only: dp
use stdlib_linalg, only: svd
implicit none
integer, parameter :: m = 2, n = 1
! Sigular value decomposition of A.
real(kind=dp) :: A(n, n)
real(kind=dp) :: U(n, n), S(n), Vt(n, n)
! Random matrix.
call random_number(A)
! Call to stdlib.
call svd(A, S, U, Vt)
end program main
Using gfortran 13.2.0
, I get this run time error:
At line 75528 of file build/dependencies/stdlib/src/stdlib_linalg_lapack_d.F90
Fortran runtime error: Index '2' of dimension 1 of array 'a' above upper bound of 1
Error termination. Backtrace:
#0 0x5621220d2c4a in __stdlib_linalg_lapack_d_MOD_stdlib_dgesdd
at build/dependencies/stdlib/src/stdlib_linalg_lapack_d.F90:75528
#1 0x56212190442b in __stdlib_linalg_MOD_stdlib_linalg_svd_d
at build/dependencies/stdlib/src/stdlib_linalg_svd.f90:483
#2 0x5621218f77c1 in MAIN__
at app/main.f90:15
#3 0x5621218f780c in main
at app/main.f90:2
<ERROR> Execution for object " MWE_stdlib_lstsq " returned exit code 2
<ERROR> *cmd_run*:stopping due to failed executions
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