mirror of
https://github.com/LCPQ/quantum_package
synced 2025-01-03 18:16:12 +01:00
Acceleration of pt2_find
This commit is contained in:
parent
848fda1836
commit
832585a6ca
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user