Skip to content

Main content

Matrix: Matrix Packed Lower Index Tool

Map one lower triangle entry to zero-based row-wise packed storage under explicit diagonal inclusion; no matrix allocation.

Loading tool…

Description

Validate a lower-triangle coordinate.

Packed matrix storage omits a triangle and maps coordinates into a linear array. Row-wise versus column-wise order and diagonal inclusion change the offset formula.

Validate a lower-triangle coordinate.

When to use this tool

Use Matrix: Matrix Packed Lower Index when you need an explicit packed or band-storage coordinate mapping.

How to use the tool and how it works

  1. Enter size, row, column, includeDiagonal. 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 result. Expand result to inspect the returned fields.

Validate a lower-triangle coordinate. Return row × (row + 1) / 2 + column with diagonal storage, or row × (row - 1) / 2 + column without it.1

Input fieldMeaning and unitsAccepted input
sizeSizeRequired. Safe integer.
rowRowRequired. Safe integer.
columnColumnRequired. Safe integer.
includeDiagonalInclude DiagonalRequired. Boolean.
Output fieldInterpretationReturned shape
resultResultRequired. Object.
result.packedOffsetPacked OffsetCalculated result member: number.
json
{
  "input": {
    "size": 4,
    "row": 2,
    "column": 1,
    "includeDiagonal": true
  },
  "output": {
    "result": {
      "packedOffset": 4
    }
  }
}

Limitations and assumptions

  • The packed index is zero based and row wise; invalid triangle positions are rejected rather than mirrored.
  • Outputs are nested inside result. 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

Check the consuming library's storage convention against several boundary coordinates before indexing its buffer.

References

  1. Calculation and input contract: matrix/matrix-packed-lower-index — tool.io

Similar or alternative tools