SortParallel( list1, list2 )
SortParallel( list1, list2, func )
SortParallel
sorts the list list1 in increasing order just as Sort
(see Sort) does. In parallel it applies the same exchanges that are
necessary to sort list1 to the list list2, which must of course have
at least as many elements as list1 does.
gap> list1 := [ 5, 4, 6, 1, 7, 5 ];; gap> list2 := [ 2, 3, 5, 7, 8, 9 ];; gap> SortParallel( list1, list2 ); gap> list1; [ 1, 4, 5, 5, 6, 7 ] gap> list2; [ 7, 3, 2, 9, 5, 8 ] # '[ 7, 3, 9, 2, 5, 8 ]' is also possible
Sortex
(see Sortex) sorts a list and returns the sorting permutation.
GAP 3.4.4