37 integer,
intent(out) :: cpt
38 integer,
dimension(n ),
intent(out) :: t
39 integer,
dimension(n1),
intent(in) :: t1
40 integer,
dimension(n2),
intent(in) :: t2
41 integer,
intent(in) :: n, n1, n2
47 do while( (ii<=n1).AND.(jj<=n2) )
49 if (t1(ii) < t2(jj))
then 54 write(*,*)
"ERROR = algebra_set: merge_sorted_set: 1" 62 else if (t1(ii) > t2(jj))
then 67 write(*,*)
"ERROR = algebra_set: merge_sorted_set: 2" 80 write(*,*)
"ERROR = algebra_set: merge_sorted_set: 3" 101 write(*,*)
"ERROR = algebra_set: merge_sorted_set: 4" 106 t(cpt:cpt+ll) = t1(ii:n1)
109 else if (jj<=n2)
then 117 write(*,*)
"ERROR = algebra_set: merge_sorted_set: 5" 122 t(cpt:cpt+ll) = t2(jj:n2)
135 integer,
intent(out) :: cpt
136 integer,
dimension(n ),
intent(out) :: t
137 integer,
dimension(n1),
intent(in) :: t1
138 integer,
dimension(n2),
intent(in) :: t2
139 integer,
intent(in) :: n, n1, n2
145 do while( (ii<=n1).AND.(jj<=n2) )
147 if (t1(ii) < t2(jj))
then 150 else if (t1(ii) > t2(jj))
then 158 write(*,*)
"ERROR = algebra_set: cap_sorted_set" 177 integer,
dimension(2),
intent(inout) :: t
181 if (t(1) > t(2) )
then 197 subroutine sort(t, n)
198 integer,
dimension(n),
intent(inout) :: t
199 integer ,
intent(in) :: n
207 if (t(ii)<=a)
goto 10
223 integer,
dimension(n),
intent(in) :: t
224 integer,
dimension(n),
intent(out) :: new_i
225 integer ,
intent(in) :: n
227 integer :: i,j,z,gap,i_z
230 new_i = (/ (i, i=1,n) /)
249 if (z>t(new_i(j)))
then 250 new_i(j+gap)=new_i(j)
271 integer,
dimension(:),
intent(inout) :: E
subroutine, public merge_sorted_set(cpt, t, n, t1, n1, t2, n2)
t(1:cpt) = merge of the two arrays t1 and t2 of size n1 and n2
ALGEBRAIC OPERATIONS ON SETS
subroutine, public order_2(t)
order an array of size 2
subroutine, public sort(t, n)
Sorts the array t of length N in ascending order by the straight insertion method.
subroutine, public circperm(E)
Circular permutation of an array of integer.
subroutine, public cap_sorted_set(cpt, t, n, t1, n1, t2, n2)
t(1:cpt) = t1(1:n1) \cap t2(1:n2)
subroutine, public shellsort_dec(t, new_i, n)
Sort integer array : shell sort.