pub struct PseudoBooleanConstraintEncoder { /* private fields */ }Expand description
The main struct through which the constraint encoders are to be used
Implementations§
Source§impl PseudoBooleanConstraintEncoder
impl PseudoBooleanConstraintEncoder
pub fn new( weighted_literals: Vec<WeightedLiteral>, encoding_algorithm: PseudoBooleanEncoding, ) -> Self
pub fn from_single_integer_function( weighted_literals: Vec<WeightedLiteral>, ) -> Self
pub fn from_weighted_literal_vector( weighted_literals: Vec<WeightedLiteral>, encoding_algorithm: PseudoBooleanEncoding, ) -> Self
pub fn from_literal_vector( literals: &[Literal], encoding_algorithm: PseudoBooleanEncoding, ) -> Self
pub fn from_function( function: &Function, solver: &mut Solver, encoding_algorithm: PseudoBooleanEncoding, ) -> Self
pub fn get_constant_term(&self) -> u64
pub fn constrain_at_most_k( &mut self, k: u64, solver: &mut Solver, ) -> Result<(), EncodingError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PseudoBooleanConstraintEncoder
impl !RefUnwindSafe for PseudoBooleanConstraintEncoder
impl !Send for PseudoBooleanConstraintEncoder
impl !Sync for PseudoBooleanConstraintEncoder
impl Unpin for PseudoBooleanConstraintEncoder
impl !UnwindSafe for PseudoBooleanConstraintEncoder
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
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>
Converts
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>
Converts
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