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

Fixed selection sort

This commit is contained in:
Anthony Scemama 2017-04-19 15:44:24 +02:00
parent 1ac36ab762
commit 9b4131139b

View File

@ -318,13 +318,11 @@ BEGIN_TEMPLATE
xtmp = x(i)
i0 = iorder(i)
j = i-1_8
do j=i-1_8,1_8,-1_8
if ( x(j) > xtmp ) then
x(j+1_8) = x(j)
iorder(j+1_8) = iorder(j)
else
exit
endif
do while (x(j)<xtmp)
x(j+1_8) = x(j)
iorder(j+1_8) = iorder(j)
j = j-1_8
if (j<1_8) exit
enddo
x(j+1_8) = xtmp
iorder(j+1_8) = i0