Apl2Idioms/BooleanSelectionAlgorithms
This is a sub-page of PhraseBook/ToDo/Apl2Idioms
B←(↑⍴M)↑(⍳⌈/P)εP ⍝ Boolean start vector given position indices.
B←2</0,(1+B)/B ⍝ Boolean expand length for headers.
B←∨/C⍷CM ⍝ Boolean rows of CM containing C.
BM←↑∨/VC⍷¨⊂CM ⍝ Boolean mask of CM containing VC.
B←∨/MVX^.(≡¨)⍉MVY ⍝ Boolean rows of MVX containing MVY.
B←,1↑[0]C⍷CM ⍝ Boolean rows of CM starting with C.
B←,1↑[1]C⍷CM ⍝ Boolean rows of CM starting with C.
BA←A≡¨⊂V ⍝ Item equals. Find item V in array A.
(,BA)←<\,BA←C⍷CA ⍝ Boolean one at first occurrence of C in CA.
B←CM^.εC ⍝ Does each row contain only items from C?
B←0^.=↑¨0⍴¨M ⍝ Which rows of M are all numeric?
B←((×IS)×⍴B)↑IS↓B ⍝ Shift B forward or backward IS positions.
APL Wiki