Column Major Stride Offset
Compute a contiguous column-major byte offset with explicit element size and base address; no memory access or inferred padding.
Description
Compute a contiguous column-major byte offset with explicit element size and base address; no memory access or inferred padding.
Column-major storage advances rows within a column before moving to the next column.
When to use this tool
Compute a contiguous column-major byte offset with explicit element size and base address; no memory access or inferred padding.
- Prepare the supplied rows, columns, row, column, elementBytes, baseOffset fields for this operation.
- Compare the complete example with the representation used by your own input before carrying the result into another step.
How to use the tool and how it works
- Enter rows, columns, row, column, elementBytes, baseOffset. Use the exact text syntax, units and index conventions explained below.
- Run the tool. If input validation fails, correct the supplied fields before interpreting any result.
- Read result.byteOffset. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.
Validate dimensions, in-bounds row/column, positive elementBytes and nonnegative baseOffset. Return baseOffset+(column*rows+row)*elementBytes and require safe integer output.1
| Input field | Meaning and representation | Accepted input |
|---|---|---|
| rows | rows. | Integer from 1 to 1e6 inclusive |
| columns | columns. | Integer from 1 to 1e6 inclusive |
| row | row. | Integer from 0 to rows - 1 inclusive |
| column | column. | Integer from 0 to columns - 1 inclusive |
| elementBytes | element bytes. | Integer from 1 to 10000 inclusive |
| baseOffset | base offset. | Integer from 0 to 1e12 inclusive |
| Output field | Interpretation |
|---|---|
| result | Object containing the named outputs below. |
| result.byteOffset | The byte offset value under the stated formula or text convention. |
{
"input": {
"rows": 2,
"columns": 3,
"row": 1,
"column": 2,
"elementBytes": 4,
"baseOffset": 0
},
"output": {
"result": {
"byteOffset": 20
}
}
} Limitations and assumptions
- The model is tightly packed with no extra stride or interleaving. No memory is read or allocated.
- Coordinate pairs use [row,column] where stated. Masks are nonempty rectangular zero/one matrices of at most 128 rows, 128 columns and 16,384 cells; outside-mask values are unset for the neighborhood operations.
- Every declared top-level field is required and unexpected fields are rejected. Numeric inputs must be finite; ordinary text fields are bounded to 8,192 UTF-16 code units, with tighter operation-specific limits where stated.
- String lists have at most 128 entries of at most 128 code units; matrices have at most 128 rows and columns. Larger numeric lists and parsed JSON have separate bounded budgets. Nonfinite results and excessively large serialized outputs are rejected.
- Indexes are zero-based and spans have an exclusive end unless explicitly stated otherwise. A valid false, null or empty-list result is distinct from malformed input.
Alternative or Complementary methods
Keep row/column coordinates distinct from x/y pairs and byte offsets. Select the neighborhood metric, outside-mask rule and storage-order convention explicitly; these operations do not infer an image format.
References
Similar or alternative tools
- Row Major Stride Offset
Compute a contiguous row-major byte offset with explicit element size and base address; no memory access or inferred padding.
- Grid Mask Column Run Table
Tabulate maximal set-cell runs along columns of a rectangular binary mask with half-open local bounds.