Skip to content

Commit

Permalink
Fix bug in complex svd
Browse files Browse the repository at this point in the history
  • Loading branch information
scemama committed Jan 26, 2024
1 parent b91eb88 commit c0a4b78
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/linear_algebra.irp.f
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ subroutine get_pseudo_inverse_complex(A,LDA,m,n,C,LDC,cutoff)
END_DOC
integer, intent(in) :: m,n, LDA, LDC
complex*16, intent(in) :: A(LDA,n)
double precision, intent(in) :: cutoff
double precision, intent(in) :: cutoff, d1
complex*16, intent(out) :: C(LDC,m)

double precision, allocatable :: D(:), rwork(:)
Expand Down Expand Up @@ -673,8 +673,9 @@ subroutine get_pseudo_inverse_complex(A,LDA,m,n,C,LDC,cutoff)
stop 1
endif

d1 = D(1)
do i=1,n
if (D(i) > cutoff*D(1)) then
if (D(i) > cutoff*d1) then
D(i) = 1.d0/D(i)
else
D(i) = 0.d0
Expand Down

0 comments on commit c0a4b78

Please sign in to comment.