Skip to content

Main content

Matrix: Matrix Shape Degenerate Axis Tag Tool

Tag an explicit matrix shape for empty and singleton axes without needing rows that cannot represent zero-by-N shape unambiguously.

Loading tool…

Description

Allow zero dimensions.

Matrix shapes can be empty or have singleton axes without containing a scalar. Broadcasting expands singleton dimensions under an explicit axis-by-axis compatibility rule.

Allow zero dimensions.

When to use this tool

Use Matrix: Matrix Shape Degenerate Axis Tag when you need a matrix shape, count, or structural entry classification.

How to use the tool and how it works

  1. Enter rows, columns. 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.

Allow zero dimensions. Mark empty for either zero axis, singleton flags independently for dimensions equal to one, and scalarShape only for 1 × 1.1

Input fieldMeaning and unitsAccepted input
rowsRowsRequired. Safe integer.
columnsColumnsRequired. Safe integer.
Output fieldInterpretationReturned shape
resultResultRequired. Object.
result.emptyWhether the represented collection or span has no occupied elements.Calculated result member: boolean.
result.rowSingletonRow SingletonCalculated result member: boolean.
result.columnSingletonColumn SingletonCalculated result member: boolean.
result.scalarShapeScalar ShapeCalculated result member: boolean.
json
{
  "input": {
    "rows": 0,
    "columns": 3
  },
  "output": {
    "result": {
      "empty": true,
      "rowSingleton": false,
      "columnSingleton": false,
      "scalarShape": false
    }
  }
}

Limitations and assumptions

  • This classifies dimensions without inspecting data, storage, or broadcasting compatibility.
  • 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 all axes and actual data lengths when validating a complete matrix or broadcast operation.

References

  1. Calculation and input contract: matrix/matrix-shape-degenerate-axis-tag — tool.io

Similar or alternative tools