algorithms

Algorithm implementations

coinflip.algorithms.matrix_rank(matrix: Iterable[Iterable[typing_extensions.Literal[0, 1]]])Union[int, numpy.int64, numpy.int32, numpy.int8, numpy.int16, numpy.uint8, numpy.uint16, numpy.uint32, numpy.uint64][source]

Finds the rank of a binary matrix

Parameters

matrix (Iterable[Iterable[Integer]]) – Binary matrix to rank

Returns

rank (Integer) – Rank of matrix

Notes

Implementaton inpisred by a StackOverflow answer from Mark Dickinson.

coinflip.algorithms.berlekamp_massey(sequence: Sequence[typing_extensions.Literal[0, 1]])int[source]

Finds the shortest LSFR in a sequence