From 17add36bdac7e0093ba993ced16e62d30cb4d7b7 Mon Sep 17 00:00:00 2001 From: ydamour Date: Tue, 17 Jan 2023 09:49:14 +0100 Subject: [PATCH] remove error, replace symmetry condition --- src/utils/linear_algebra.irp.f | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/utils/linear_algebra.irp.f b/src/utils/linear_algebra.irp.f index 9517766e..20599325 100644 --- a/src/utils/linear_algebra.irp.f +++ b/src/utils/linear_algebra.irp.f @@ -1835,13 +1835,21 @@ subroutine restore_symmetry_fast(m,n,A,LDA,thresh) ! Sort call dsort(copy,key,sze) + !TODO + ! Parallelization with OMP + + ! Jump all the elements below thresh + i = 1 + do while (copy(i) <= thresh) + i = i + 1 + enddo + ! Symmetrize - i = 1 do while(i < sze) pi = i pf = i - val = copy(i) - do while (dabs(val - copy(pf+1)) < thresh2) + val = 1d0/copy(i) + do while (dabs(val * copy(pf+1) - 1d0) < thresh2) pf = pf + 1 ! if pf == sze, copy(pf+1) will not be valid if (pf == sze) then