Choral
|
ALGEBRAIC OPERATIONS ON SETS More...
Functions/Subroutines | |
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 More... | |
subroutine, public | cap_sorted_set (cpt, t, n, t1, n1, t2, n2) |
t(1:cpt) = t1(1:n1) \cap t2(1:n2) More... | |
subroutine, public | order_2 (t) |
order an array of size 2 More... | |
subroutine, public | sort (t, n) |
Sorts the array t of length N in ascending order by the straight insertion method. More... | |
subroutine, public | shellsort_dec (t, new_i, n) |
Sort integer array : shell sort. More... | |
subroutine, public | circperm (E) |
Circular permutation of an array of integer. More... | |
ALGEBRAIC OPERATIONS ON SETS
Sorting algorithm are taken from
"SORTING PROGRAMS IN FORTRAN" © J-P Moreau
http://jean-pierre.moreau.pagesperso-orange.fr/f_sort.html
(excepted shellSort)
subroutine, public algebra_set::cap_sorted_set | ( | integer, intent(out) | cpt, |
integer, dimension(n ), intent(out) | t, | ||
integer, intent(in) | n, | ||
integer, dimension(n1), intent(in) | t1, | ||
integer, intent(in) | n1, | ||
integer, dimension(n2), intent(in) | t2, | ||
integer, intent(in) | n2 | ||
) |
t(1:cpt) = t1(1:n1) \cap t2(1:n2)
WARNING : t1 and t2 are assumed to be sorted in escending order
Definition at line 135 of file algebra_set.F90.
subroutine, public algebra_set::circperm | ( | integer, dimension(:), intent(inout) | E | ) |
Circular permutation of an array of integer.
E(1) = E(N) E(2) = E(1) ... E(N) = E(N-1)
Definition at line 271 of file algebra_set.F90.
subroutine, public algebra_set::merge_sorted_set | ( | integer, intent(out) | cpt, |
integer, dimension(n ), intent(out) | t, | ||
integer, intent(in) | n, | ||
integer, dimension(n1), intent(in) | t1, | ||
integer, intent(in) | n1, | ||
integer, dimension(n2), intent(in) | t2, | ||
integer, intent(in) | n2 | ||
) |
t(1:cpt) = merge of the two arrays t1 and t2 of size n1 and n2
t1 and t2 must be sorted in escending order ! no repetition of common entries
Definition at line 37 of file algebra_set.F90.
subroutine, public algebra_set::order_2 | ( | integer, dimension(2), intent(inout) | t | ) |
order an array of size 2
Definition at line 177 of file algebra_set.F90.
subroutine, public algebra_set::shellsort_dec | ( | integer, dimension(n), intent(in) | t, |
integer, dimension(n), intent(out) | new_i, | ||
integer, intent(in) | n | ||
) |
Sort integer array : shell sort.
new_i = inexes of t sorted decreasingly n = array size
Definition at line 223 of file algebra_set.F90.
subroutine, public algebra_set::sort | ( | integer, dimension(n), intent(inout) | t, |
integer, intent(in) | n | ||
) |
Sorts the array t of length N in ascending order by the straight insertion method.
NOTE: Straight insertion is a N² routine and should only be used for relatively smal arrays (N<100)
Definition at line 198 of file algebra_set.F90.