>>
<<
Ndx
Usr
Pri
Phr
Dic
Rel
Voc
!:
wd
Help
Dictionary
16. Partitions (Adverbs)
Used monadically, the results of the adverbs \ and \.
and /. provide prefix, suffix, and oblique
partitions. They are commonly applied to arithmetic functions
such as summation (+/), product over (*/),
and continued fractions ((+%)/); we will also illustrate
them for box (<), which shows their structure more clearly:
a=: 2 3 5 7 11 [ t=: 1 2 1 */ 1 3 3 1
,.&.>((+/\a) ; (+/\.a) ; ((+%)/\a) ; (+//.t);t)
+--+--+-------+--+-------+
| 2|28| 2| 1|1 3 3 1|
| 5|26|2.33333| 5|2 6 6 2|
|10|23| 2.3125|10|1 3 3 1|
|17|18|2.31304|10| |
|28|11|2.31304| 5| |
| | | | 1| |
+--+--+-------+--+-------+
<\a
+-+---+-----+-------+----------+
|2|2 3|2 3 5|2 3 5 7|2 3 5 7 11|
+-+---+-----+-------+----------+
<\.a
+----------+--------+------+----+--+
|2 3 5 7 11|3 5 7 11|5 7 11|7 11|11|
+----------+--------+------+----+--+
</.t
+-+---+-----+-----+---+-+
|1|3 2|3 6 1|1 6 3|2 3|1|
+-+---+-----+-----+---+-+
Used dyadically, they provide infix, outfix, and
key classification. For example:
3 <\ a
+-----+-----+------+
|2 3 5|3 5 7|5 7 11|
+-----+-----+------+
_3 <\ a
+-----+----+
|2 3 5|7 11|
+-----+----+
2<\.a
+------+------+------+-----+
|5 7 11|2 7 11|2 3 11|2 3 5|
+------+------+------+-----+
1 2 3 1 3 *//. a
14 3 55
>>
<<
Ndx
Usr
Pri
Phr
Dic
Rel
Voc
!:
wd
Help
Dictionary