def row_major
import bendtorch-core@0.1.0.0/src/shape/core.bend as Coreimport Base
166def row_major(+dims: List<&2, Nat>, coordinate: Coordinate(dims)) -> Nat:
167 match dims:
168 case Nil{}:
169 0n
170 case +head <> +tail:
171 CStep{index, rest} = coordinate
172 Nat.add(Nat.mul(Fin.value(head, index), numel(tail)), row_major(tail, rest))
Uses (8)
Used by (19)
- bendtorch-core@0.1.0.0/src/shape/LAWS:flatten_spec
- bendtorch-core@0.1.0.0/src/shape/index_proofs:flatten_row_major
- bendtorch-core@0.1.0.0/src/shape/coordinate_proofs:offset_indices
- bendtorch-core@0.1.0.0/src/shape/coordinate_proofs:offset_of
- bendtorch-core@0.1.0.0/src/shape/coordinate_proofs:row_major_lt
- …