pub fn fast_bool_anf_transform_unsigned<U: Unsigned + Shr<U, Output = U> + Shl<U, Output = U> + BitOr<U, Output = U> + BitAnd<U, Output = U> + PartialOrd<U> + Not<Output = U> + NumCast + AsPrimitive<usize> + Copy>(
    rule_number: U,
    num_variables_function: usize
) -> U
Expand description

Fast ANF transformation for cellular automata truth table rules expressed as unsigned integers

§Arguments

  • rule_number - The rule number truth table to transform
  • num_variables_function - The number of variables in the cellular automata function

§Returns

The ANF transformed rule number, as unsigned integer

§Panics

Panics if the unsigned type is not large enough to hold the rule number (debug only) Panics if the rule number is greater than or equal to 2^(2^n), n being the number of variables in the function, as the rule number cannot exist (debug only)

§Example

use fast_boolean_anf_transform::fast_bool_anf_transform_unsigned;
assert_eq!(fast_bool_anf_transform_unsigned(3u32, 2), 5); // rule 3: 1 ^ x1