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

heap sort

This commit is contained in:
Anthony Scemama 2017-05-05 00:19:33 +02:00
parent e0812d4b41
commit 73ce5610b3
2 changed files with 6 additions and 6 deletions

View File

@ -51,7 +51,7 @@ subroutine sort_selection_buffer(b)
allocate(iorder(b%cur), detmp(N_int, 2, size(b%det,3)), absval(b%cur), vals(size(b%val))) allocate(iorder(b%cur), detmp(N_int, 2, size(b%det,3)), absval(b%cur), vals(size(b%val)))
absval = -dabs(b%val(:b%cur)) absval = b%val(:b%cur)
do i=1,b%cur do i=1,b%cur
iorder(i) = i iorder(i) = i
end do end do

View File

@ -202,11 +202,11 @@ BEGIN_TEMPLATE
if (isize < 2) then if (isize < 2) then
return return
endif endif
call sorted_$Xnumber(x,isize,n) ! call sorted_$Xnumber(x,isize,n)
if (isize == n) then ! if (isize == n) then
return ! return
endif ! endif
if ( isize < 32+n) then if ( isize < 16) then
call insertion_$Xsort(x,iorder,isize) call insertion_$Xsort(x,iorder,isize)
else else
call heap_$Xsort(x,iorder,isize) call heap_$Xsort(x,iorder,isize)