Module slices

Source
Expand description

Functions for working with slices.

Structs§

ExhaustiveSlicePermutations
Generates every permutation of a slice.

Functions§

exhaustive_slice_permutations
Generates every permutation of a slice.
min_repeating_len
Given a slice with nonzero length $\ell$, returns the smallest $n$ such that the slice consists of $n/\ell$ copies of a length-$\ell$ subslice.
slice_leading_zeros
Counts the number of zeros that a slice starts with.
slice_move_left
Given a slice and an starting index, copies the subslice starting from that index to the beginning of the slice.
slice_set_zero
Sets all values in a slice to 0.
slice_test_zero
Tests whether all values in a slice are equal to 0.
slice_trailing_zeros
Counts the number of zeros that a slice ends with.