Skip to content

Commit

Permalink
fix svd
Browse files Browse the repository at this point in the history
  • Loading branch information
jvdp1 committed Oct 18, 2024
1 parent 91dcc50 commit e244e13
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/stdlib_linalg_svd.fypp
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,11 @@ submodule(stdlib_linalg) stdlib_linalg_svd
if (info==0) then
!> Prepare working storage
lwork = nint(real(work_dummy(1),kind=${rk}$), kind=ilp)
! Check if the returned working storage space is smaller than the largest value
! allowed by lwork
lwork = merge(nint(real(work_dummy(1),kind=${rk}$), kind=ilp) &
, huge(lwork) &
, real(work_dummy(1),kind=${rk}$) < real(huge(lwork),kind=${rk}$) )
allocate(work(lwork))
!> Compute SVD
Expand Down

0 comments on commit e244e13

Please sign in to comment.