mirror of
https://github.com/QuantumPackage/qp2.git
synced 2025-01-03 00:55:38 +01:00
fix segfault restore_symmetry if all elem > thresh
This commit is contained in:
parent
6d5d8701c8
commit
ce236f4d24
@ -1736,7 +1736,7 @@ subroutine restore_symmetry(m,n,A,LDA,thresh)
|
|||||||
|
|
||||||
! Symmetrize
|
! Symmetrize
|
||||||
i = 1
|
i = 1
|
||||||
do while( (i < sze).and.(-copy(i) > thresh) )
|
do while (i < sze)
|
||||||
pi = i
|
pi = i
|
||||||
pf = i
|
pf = i
|
||||||
val = 1d0/copy(i)
|
val = 1d0/copy(i)
|
||||||
@ -1760,6 +1760,10 @@ subroutine restore_symmetry(m,n,A,LDA,thresh)
|
|||||||
! Update i
|
! Update i
|
||||||
i = pf
|
i = pf
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
! Exit if the remaining elements are below thresh
|
||||||
|
if (-copy(i) <= thresh) exit
|
||||||
|
|
||||||
! Update i
|
! Update i
|
||||||
i = i + 1
|
i = i + 1
|
||||||
enddo
|
enddo
|
||||||
|
Loading…
Reference in New Issue
Block a user