pub enum BooleanFunctionError {
WrongStringHexTruthTableLength,
StringHexParseError,
TooBigVariableCount(usize),
UnexpectedError,
TooBigDerivativeDirection(u32),
InvalidWalshValuesCount(usize),
TooBigTruthTableForVarCount,
AlreadyBalanced,
ErrorParsingAnfString,
AnfFormNVariableTooBigFactor(usize, usize),
}
Expand description
Possible errors for the boolean function library.
Variants§
WrongStringHexTruthTableLength
Error parsing hex string: the string length must be a power of 2 to represent a truth table.
StringHexParseError
Error parsing hex string: probably some characters are not valid hex characters.
TooBigVariableCount(usize)
The Boolean function variable count is too big: it must be $\leq 6$ for crate::SmallBooleanFunction and $\leq 31$ for crate::BooleanFunction / crate::BigBooleanFunction. The last limit is due to the maximum number of variables that can be represented in a 32-bit integer.
UnexpectedError
An unexpected error occurred. This should not happen as the case is supposed to be handled. Please report this issue to the crate maintainer.
TooBigDerivativeDirection(u32)
The derivative direction is too big: it must be $< 2^n$, where n is the number of variables.
InvalidWalshValuesCount(usize)
The Walsh values count is invalid: it must be $2^n$, where $n \geq 2$. n is the number of variables of the Boolean function.
TooBigTruthTableForVarCount
The truth table is too big for the number of variables: it must be $< 2^{2^n}$, where n is the number of variables.
AlreadyBalanced
Cannot generate close balanced Boolean function iterator, as the given function is already balanced
ErrorParsingAnfString
Error parsing ANF string, should be in the form “x0x2x3 + x2*x3 + x1 + 1”
AnfFormNVariableTooBigFactor(usize, usize)
The given factor is too big for the variable count. For example, x4 cannot exist if variable count = 4
Trait Implementations§
Source§impl Clone for BooleanFunctionError
impl Clone for BooleanFunctionError
Source§fn clone(&self) -> BooleanFunctionError
fn clone(&self) -> BooleanFunctionError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for BooleanFunctionError
impl Debug for BooleanFunctionError
Source§impl Display for BooleanFunctionError
impl Display for BooleanFunctionError
Source§impl Error for BooleanFunctionError
impl Error for BooleanFunctionError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl PartialEq for BooleanFunctionError
impl PartialEq for BooleanFunctionError
impl StructuralPartialEq for BooleanFunctionError
Auto Trait Implementations§
impl Freeze for BooleanFunctionError
impl RefUnwindSafe for BooleanFunctionError
impl Send for BooleanFunctionError
impl Sync for BooleanFunctionError
impl Unpin for BooleanFunctionError
impl UnwindSafe for BooleanFunctionError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more