Description
Select the item's Boolean group, count same-group entries before it, and add the size of the other group only when its group is ordered second by trueFirst.
A stable partition groups items by a predicate while retaining their relative order within each group. One item's destination depends on earlier same-group items and group ordering.
Select the item's Boolean group, count same-group entries before it, and add the size of the other group only when its group is ordered second by trueFirst.
When to use this tool
Use List Stable Partition One Index Destination when you need one stable-partition destination from an explicit Boolean mask.
How to use the tool and how it works
- Enter mask, selected, trueFirst. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read index. Use the output convention below.
Select the item's Boolean group, count same-group entries before it, and add the size of the other group only when its group is ordered second by trueFirst.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| mask | Mask | Required. Array of boolean; maximum items 256. |
| selected | Selected | Required. Safe integer; minimum 0. |
| trueFirst | True First | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| index | Index | Required. Safe integer. |
{
"input": {
"mask": [
false,
true,
false,
true
],
"selected": 2,
"trueFirst": true
},
"output": {
"index": 3
}
} Limitations and assumptions
- This computes one destination under a stable partition; list values are not reordered.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Use the full partition operation when you need reordered values and verify that the mask aligns with those values.
References
Similar or alternative tools
- List: List Swap Index Map
Validate all indices within positive length.
- List: List Single Element Rank Shift
Map movedFrom to movedTo.