Binary words for power-of-two residue matrices #
A rectangular matrix over ZMod (2 ^ w) is represented row by row, with w low-order-first
bits per entry. The dimensions are external parameters. Decoding arbitrary words pads missing
bits with false and ignores excess bits, including when a dimension or the width is zero.
Main definitions #
Cslib.Matrix.toBinary,Cslib.Matrix.ofBinary: fixed-width row-major encoding and total decoding.Cslib.Matrix.binaryEntry: the number read from the entry bits at an arbitrary row and column of a word, with missing bitsfalse.Cslib.Matrix.encBinary: the injective encoding of matrices with fixed dimensions and width.
Main results #
Cslib.Matrix.ofBinary_toBinary: decoding a matrix's word recovers the matrix.Cslib.Matrix.length_toBinary: the exact complete output length isrows * cols * w.