subroutine swap_row(n, a, order, irow1, irow2)
implicit real(8) (a-h, o-z)

real(8) a(n,n), saved(n)
integer order(n)

! Permuta liniile "irow1" si "irow2":
saved =a(irow1, :)
a(irow1, :) =a(irow2,:)
a(irow2,:) =saved

! Schimba liniile in ORDER:
isave =order(irow1)
order(irow1) =order(irow2)
order(irow2) =isave

END


