Description
Search columnIndices only within [rowStart, rowEnd).
Compressed sparse-row storage locates each row between two pointer offsets. Repeated pointers represent empty rows, while a missing column search needs a distinct sentinel.
Search columnIndices only within [rowStart, rowEnd).
When to use this tool
Use Matrix CSR Row Column Local Offset when you need one CSR row span or local lookup.
How to use the tool and how it works
- Enter rowStart, rowEnd, columnIndices, targetColumn. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read offset, found. Inspect found before interpreting the associated values.
Search columnIndices only within [rowStart, rowEnd). Return the first matching global array offset and found true, or offset -1 and found false.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| rowStart | Row Start | Required. Safe integer; minimum 0. |
| rowEnd | Row End | Required. Safe integer. |
| columnIndices | Column Indices | Required. Array of safe integer; maximum items 256. |
| targetColumn | Target Column | Required. Safe integer; minimum 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| offset | Offset | Required. Safe integer. |
| found | Whether the requested entry was found; inspect this before using the offset. | Required. Boolean. |
{
"input": {
"rowStart": 1,
"rowEnd": 3,
"columnIndices": [
0,
2,
4
],
"targetColumn": 4
},
"output": {
"offset": 2,
"found": true
}
} Limitations and assumptions
- Indices need not be sorted; duplicate matches return the first and no matrix row count or numeric values are inspected.
- 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
Validate pointer, column, and value arrays together, including shape, sorting, and duplicate-entry policy.
References
Similar or alternative tools
- Matrix CSR Single Row Storage Span
Select row and return its start, next pointer as endExclusive, and their difference as count.
- Matrix Banded Row First Last Column
For a valid row, set first = max(0, row - lower) and last = min(columns - 1, row + upper).