Window Containing Index Range
Return the inclusive range of full stride-one window starts containing an index.
Description
Return the inclusive range of full stride-one window starts containing an index.
An element can belong to several complete windows of a fixed length. The valid start range identifies all those windows without constructing them.
When to use this tool
Return the inclusive range of full stride-one window starts containing an index.
- Prepare the supplied length, window, index fields for this operation.
- Compare the complete example with the representation used by your own input before carrying the result into another step.
How to use the tool and how it works
- Enter length, window, index. Use the exact text syntax, units and index conventions explained below.
- Run the tool. If input validation fails, correct the supplied fields before interpreting any result.
- Read result.firstStart, result.lastStart. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.
Validate positive length, window no larger than length, and index within the list. Return firstStart=max(0,index-window+1) and lastStart=min(index,length-window).1
| Input field | Meaning and representation | Accepted input |
|---|---|---|
| length | length. | Integer from 1 to 10000 inclusive |
| window | window. | Integer from 1 to length inclusive |
| index | index. | Integer from 0 to length - 1 inclusive |
| Output field | Interpretation |
|---|---|
| result | Object containing the named outputs below. |
| result.firstStart | The first start value under the stated formula or text convention. |
| result.lastStart | The last start value under the stated formula or text convention. |
{
"input": {
"length": 8,
"window": 3,
"index": 2
},
"output": {
"result": {
"firstStart": 0,
"lastStart": 2
}
}
} Limitations and assumptions
- Both returned start bounds are inclusive and zero-based. The tool plans windows for one index without inspecting list values or adding padded edge windows.
- Every declared top-level field is required and unexpected fields are rejected. Numeric inputs must be finite; ordinary text fields are bounded to 8,192 UTF-16 code units, with tighter operation-specific limits where stated.
- Ordinary string lists have at most 128 entries of at most 128 code units each; numeric lists and matrices have separate bounded size checks. Nonfinite results and excessively large serialized outputs are rejected.
- Indexes are zero-based and spans have an exclusive end unless explicitly stated otherwise. A valid false, null or empty-list result is distinct from malformed input.
Alternative or Complementary methods
Use explicit source-index maps when rearranging data or planning missing-value fills. Keep row-major coordinates, cyclic indexes and one-based occurrence numbers distinct, and inspect null donor positions before copying values.
References
Similar or alternative tools
- sliding window
Slice a list into overlapping fixed-size windows stepped one element at a time.
- Sliding Window Distinct Count
Count distinct exact-string values in each complete stride-one window, preserving window order.