canonical_drawdown: Canonical key for a periodic drawdown

View source: R/compare.R

canonical_drawdownR Documentation

Canonical key for a periodic drawdown

Description

Keys encode primitive dimensions and row-major bits. The lexicographically smallest representation over allowed transformations and all cyclic shifts is selected. Keys are lossless strings, not cryptographic hashes.

Usage

canonical_drawdown(
  x,
  reflect = FALSE,
  transpose = FALSE,
  invert = FALSE,
  max_work = 5e+07
)

Arguments

x

A binary drawdown.

reflect

Allow independent reversal of rows and columns.

transpose

Allow axis exchange. This does not invert bits automatically.

invert

Allow exchange of zero and one (face inversion).

max_work

Maximum estimated number of cell comparisons, guarding exhaustive search. Default 5e7. Memory and runtime still depend on input.

Value

A single character key. Equivalence is conditional on the options.

Examples

canonical_drawdown(matrix(c(1, 0, 0, 1), 2))

weaveCompare documentation built on Nov. 9, 2026, 1:10 a.m.