trusted
183
edits
mNo edit summary |
m (→Alternatives) |
||
Line 47: | Line 47: | ||
== Alternatives == | == Alternatives == | ||
Most dialects do not have Split. Instead, | Most dialects do not have Split. Instead, they can use [[Enclose]] (<source lang=apl inline>⊂</source>) with [[bracket axis]] or the [[Rank operator]]: | ||
<source lang=apl> | <source lang=apl> | ||
↓Y | ↓Y | ||
Line 68: | Line 68: | ||
└────┴────┴────┘ | └────┴────┴────┘ | ||
</source> | </source> | ||
It is common to split a higher-[[rank]] array into its constituent [[major cell]] | It is common to split a higher-[[rank]] array into its constituent [[major cell|major cells]]. The behaviour of Split on matrices might mislead to the belief that this is what the primitive does. However, it isn't so for vectors or arrays of higher rank than 2. Instead, the solution is to use or <source lang=apl inline>⊂[1↓⍳≢⍴Y]Y</source> or <source lang=apl inline>⊂⍤¯1⊢Y</source>: | ||
<source lang=apl> | <source lang=apl> | ||
⊂[1↓⍳≢⍴Y]Y | ⊂[1↓⍳≢⍴Y]Y | ||
Line 83: | Line 83: | ||
└────┴────┘ | └────┴────┘ | ||
</source> | </source> | ||
== External links == | == External links == | ||