mirror of
https://github.com/LCPQ/quantum_package
synced 2025-01-03 10:05:57 +01:00
Fixed selection sort
This commit is contained in:
parent
1ac36ab762
commit
9b4131139b
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user