pub struct SensitivityChecker {
pub table: Vec<bool>,
pub n: usize,
}Expand description
Compute sensitivity and block sensitivity of a Boolean function. The function is given as a truth table (index = bit string, value = output).
Fields§
§table: Vec<bool>Truth table: table[x] = f(x). Length must be 2^n.
n: usizeNumber of input bits n.
Implementations§
Source§impl SensitivityChecker
impl SensitivityChecker
Sourcepub fn sensitivity_at(&self, x: usize) -> usize
pub fn sensitivity_at(&self, x: usize) -> usize
Sensitivity of f at input x: number of coordinates i where flipping bit i changes f(x).
Sourcepub fn max_sensitivity(&self) -> usize
pub fn max_sensitivity(&self) -> usize
Maximum sensitivity over all inputs.
Sourcepub fn block_sensitivity_at(&self, x: usize) -> usize
pub fn block_sensitivity_at(&self, x: usize) -> usize
Block sensitivity at input x: max number of disjoint sensitive blocks.
Sourcepub fn max_block_sensitivity(&self) -> usize
pub fn max_block_sensitivity(&self) -> usize
Maximum block sensitivity over all inputs.
Sourcepub fn check_huang_theorem(&self) -> bool
pub fn check_huang_theorem(&self) -> bool
Check Huang’s sensitivity theorem: s(f)^2 >= bs(f).
Auto Trait Implementations§
impl Freeze for SensitivityChecker
impl RefUnwindSafe for SensitivityChecker
impl Send for SensitivityChecker
impl Sync for SensitivityChecker
impl Unpin for SensitivityChecker
impl UnsafeUnpin for SensitivityChecker
impl UnwindSafe for SensitivityChecker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more