[−][src]Function number_encoding::combinadics::decode_mut
pub fn decode_mut(n: usize, k: usize, r: &mut [usize])
Writes the combination of a value to a slice.
The written combination can be encoded with encode
to get back n
.
let mut xs = vec![0; k]; decode_mut(n, k, &mut xs); assert_eq!(encode(&xs), n);
See decode
for a version that allocates a vector for the combination.
Panics
Panics in debug mode if n > 0 && k == 0
.