The following example shows how the grade down function can be used to sort a
vector in descending order:
The Q Function: Grade Down
The Q symbol is formed by overstriking the Vsymbol and the I symbol.
Monadic (One-Argument) Form: Grade Down Q
Thegrade down function result is the index values that would select the elements
of argument B in descending order. That is, the first element of the result is the
index of the largest element in argument B, the next element is the index of the
next largest element in argument B, and so on. Argument B must be
a numeric
vector. When two or more elements in the vector have the same numeric value,
their position in the vector determines their order in the result (the index value
of the first occurrence appears first in the output). The number of elements in
the result is the same as the number of elements in the argument:
h 4- :I. 4 :I. 2 1. 6 :I. 13 :I. 5 1. :I.
A I:: 9 A
3
1. El 1.0 1.5 1. 4 I. 2 1. :I,
The following example shows how equal elements are handled when using the grade
up and grade down functions:
a4
vector in descending order:
The Q Function: Grade Down
The Q symbol is formed by overstriking the Vsymbol and the I symbol.
Monadic (One-Argument) Form: Grade Down Q
Thegrade down function result is the index values that would select the elements
of argument B in descending order. That is, the first element of the result is the
index of the largest element in argument B, the next element is the index of the
next largest element in argument B, and so on. Argument B must be
a numeric
vector. When two or more elements in the vector have the same numeric value,
their position in the vector determines their order in the result (the index value
of the first occurrence appears first in the output). The number of elements in
the result is the same as the number of elements in the argument:
h 4- :I. 4 :I. 2 1. 6 :I. 13 :I. 5 1. :I.
A I:: 9 A
3
1. El 1.0 1.5 1. 4 I. 2 1. :I,
The following example shows how equal elements are handled when using the grade
up and grade down functions:
a4