function GatherByMask (const X: TMtxVecInt; const Mask: TMtxVecInt; const MaskNonZeroCount: integer = -1): TVecInt; overload;
Gathers the elements of X for which Mask holds a 1 to the calling object. Mask must hold only 0 and 1. MaskNonZeroCount, when not negative, is the number of ones in Mask; otherwise Mask.Sum() is used.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtxVecInt | source TVecInt or TMtxInt |
| 2 | Mask | TMtxVecInt | source TVecInt or TMtxInt |
| 3 | MaskNonZeroCount | integer |
Result: stored in self (calling object), returns self for chaining