|
|
|
@ -2405,17 +2405,17 @@ predicate @var{pred}, in ascending order. |
|
|
|
|
|
|
|
|
|
|
|
@anchor{-grade-up} |
|
|
|
@anchor{-grade-up} |
|
|
|
@defun -grade-up (comparator list) |
|
|
|
@defun -grade-up (comparator list) |
|
|
|
Grade elements of @var{list} using @var{comparator} relation, yielding a |
|
|
|
Grade elements of @var{list} using @var{comparator} relation. |
|
|
|
permutation vector such that applying this permutation to @var{list} |
|
|
|
This yields a permutation vector such that applying this |
|
|
|
sorts it in ascending order. |
|
|
|
permutation to @var{list} sorts it in ascending order. |
|
|
|
|
|
|
|
|
|
|
|
@example |
|
|
|
@example |
|
|
|
@group |
|
|
|
@group |
|
|
|
(-grade-up '< '(3 1 4 2 1 3 3)) |
|
|
|
(-grade-up #'< '(3 1 4 2 1 3 3)) |
|
|
|
@result{} '(1 4 3 0 5 6 2) |
|
|
|
@result{} '(1 4 3 0 5 6 2) |
|
|
|
@end group |
|
|
|
@end group |
|
|
|
@group |
|
|
|
@group |
|
|
|
(let ((l '(3 1 4 2 1 3 3))) (-select-by-indices (-grade-up '< l) l)) |
|
|
|
(let ((l '(3 1 4 2 1 3 3))) (-select-by-indices (-grade-up #'< l) l)) |
|
|
|
@result{} '(1 1 2 3 3 3 4) |
|
|
|
@result{} '(1 1 2 3 3 3 4) |
|
|
|
@end group |
|
|
|
@end group |
|
|
|
@end example |
|
|
|
@end example |
|
|
|
@ -2423,17 +2423,17 @@ sorts it in ascending order. |
|
|
|
|
|
|
|
|
|
|
|
@anchor{-grade-down} |
|
|
|
@anchor{-grade-down} |
|
|
|
@defun -grade-down (comparator list) |
|
|
|
@defun -grade-down (comparator list) |
|
|
|
Grade elements of @var{list} using @var{comparator} relation, yielding a |
|
|
|
Grade elements of @var{list} using @var{comparator} relation. |
|
|
|
permutation vector such that applying this permutation to @var{list} |
|
|
|
This yields a permutation vector such that applying this |
|
|
|
sorts it in descending order. |
|
|
|
permutation to @var{list} sorts it in descending order. |
|
|
|
|
|
|
|
|
|
|
|
@example |
|
|
|
@example |
|
|
|
@group |
|
|
|
@group |
|
|
|
(-grade-down '< '(3 1 4 2 1 3 3)) |
|
|
|
(-grade-down #'< '(3 1 4 2 1 3 3)) |
|
|
|
@result{} '(2 0 5 6 3 1 4) |
|
|
|
@result{} '(2 0 5 6 3 1 4) |
|
|
|
@end group |
|
|
|
@end group |
|
|
|
@group |
|
|
|
@group |
|
|
|
(let ((l '(3 1 4 2 1 3 3))) (-select-by-indices (-grade-down '< l) l)) |
|
|
|
(let ((l '(3 1 4 2 1 3 3))) (-select-by-indices (-grade-down #'< l) l)) |
|
|
|
@result{} '(4 3 3 3 2 1 1) |
|
|
|
@result{} '(4 3 3 3 2 1 1) |
|
|
|
@end group |
|
|
|
@end group |
|
|
|
@end example |
|
|
|
@end example |
|
|
|
|