diff --git a/src/bottomup.rs b/src/bottomup.rs index 5ba15be..e1bb574 100644 --- a/src/bottomup.rs +++ b/src/bottomup.rs @@ -186,7 +186,6 @@ fn brute_force(data: &Data, block_size: usize, deg: usize, k: usize) -> Vec usize { } pub(crate) fn bit_value_in_block(bit: usize, block: &[u8]) -> bool { - let (byte_index, offset) = (bit / 8, bit % 8); + let (byte_index, offset) = (bit / 8, 7 - (bit % 8)); ((block[byte_index] >> offset) & 1) == 1 } @@ -125,7 +125,7 @@ pub(crate) fn _multi_eval2(bits: &[usize], data: &Data, t: &mut Duration) -> usi if i == data.data[0].len() { break; } - let mut result = vec![u128::MAX; l as usize]; + let mut result = vec![u128::MAX; l]; for b in bits.iter() { result = result .iter() diff --git a/src/main.rs b/src/main.rs index d56c988..dd8e0a1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -30,8 +30,8 @@ fn run_bottomup(args: Args) { let hist = bottomup( &training_data, args.block, - args.deg, args.k, + args.top, args.max_bits, args.threads, );