mirror of
https://github.com/LCPQ/quantum_package
synced 2025-01-03 18:16:12 +01:00
Fixed selection sort
This commit is contained in:
parent
1ac36ab762
commit
9b4131139b
@ -318,13 +318,11 @@ BEGIN_TEMPLATE
|
|||||||
xtmp = x(i)
|
xtmp = x(i)
|
||||||
i0 = iorder(i)
|
i0 = iorder(i)
|
||||||
j = i-1_8
|
j = i-1_8
|
||||||
do j=i-1_8,1_8,-1_8
|
do while (x(j)<xtmp)
|
||||||
if ( x(j) > xtmp ) then
|
x(j+1_8) = x(j)
|
||||||
x(j+1_8) = x(j)
|
iorder(j+1_8) = iorder(j)
|
||||||
iorder(j+1_8) = iorder(j)
|
j = j-1_8
|
||||||
else
|
if (j<1_8) exit
|
||||||
exit
|
|
||||||
endif
|
|
||||||
enddo
|
enddo
|
||||||
x(j+1_8) = xtmp
|
x(j+1_8) = xtmp
|
||||||
iorder(j+1_8) = i0
|
iorder(j+1_8) = i0
|
||||||
|
Loading…
Reference in New Issue
Block a user