Skip to content

Main content

Matrix CSR Row Column Local Offset Tool

Calculate matrix csr row column local offset from explicit caller-supplied inputs.

Loading tool…

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

  1. Enter rowStart, rowEnd, columnIndices, targetColumn. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. 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 fieldMeaning and unitsAccepted input
rowStartRow StartRequired. Safe integer; minimum 0.
rowEndRow EndRequired. Safe integer.
columnIndicesColumn IndicesRequired. Array of safe integer; maximum items 256.
targetColumnTarget ColumnRequired. Safe integer; minimum 0.
Output fieldInterpretationReturned shape
offsetOffsetRequired. Safe integer.
foundWhether the requested entry was found; inspect this before using the offset.Required. Boolean.
json
{
  "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

  1. Calculation and input contract: matrix/matrix-csr-row-column-local-offset — tool.io

Similar or alternative tools