⊂ — Enclose / Partitioned enclose
Keys: Alt-z. Ranks: ∞ monadic, 1 ∞ dyadic
⊂Y is a scalar holding Y.
A one-item bracket list, [Y], is a vector, not a scalar. ⊂ cannot enclose a function, because ⊂ next to a function forms a train. To enclose a function, write ᵘ after it. fᵘ is a scalar holding f.
⍴⊂1 2 3 ⍝ ⍬ₓ
↑⊂1 2 3 ⍝ 1 2 3
⊂3 ≡ 3 ⍝ $fWith axes, ⊂⍠K Y encloses cells on axes K.
⊂⍠1 (2 3⍴⍳6) ⍝ [[0 1 2] [3 4 5]]N⊂Y starts partitions at positive marks along the leading axis. Each partition is a block of major cells. Leading zero marks are ignored.
1 0 1 0⊂"abcd" ⍝ "ab" "cd"
1 0 1⊂3 2⍴⍳6 ⍝ [[0 1⋄2 3] [4 5⋄]]A mark greater than 1 starts extra empty partitions. Unit marks extend. N⊂⍠K Y partitions along axis K instead. N⊂⍤1 Y partitions each row.
1 0 1⊂⍠1 (2 3⍴⍳6) ⍝ [[0 1⋄3 4] [[2]⋄[5]]]
1 0 1⊂⍤1 (2 3⍴⍳6) ⍝ [[0 1] [2]⋄[3 4] [5]]See also ⊆.
Inverse
⊂⁻¹Y is ↑Y. X⊂⁻¹Y joins the parts Y. Partitioning the result by X must give Y again, so X can’t drop leading items.
⊂⁻¹⊂1 2 ⍝ 1 2
1 0 1⊂⁻¹(1 2⋄3) ⍝ 1 2 3