Vocabulary/bslashco

From J Wiki
Jump to navigation Jump to search

>> <<   Down to: Dyad   Back to: Vocabulary Thru to: Dictionary

\: y Grade Down

Rank Infinity -- operates on x and y as a whole, by items of y -- WHY IS THIS IMPORTANT?


The permutation that sorts list y into descending order (numerical or lexicographical)

Companion verb to /:

   ] p=: \: Wk
3 2 4 0 6 1 5
   p { Wk
+--+--+--+--+--+--+--+
|We|Tu|Th|Su|Sa|Mo|Fr|
+--+--+--+--+--+--+--+
   ] Wko=: > Wk
Su
Mo
Tu
We
Th
Fr
Sa
   p { Wko   NB. also works with unboxed list
We
Tu
Th
Su
Sa
Mo
Fr

See Also


x \: y Sort

Rank Infinity -- operates on x and y as a whole, by items -- WHY IS THIS IMPORTANT?


Applies to list x the permutation that sorts list y into descending order (numerical or lexicographical)

Companion verb to /:

   (100+i.7) \: Wk
103 102 104 100 106 101 105

Common uses

Sort a list y into descending order

(Wk is as defined above)

   tros=: \:~   NB. (/:~ y) is the same as: (y /: y)
   tros Wk
+--+--+--+--+--+--+--+
|We|Tu|Th|Su|Sa|Mo|Fr|
+--+--+--+--+--+--+--+

See Also