Description
Generate elementary row-operation traces with exact safe-integer intermediate matrices and delegated determinants inheriting 12-significant-digit core rounding.
A matrix construction produces numeric arrays with a target algebraic property. Floating-point residuals check how closely a computed result satisfies that property, while conditioning determines how sensitive it is to numerical error.
Generate elementary row-operation traces with exact safe-integer intermediate matrices and delegated determinants inheriting 12-significant-digit core rounding.
When to use this tool
Use this generator to create reproducible matrix row operation trace cases from the supplied model or bank. Inspect the returned evidence before using cases in a test or exercise.
How to use the tool and how it works
- Supply matrix, operationCount, operations in the field shapes below. Set seed when you need an explicit replay.
- Run the tool and correct any input error. For generated controls, distinguish a successful fixture containing an invalid case from failure to generate the fixture.
- Read initial, initialDeterminant, steps. Use the conventions below and keep answer-bearing fields separate when presenting an exercise.
Sample row swaps, nonzero scaling, or additions of another row times a factor from -2, -1, 1, or 2. Record each resulting matrix and determinant. The determinant multiplier is minus one for a swap, the factor for scaling, and one for addition.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| matrix | Matrix | Required. Array of Array of Safe integer.; minimum items 2; maximum items 3.; minimum items 2; maximum items 3. |
| operationCount | Operation Count | Required. Safe integer; minimum 1; maximum 8. |
| operations | Operations | Required. Array of Text; one of "swap", "scale", "add".; minimum items 1; maximum items 3. |
| seed | Optional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed. | Optional. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| initial | Initial | Required. Array of Array of Safe integer.; minimum items 2; maximum items 3.; minimum items 2; maximum items 3. |
| initialDeterminant | Initial Determinant | Required. Finite number. |
| steps | Steps | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 8. |
| steps[].operation | Operation | Required. Object; no unknown keys. |
| steps[].operation.kind | Kind | Required. Text; one of "swap", "scale", "add". |
| steps[].operation.row | Row | Required. Safe integer. |
| steps[].operation.other | Other | Required. Safe integer. |
| steps[].operation.factor | Factor | Required. Safe integer. |
| steps[].matrix | Matrix | Required. Array of Array of Safe integer.; minimum items 2; maximum items 3.; minimum items 2; maximum items 3. |
| steps[].determinant | Determinant | Required. Finite number. |
| steps[].multiplier | Multiplier | Required. Finite number. |
| randomness | Replay metadata: source is seed or context; seed is the normalized 32-bit seed or null for a context source. | Required. Object; no unknown keys. |
| randomness.seed | Optional numeric replay seed; normalization and precedence are explained below. | Required. Safe integer. or Null. |
| randomness.source | Source | Required. Text; one of "context", "seed". |
An explicit safe-integer seed takes precedence over injected context randomness and is normalized to an unsigned 32-bit integer. With no seed and no context source, replay uses the fixed tool.io default seed. A context source must return finite values from zero inclusive to one exclusive; its advancing state must be retained separately. randomness records the source and normalized seed, or null for context. These generators are not cryptographic random sources.
{
"input": {
"matrix": [
[
1,
2
],
[
3,
4
]
],
"operationCount": 1,
"operations": [
"swap"
],
"seed": 42
},
"output": {
"initial": [
[
1,
2
],
[
3,
4
]
],
"initialDeterminant": -2,
"steps": [
{
"operation": {
"kind": "swap",
"row": 0,
"other": 1,
"factor": -1
},
"matrix": [
[
3,
4
],
[
1,
2
]
],
"multiplier": -1,
"determinant": 2
}
],
"randomness": {
"seed": 42,
"source": "seed"
}
}
} Limitations and assumptions
- Row indexes are zero-based and source and intermediate entries must stay safe integers. Determinants use the delegated numerical convention. A trace demonstrates row operations rather than solving a system or guaranteeing numerical stability.
- A replay requires the same complete input and implementation. Randomized construction does not guarantee uniform coverage of every feasible output; finite samples can repeat unless a distinct-selection rule is explicitly stated.
- The field tables state structural bounds; cross-field constraints and bounded search or output budgets also apply. Unknown keys are rejected where the object contract disallows them. Input errors are distinct from null fields and deliberate invalid controls in a successful output.
Alternative or Complementary methods
For a supplied example, inspect the returned construction or delegated check directly. To evaluate a consumer, also test cases chosen for its own boundaries; a generated finite corpus does not establish exhaustive coverage.
References
Similar or alternative tools
- Random Orthogonal Matrix Generator
Generate an integer source matrix, scale it safely and reuse Householder QR for an orthogonal factor with a caller-bounded Q-transpose-Q residual; rank-deficient and zero sources use the core's deterministic completion, not Haar-uniform sampling.
- Random Positive-Definite Matrix Generator
Generate an integer matrix A and construct A-transpose A plus a supplied positive diagonal shift using existing matrix tools, then verify Cholesky and report a relative reconstruction residual; shifts lost to floating-point conditioning return a structured failure.