10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-07-03 01:45:59 +02:00

Acceleration of pt2_find

This commit is contained in:
Anthony Scemama 2017-02-01 15:17:50 +01:00
parent 848fda1836
commit 832585a6ca

View File

@ -284,9 +284,9 @@ integer function pt2_find(v, w, sze, imin, imax)
integer :: i,l,h integer :: i,l,h
l = imin l = imin
h = imax-1 h = imax
do while(h >= l) do while(h-l > 4)
i = ishft(h+l,-1) i = ishft(h+l,-1)
if(w(i+1) > v) then if(w(i+1) > v) then
h = i-1 h = i-1
@ -294,7 +294,14 @@ integer function pt2_find(v, w, sze, imin, imax)
l = i+1 l = i+1
end if end if
end do end do
pt2_find = l+1 do i=l,h
if ( w(i) <= v) then
cycle
else
pt2_find = i-1
return
endif
enddo
end function end function