Major cell: Difference between revisions
Jump to navigation
Jump to search
m (Array relationships category) |
m (Text replacement - " ⊢( *[^∘])" to " ⎕←$1") |
||
Line 5: | Line 5: | ||
<source lang=apl inline>A</source> is an array with [[shape]] <source lang=apl inline>3 4</source>. Using [[Tally]] we see that the number of major cells in <source lang=apl inline>A</source> is the first element of the shape, <source lang=apl inline>3</source>: | <source lang=apl inline>A</source> is an array with [[shape]] <source lang=apl inline>3 4</source>. Using [[Tally]] we see that the number of major cells in <source lang=apl inline>A</source> is the first element of the shape, <source lang=apl inline>3</source>: | ||
<source lang=apl> | <source lang=apl> | ||
⎕←A ← 5 3 1 ∘.∧ 2 3 4 5 | |||
10 15 20 5 | 10 15 20 5 | ||
6 3 12 15 | 6 3 12 15 | ||
Line 21: | Line 21: | ||
Given another array <source lang=apl inline>B</source> we can search for cells of <source lang=apl inline>B</source> which [[match]] major cells of <source lang=apl inline>B</source>. [[High-rank set functions|High-rank]] [[Index-of]] always searches for right argument cells whose rank matches the rank of a left argument major cell: if the right argument is a [[vector]] and not a [[matrix]] then it searches for the entire vector rather than its major cells (which are [[scalar]]s). | Given another array <source lang=apl inline>B</source> we can search for cells of <source lang=apl inline>B</source> which [[match]] major cells of <source lang=apl inline>B</source>. [[High-rank set functions|High-rank]] [[Index-of]] always searches for right argument cells whose rank matches the rank of a left argument major cell: if the right argument is a [[vector]] and not a [[matrix]] then it searches for the entire vector rather than its major cells (which are [[scalar]]s). | ||
<source lang=apl> | <source lang=apl> | ||
⎕←B ← ↑ 4,/⍳6 | |||
1 2 3 4 | 1 2 3 4 | ||
2 3 4 5 | 2 3 4 5 |