Skip to content

Main content

Matrix CSR Single Row Storage Span Tool

Compute matrix csr single row storage span from explicit bounded inputs.

Loading tool…

Description

Select row and return its start, next pointer as endExclusive, and their difference as count.

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.

Select row and return its start, next pointer as endExclusive, and their difference as count.

When to use this tool

Use Matrix CSR Single Row Storage Span when you need one CSR row span or local lookup.

How to use the tool and how it works

  1. Enter rowPointers, row. 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 start, endExclusive, count. Use the output convention below.

Require rowPointers starting at zero, nonnegative and nondecreasing, with at least two entries. Select row and return its start, next pointer as endExclusive, and their difference as count.1

Input fieldMeaning and unitsAccepted input
rowPointersRow PointersRequired. Array of safe integer; maximum items 256.
rowRowRequired. Safe integer; minimum 0.
Output fieldInterpretationReturned shape
startStartRequired. Safe integer.
endExclusiveEnd boundary excluded from the represented span.Required. Safe integer.
countCountRequired. Safe integer.
json
{
  "input": {
    "rowPointers": [
      0,
      2,
      2,
      5
    ],
    "row": 1
  },
  "output": {
    "start": 2,
    "endExclusive": 2,
    "count": 0
  }
}

Limitations and assumptions

  • This validates the pointer layout only; column indices, value-array lengths, and duplicate entries are not checked.
  • 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-single-row-storage-span — tool.io

Similar or alternative tools