1 c===========================================================================
3 c This file is part of TISEAN
5 c Copyright (c) 1998-2007 Rainer Hegger, Holger Kantz, Thomas Schreiber
7 c TISEAN is free software; you can redistribute it and/or modify
8 c it under the terms of the GNU General Public License as published by
9 c the Free Software Foundation; either version 2 of the License, or
10 c (at your option) any later version.
12 c TISEAN is distributed in the hope that it will be useful,
13 c but WITHOUT ANY WARRANTY; without even the implied warranty of
14 c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 c GNU General Public License for more details.
17 c You should have received a copy of the GNU General Public License
18 c along with TISEAN; if not, write to the Free Software
19 c Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 c===========================================================================
22 c part of the TISEAN randomize package for constraint surrogates
23 C permutation scheme for event times
24 c one event time is changed such that the two adjacent intervals are swapped
25 c author T. Schreiber (1999)
27 c-------------------------------------------------------------------
28 c get permutation specific options
30 subroutine opts_permute()
33 c-------------------------------------------------------------------
34 c print version information on permutation scheme
36 subroutine what_permute()
37 call ptext("Permutation scheme: event time preserving intervals")
40 c-------------------------------------------------------------------
41 c print permutation specific usage message
43 subroutine usage_permute()
46 c-------------------------------------------------------------------
47 c initialise all that is needed for permutation scheme
49 subroutine permute_init()
52 common nmax,cost,temp,cmin,rate,x
54 do 10 n=1,nmax*log(nmax*1.)
59 c-------------------------------------------------------------------
60 c find two indices n1, n2 to be exchanged, maybe using a parameter
61 c par provided by the cooling schedule
63 c here, n2 is not used at all; event 1 and nmax are never changed
65 subroutine permute(n1,n2)
69 n1=min(int(rand(0.0)*nmax)+2,nmax-1)
72 c-------------------------------------------------------------------
73 c given two indices n1, n2, actually perform the exchange
75 subroutine exch(n1,n2)
78 common nmax,cost,temp,cmin,rate,x
80 x(n1)=x(n1-1)+x(n1+1)-x(n1)