atlas Library · Script File
sort.at
Definitions in source order
is_sorted
a user function to verify that sorting has worked
merge
merge weakly increasing lists
also in this file at line 62; also defined in nilpotent_posets.at
sort
merge sort
also in this file at line 59, line 60, line 61; also defined in sommers.at, nilpotent_posets.at, hodge_functions.at
merge_u
merge unique weakly increasing lists
sort_u
sort, keeping unique copy of duplicates
also in this file at line 66, line 67, line 68; also defined in K_types.at, nilpotent_posets.at
sort 3 overloads
sort = sort(<=@(int,int))sort = sort(<=@(rat,rat))sort = sort(<=@(string,string))also in this file at line 25; also defined in sommers.at, nilpotent_posets.at, hodge_functions.at
merge
merge = merge(<=@(int,int))used separately in combinatorics.at
also in this file at line 11; also defined in nilpotent_posets.at
reverse_sort 3 overloads
reverse_sort = sort(>=@(int,int))reverse_sort = sort(>=@(rat,rat))reverse_sort = sort(>=@(string,string))sort_u 3 overloads
sort_u = sort_u(<=@(int,int))sort_u = sort_u(<=@(rat,rat))sort_u = sort_u(<=@(string,string))also in this file at line 50; also defined in K_types.at, nilpotent_posets.at
merge_u 3 overloads
merge_u = merge_u(<=@(int,int))merge_u = merge_u(<=@(rat,rat))merge_u = merge_u(<=@(string,string))also in this file at line 33
the following helps stable-sorting of anything according to a statisticL73
ranking
Compute list |R| such that |R[i]| is index of element ranked |i| for |leq|. For $i<j$ one will have |leq(a[R[i]],a[R[j]])|, and in case of equality (the comparison also holds in the opposite order) one also has |R[i]<R[j]| (stability). This is the inverse of the permutation that stable-sorts the list |a| into into order for |leq|, the latter being called the standardisation of |a|. Therefore this function used to be called |inv_standardisation|.
also in this file at line 138, line 139, line 140, line 192, line 209
sort_by
merge_by
don't bother to improve this
sort_u_by
merge_u_by
sort_by 2 overloads
when sorting by integer or rational value, default to increasing sort
also in this file at line 87
lookup_in
partition_by
group together elements with the same value under |f|, ordered by that value
representatives_by
similar, but keep only one (the first) element for each value of |f|
lexicographic
let length difference decide if one is prefix ot the otherL134
ranking 3 overloads
ranking = ranking(<=@(int,int))ranking = ranking(<=@(rat,rat))ranking = ranking(<=@(string,string))Here are example calls of the model functions above. They can be defined here because reducibility_points and height are built-in functions (those defined in basic.at could also be used). If however you need to sort on a custom attribute defined elsewhere, DON'T do so here (and don't include modules to make that possible); rather call sort_by in the script where that custom attribute is defined. For instance LKT.at defines the |attribute LKT_dimensions|, and then defines sort_by_dimension in a call of sort_by, whose argument uses that attribute.L142
sort_by_reducibility_points
sort_by_reducibility_points = ([(Param,bool)]->[(Param,bool)])sort list of pairs [(Param,bool)] by #reducibility_points of Param
sort_by_reducibility
sort_by_reducibility = ([Param]->[Param])sort list [Param] by #reducibility_points of Param
sort_by_height 4 overloads
sort_by_height = ([KType] -> [KType])Sort list of parameters by height
sort_by_height = ([Param] -> [Param])sort_by_height = ([(Split,KType)] -> [(Split,KType)])Same with a Split attached, which is ignored for sorting
sort_by_height = ([(Split,Param)] -> [(Split,Param)])also defined in K_norm.at
lex_leq
lex_leq (vec v,vec w) = boolcomparing vectors lexicographically
assert(@:#v=#w);
rlex_leq
rlex_leq (vec v,vec w) = boolcompariung fixed size vectors lexicographically (restricted lex ordering)
assert(@:#v=#w);
slex_leq
slex_leq (vec v,vec w) = boolshort lex ordering
for types [T], including [int], one can also use |lexicographic(leq@(T,T))|L189
ranking
ranking = ranking(lex_leq@(vec,vec))also in this file at line 84, line 138, line 139, line 140, line 209
sort_lex
sort_lex = sort(lex_leq@(vec,vec))also in this file at line 210
sort_u_lex
sort_u_lex = sort_u(lex_leq@(vec,vec))also in this file at line 211
sort_rlex
sort_rlex = sort(rlex_leq@(vec,vec))also in this file at line 212
sort_u_rlex
sort_u_rlex = sort_u(rlex_leq@(vec,vec))also in this file at line 213
sort_slex
sort_slex = sort(slex_leq@(vec,vec))also in this file at line 214
sort_u_slex
sort_u_slex = sort_u(slex_leq@(vec,vec))also in this file at line 215
(lex_leq, rlex_leq, slex_leq)
(lex_leq,rlex_leq,slex_leq) = …comparing rational vectors
ranking
ranking = ranking(lex_leq@(ratvec,ratvec))also in this file at line 84, line 138, line 139, line 140, line 192
sort_lex
sort_lex = sort(lex_leq@(ratvec,ratvec))also in this file at line 193
sort_u_lex
sort_u_lex = sort_u(lex_leq@(ratvec,ratvec))also in this file at line 194
sort_rlex
sort_rlex = sort(rlex_leq@(ratvec,ratvec))also in this file at line 195
sort_u_rlex
sort_u_rlex = sort_u(rlex_leq@(ratvec,ratvec))also in this file at line 196
sort_slex
sort_slex = sort(slex_leq@(ratvec,ratvec))also in this file at line 197
sort_u_slex
sort_u_slex = sort_u(slex_leq@(ratvec,ratvec))also in this file at line 198
Generated from atlas-scripts at commit 648506c (2026-10-13).