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
- Enter rows, columns. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- 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 field | Meaning and units | Accepted input |
|---|---|---|
| rows | Rows | Required. Safe integer. |
| columns | Columns | Required. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| result | Result | Required. Object. |
| result.empty | Whether the represented collection or span has no occupied elements. | Calculated result member: boolean. |
| result.rowSingleton | Row Singleton | Calculated result member: boolean. |
| result.columnSingleton | Column Singleton | Calculated result member: boolean. |
| result.scalarShape | Scalar Shape | Calculated result member: boolean. |
{
"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
Similar or alternative tools
- Matrix: Matrix Broadcast Singleton Axis Check
Mark axes compatible when equal or either equals one.
- Matrix Offdiagonal Entry Count
Compute rows × columns - min(rows, columns) using exact integers and return the off-diagonal count as decimal text.